From owner-svn-src-all@freebsd.org Sun Jul 21 00: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 10CFAA4688; Sun, 21 Jul 2019 00:44:54 +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 E705694DD4; Sun, 21 Jul 2019 00:44:53 +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 C2D041AE0C; Sun, 21 Jul 2019 00:44:53 +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 x6L0ir6e046676; Sun, 21 Jul 2019 00:44:53 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6L0irl4046674; Sun, 21 Jul 2019 00:44:53 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907210044.x6L0irl4046674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 21 Jul 2019 00:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350188 - 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: 350188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E705694DD4 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.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: Sun, 21 Jul 2019 00:44:54 -0000 Author: cy Date: Sun Jul 21 00:44:52 2019 New Revision: 350188 URL: https://svnweb.freebsd.org/changeset/base/350188 Log: MFC r349979: 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. Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/fil.c Sat Jul 20 21:39:32 2019 (r350187) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Sun Jul 21 00:44:52 2019 (r350188) @@ -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: stable/12/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Sat Jul 20 21:39:32 2019 (r350187) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Sun Jul 21 00:44:52 2019 (r350188) @@ -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 21 00:44: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 ACA95A4676; Sun, 21 Jul 2019 00:44:53 +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 7DE7D94DD3; Sun, 21 Jul 2019 00:44:53 +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 1BB501AE0B; Sun, 21 Jul 2019 00:44:53 +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 x6L0iqDn046669; Sun, 21 Jul 2019 00:44:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6L0iq7q046667; Sun, 21 Jul 2019 00:44:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907210044.x6L0iq7q046667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 21 Jul 2019 00:44:52 +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: r350188 - 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: 350188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DE7D94DD3 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.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: Sun, 21 Jul 2019 00:44:53 -0000 Author: cy Date: Sun Jul 21 00:44:52 2019 New Revision: 350188 URL: https://svnweb.freebsd.org/changeset/base/350188 Log: MFC r349979: 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. Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/fil.c Sat Jul 20 21:39:32 2019 (r350187) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Sun Jul 21 00:44:52 2019 (r350188) @@ -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: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Sat Jul 20 21:39:32 2019 (r350187) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Sun Jul 21 00:44:52 2019 (r350188) @@ -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 21 00:47: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 1DC08A477F; Sun, 21 Jul 2019 00:47:07 +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 F2FB495049; Sun, 21 Jul 2019 00:47:06 +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 C90481AE0E; Sun, 21 Jul 2019 00:47:06 +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 x6L0l6uj046836; Sun, 21 Jul 2019 00:47:06 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6L0l6bV046835; Sun, 21 Jul 2019 00:47:06 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907210047.x6L0l6bV046835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 21 Jul 2019 00:47:06 +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: r350189 - 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: 350189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F2FB495049 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.959,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: Sun, 21 Jul 2019 00:47:07 -0000 Author: cy Date: Sun Jul 21 00:47:06 2019 New Revision: 350189 URL: https://svnweb.freebsd.org/changeset/base/350189 Log: MFC r349980: 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. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_state.c Sun Jul 21 00:44:52 2019 (r350188) +++ stable/11/sys/contrib/ipfilter/netinet/ip_state.c Sun Jul 21 00:47:06 2019 (r350189) @@ -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 21 00:47: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 61C7BA4783; Sun, 21 Jul 2019 00:47:07 +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 431079504A; Sun, 21 Jul 2019 00:47:07 +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 19CE41AE0F; Sun, 21 Jul 2019 00:47:07 +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 x6L0l6uL046842; Sun, 21 Jul 2019 00:47:06 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6L0l6FO046841; Sun, 21 Jul 2019 00:47:06 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907210047.x6L0l6FO046841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 21 Jul 2019 00:47: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: r350189 - 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: 350189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 431079504A 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.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: Sun, 21 Jul 2019 00:47:07 -0000 Author: cy Date: Sun Jul 21 00:47:06 2019 New Revision: 350189 URL: https://svnweb.freebsd.org/changeset/base/350189 Log: MFC r349980: 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. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_state.c Sun Jul 21 00:44:52 2019 (r350188) +++ stable/12/sys/contrib/ipfilter/netinet/ip_state.c Sun Jul 21 00:47:06 2019 (r350189) @@ -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 21 03:19: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 17A89A7A77; Sun, 21 Jul 2019 03:19:55 +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 EDEC869D41; Sun, 21 Jul 2019 03:19:54 +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 C920B1CA90; Sun, 21 Jul 2019 03:19:54 +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 x6L3Jsxa035763; Sun, 21 Jul 2019 03:19:54 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6L3Js75035762; Sun, 21 Jul 2019 03:19:54 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907210319.x6L3Js75035762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 21 Jul 2019 03:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350190 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 350190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EDEC869D41 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.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: Sun, 21 Jul 2019 03:19:55 -0000 Author: jhibbits Date: Sun Jul 21 03:19:54 2019 New Revision: 350190 URL: https://svnweb.freebsd.org/changeset/base/350190 Log: powerpc: Remove an unnecessary #ifdef guard from slb.c slb.c is only compiled for powerpc64, so no need for the #ifdef in this block. Modified: head/sys/powerpc/aim/slb.c Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Sun Jul 21 00:47:06 2019 (r350189) +++ head/sys/powerpc/aim/slb.c Sun Jul 21 03:19:54 2019 (r350190) @@ -545,7 +545,6 @@ slb_free_user_cache(struct slb **slb) uma_zfree(slb_cache_zone, slb); } -#if defined(__powerpc64__) /* Handle kernel SLB faults -- runs in real mode, all seat belts off */ void handle_kernel_slb_spill(int type, register_t dar, register_t srr0) @@ -626,4 +625,3 @@ handle_user_slb_spill(pmap_t pm, vm_offset_t addr) return (0); } -#endif From owner-svn-src-all@freebsd.org Sun Jul 21 03:26: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 2149AA7DE0; Sun, 21 Jul 2019 03:26:27 +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 032476A23C; Sun, 21 Jul 2019 03:26:27 +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 D20CC1CC7A; Sun, 21 Jul 2019 03:26:26 +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 x6L3QQgL041475; Sun, 21 Jul 2019 03:26:26 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6L3QQ4H041474; Sun, 21 Jul 2019 03:26:26 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201907210326.x6L3QQ4H041474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 21 Jul 2019 03:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350191 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 350191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 032476A23C 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.981,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, 21 Jul 2019 03:26:27 -0000 Author: alc Date: Sun Jul 21 03:26:26 2019 New Revision: 350191 URL: https://svnweb.freebsd.org/changeset/base/350191 Log: Introduce pmap_store(), and use it to replace pmap_load_store() in places where the page table entry was previously invalid. (Note that I did not replace pmap_load_store() when it was followed by a TLB invalidation, even if we are not using the return value from pmap_load_store().) Correct an error in pmap_enter(). A test for determining when to set PGA_WRITEABLE was always true, even if the mapping was read only. In pmap_enter_l2(), when replacing an empty kernel page table page by a superpage mapping, clear the old l2 entry and issue a TLB invalidation. My reading of the ARM architecture manual leads me to believe that the TLB could hold an intermediate entry referencing the empty kernel page table page even though it contains no valid mappings. Replace a couple direct uses of atomic_clear_64() by the new pmap_clear_bits(). In a couple comments, replace the term "paging-structure caches", which is an Intel-specific term for the caches that hold intermediate entries in the page table, with wording that is more consistent with the ARM architecture manual. Reviewed by: markj X-MFC after: r350004 Differential Revision: https://reviews.freebsd.org/D20998 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sun Jul 21 03:19:54 2019 (r350190) +++ head/sys/arm64/arm64/pmap.c Sun Jul 21 03:26:26 2019 (r350191) @@ -328,6 +328,7 @@ static __inline vm_page_t pmap_remove_pt_page(pmap_t p #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) +#define pmap_store(table, entry) atomic_store_64(table, entry) /********************/ /* Inline functions */ @@ -637,7 +638,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi (vm_offset_t)l2); freemempos += PAGE_SIZE; - pmap_load_store(&pagetable_dmap[l1_slot], + pmap_store(&pagetable_dmap[l1_slot], (l2_pa & ~Ln_TABLE_MASK) | L1_TABLE); memset(l2, 0, PAGE_SIZE); @@ -655,7 +656,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi l2_slot = pmap_l2_index(va); KASSERT(l2_slot != 0, ("...")); - pmap_load_store(&l2[l2_slot], + pmap_store(&l2[l2_slot], (pa & ~L2_OFFSET) | ATTR_DEFAULT | ATTR_XN | ATTR_IDX(CACHED_MEMORY) | L2_BLOCK); } @@ -667,7 +668,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi (physmap[i + 1] - pa) >= L1_SIZE; pa += L1_SIZE, va += L1_SIZE) { l1_slot = ((va - DMAP_MIN_ADDRESS) >> L1_SHIFT); - pmap_load_store(&pagetable_dmap[l1_slot], + pmap_store(&pagetable_dmap[l1_slot], (pa & ~L1_OFFSET) | ATTR_DEFAULT | ATTR_XN | ATTR_IDX(CACHED_MEMORY) | L1_BLOCK); } @@ -682,7 +683,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi (vm_offset_t)l2); freemempos += PAGE_SIZE; - pmap_load_store(&pagetable_dmap[l1_slot], + pmap_store(&pagetable_dmap[l1_slot], (l2_pa & ~Ln_TABLE_MASK) | L1_TABLE); memset(l2, 0, PAGE_SIZE); @@ -692,7 +693,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi for (; va < DMAP_MAX_ADDRESS && pa < physmap[i + 1]; pa += L2_SIZE, va += L2_SIZE) { l2_slot = pmap_l2_index(va); - pmap_load_store(&l2[l2_slot], + pmap_store(&l2[l2_slot], (pa & ~L2_OFFSET) | ATTR_DEFAULT | ATTR_XN | ATTR_IDX(CACHED_MEMORY) | L2_BLOCK); } @@ -727,7 +728,7 @@ pmap_bootstrap_l2(vm_offset_t l1pt, vm_offset_t va, vm KASSERT(l1_slot < Ln_ENTRIES, ("Invalid L1 index")); pa = pmap_early_vtophys(l1pt, l2pt); - pmap_load_store(&l1[l1_slot], + pmap_store(&l1[l1_slot], (pa & ~Ln_TABLE_MASK) | L1_TABLE); l2pt += PAGE_SIZE; } @@ -757,7 +758,7 @@ pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm KASSERT(l2_slot < Ln_ENTRIES, ("Invalid L2 index")); pa = pmap_early_vtophys(l1pt, l3pt); - pmap_load_store(&l2[l2_slot], + pmap_store(&l2[l2_slot], (pa & ~Ln_TABLE_MASK) | L2_TABLE); l3pt += PAGE_SIZE; } @@ -1540,7 +1541,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str l0index = ptepindex - (NUL2E + NUL1E); l0 = &pmap->pm_l0[l0index]; - pmap_load_store(l0, VM_PAGE_TO_PHYS(m) | L0_TABLE); + pmap_store(l0, VM_PAGE_TO_PHYS(m) | L0_TABLE); } else if (ptepindex >= NUL2E) { vm_pindex_t l0index, l1index; pd_entry_t *l0, *l1; @@ -1566,7 +1567,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str l1 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l0) & ~ATTR_MASK); l1 = &l1[ptepindex & Ln_ADDR_MASK]; - pmap_load_store(l1, VM_PAGE_TO_PHYS(m) | L1_TABLE); + pmap_store(l1, VM_PAGE_TO_PHYS(m) | L1_TABLE); } else { vm_pindex_t l0index, l1index; pd_entry_t *l0, *l1, *l2; @@ -1608,7 +1609,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str l2 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l1) & ~ATTR_MASK); l2 = &l2[ptepindex & Ln_ADDR_MASK]; - pmap_load_store(l2, VM_PAGE_TO_PHYS(m) | L2_TABLE); + pmap_store(l2, VM_PAGE_TO_PHYS(m) | L2_TABLE); } pmap_resident_count_inc(pmap, 1); @@ -1781,7 +1782,7 @@ pmap_growkernel(vm_offset_t addr) if ((nkpg->flags & PG_ZERO) == 0) pmap_zero_page(nkpg); paddr = VM_PAGE_TO_PHYS(nkpg); - pmap_load_store(l1, paddr | L1_TABLE); + pmap_store(l1, paddr | L1_TABLE); continue; /* try again */ } l2 = pmap_l1_to_l2(l1, kernel_vm_end); @@ -3018,7 +3019,7 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_ent pmap_invalidate_range_nopin(pmap, va, va + size); /* Create the new mapping */ - pmap_load_store(pte, newpte); + pmap_store(pte, newpte); dsb(ishst); critical_exit(); @@ -3304,12 +3305,9 @@ havel3: /* * No, might be a protection or wiring change. */ - if ((orig_l3 & ATTR_SW_MANAGED) != 0) { - if ((new_l3 & ATTR_AP(ATTR_AP_RW)) == - ATTR_AP(ATTR_AP_RW)) { - vm_page_aflag_set(m, PGA_WRITEABLE); - } - } + if ((orig_l3 & ATTR_SW_MANAGED) != 0 && + (new_l3 & ATTR_SW_DBM) != 0) + vm_page_aflag_set(m, PGA_WRITEABLE); goto validate; } @@ -3415,7 +3413,7 @@ validate: } } else { /* New mapping */ - pmap_load_store(l3, new_l3); + pmap_store(l3, new_l3); dsb(ishst); } @@ -3517,12 +3515,16 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t vm_page_free_pages_toq(&free, true); if (va >= VM_MAXUSER_ADDRESS) { /* - * Both pmap_remove_l2() and pmap_remove_l3() will - * leave the kernel page table page zero filled. + * Both pmap_remove_l2() and pmap_remove_l3_range() + * will leave the kernel page table page zero filled. + * Nonetheless, the TLB could have an intermediate + * entry for the kernel page table page. */ mt = PHYS_TO_VM_PAGE(pmap_load(l2) & ~ATTR_MASK); if (pmap_insert_pt_page(pmap, mt, false)) panic("pmap_enter_l2: trie insert failed"); + pmap_clear(l2); + pmap_invalidate_page(pmap, va); } else KASSERT(pmap_load(l2) == 0, ("pmap_enter_l2: non-zero L2 entry %p", l2)); @@ -3536,10 +3538,13 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t SLIST_INIT(&free); if (pmap_unwire_l3(pmap, va, l2pg, &free)) { /* - * Although "va" is not mapped, paging-structure - * caches could nonetheless have entries that + * Although "va" is not mapped, the TLB could + * nonetheless have intermediate entries that * refer to the freed page table pages. * Invalidate those entries. + * + * XXX redundant invalidation (See + * _pmap_unwire_l3().) */ pmap_invalidate_page(pmap, va); vm_page_free_pages_toq(&free, true); @@ -3564,7 +3569,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t /* * Map the superpage. */ - (void)pmap_load_store(l2, new_l2); + pmap_store(l2, new_l2); dsb(ishst); atomic_add_long(&pmap_l2_mappings, 1); @@ -3767,7 +3772,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v m->md.pv_memattr == VM_MEMATTR_WRITE_BACK) cpu_icache_sync_range(PHYS_TO_DMAP(pa), PAGE_SIZE); - pmap_load_store(l3, l3_val); + pmap_store(l3, l3_val); dsb(ishst); return (mpte); @@ -3840,7 +3845,7 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t * demote the mapping and fall through. */ if (sva + L2_SIZE == va_next && eva >= va_next) { - atomic_clear_64(l2, ATTR_SW_WIRED); + pmap_clear_bits(l2, ATTR_SW_WIRED); pmap->pm_stats.wired_count -= L2_SIZE / PAGE_SIZE; continue; @@ -3865,7 +3870,7 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t * the pmap lock synchronizes access to ATTR_SW_WIRED, * the System MMU may write to the entry concurrently. */ - atomic_clear_64(l3, ATTR_SW_WIRED); + pmap_clear_bits(l3, ATTR_SW_WIRED); pmap->pm_stats.wired_count--; } } @@ -3944,8 +3949,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ nbits = 0; if ((srcptepaddr & ATTR_SW_DBM) != 0) nbits |= ATTR_AP_RW_BIT; - (void)pmap_load_store(l2, - (srcptepaddr & ~mask) | nbits); + pmap_store(l2, (srcptepaddr & ~mask) | nbits); pmap_resident_count_inc(dst_pmap, L2_SIZE / PAGE_SIZE); atomic_add_long(&pmap_l2_mappings, 1); @@ -3994,8 +3998,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ nbits = 0; if ((ptetemp & ATTR_SW_DBM) != 0) nbits |= ATTR_AP_RW_BIT; - (void)pmap_load_store(dst_pte, - (ptetemp & ~mask) | nbits); + pmap_store(dst_pte, (ptetemp & ~mask) | nbits); pmap_resident_count_inc(dst_pmap, 1); } else { SLIST_INIT(&free); @@ -4003,8 +4006,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ &free)) { /* * Although "addr" is not mapped, - * paging-structure caches could - * nonetheless have entries that refer + * the TLB could nonetheless have + * intermediate entries that refer * to the freed page table pages. * Invalidate those entries. * From owner-svn-src-all@freebsd.org Sun Jul 21 08: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 9EF85ADA9B; Sun, 21 Jul 2019 08:28:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 7AB92711BE; Sun, 21 Jul 2019 08:28:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50B8720480; Sun, 21 Jul 2019 08:28:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6L8STN0017663; Sun, 21 Jul 2019 08:28:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6L8ST5U017662; Sun, 21 Jul 2019 08:28:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907210828.x6L8ST5U017662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 21 Jul 2019 08:28: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: r350192 - stable/12/sys/x86/iommu X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/x86/iommu X-SVN-Commit-Revision: 350192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7AB92711BE 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,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, 21 Jul 2019 08:28:29 -0000 Author: kib Date: Sun Jul 21 08:28:28 2019 New Revision: 350192 URL: https://svnweb.freebsd.org/changeset/base/350192 Log: MFC r349988: In dmar_find(), refuse to search for DMAR unit for non-PCI device. PR: 239143 Modified: stable/12/sys/x86/iommu/intel_drv.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/iommu/intel_drv.c ============================================================================== --- stable/12/sys/x86/iommu/intel_drv.c Sun Jul 21 03:26:26 2019 (r350191) +++ stable/12/sys/x86/iommu/intel_drv.c Sun Jul 21 08:28:28 2019 (r350192) @@ -769,6 +769,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 21 10:52: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 0F677B0434; Sun, 21 Jul 2019 10:52:14 +0000 (UTC) (envelope-from dim@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 E397374901; Sun, 21 Jul 2019 10:52:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id A40952874; Sun, 21 Jul 2019 10:52:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::104b:b8b8:f8:c359] (unknown [IPv6:2001:470:7a58:0:104b:b8b8:f8:c359]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C48103F464; Sun, 21 Jul 2019 12:52:11 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_7E1D2CF0-5A3A-4F02-9BAF-3E13608C51FA"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r350184 - in head: libexec/rc/rc.d release/picobsd/tinyware/login share/man/man5 usr.bin/login Date: Sun, 21 Jul 2019 12:52:11 +0200 In-Reply-To: <201907202056.x6KKuWsF011171@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Conrad Meyer References: <201907202056.x6KKuWsF011171@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: E397374901 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.966,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, 21 Jul 2019 10:52:14 -0000 --Apple-Mail=_7E1D2CF0-5A3A-4F02-9BAF-3E13608C51FA Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 20 Jul 2019, at 22:56, Conrad Meyer wrote: > > 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 And the "why?" is probably: "to avoid writing in /etc"? -Dimitry --Apple-Mail=_7E1D2CF0-5A3A-4F02-9BAF-3E13608C51FA Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXTRD2wAKCRCwXqMKLiCW o7otAKDVlomyZfABREjfzd2gb44Vw/P13wCg/O+JGO+w3TL8RkzkgRFt3juPLZA= =ObSF -----END PGP SIGNATURE----- --Apple-Mail=_7E1D2CF0-5A3A-4F02-9BAF-3E13608C51FA-- From owner-svn-src-all@freebsd.org Sun Jul 21 10:58: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 87CE8B07B2; Sun, 21 Jul 2019 10:58:26 +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 746AB74C4C; Sun, 21 Jul 2019 10:58:26 +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 4D904220AA; Sun, 21 Jul 2019 10:58:26 +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 x6LAwQXt005648; Sun, 21 Jul 2019 10:58:26 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6LAwPUs005642; Sun, 21 Jul 2019 10:58:25 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907211058.x6LAwPUs005642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 21 Jul 2019 10:58: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: r350193 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 350193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 746AB74C4C 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: Sun, 21 Jul 2019 10:58:26 -0000 Author: vmaffione Date: Sun Jul 21 10:58:25 2019 New Revision: 350193 URL: https://svnweb.freebsd.org/changeset/base/350193 Log: MFC r349803 bhyve: abstraction for network backends Bhyve can currently emulate two virtual NICs, namely virtio-net and e1000, and connect to the host network through two backends, namely tap and netmap. However, there is no interface between virtual NIC functionalities and backend functionalities. As a result, the backend code is duplicated between the two virtual NIC implementations and also within the same virtual NIC. Also, e1000 cannot currently use netmap as a backend. This patch introduces a network backend API between virtio-net/e1000 and tap/netmap, to improve code reuse and add missing functionalities. Virtual NICs and backends can negotiate virtio-net features, such as checksum offload and TSO. If the backend supports the features, it will propagate this information to the guest, so that the latter can make use of them. Currently, only netmap VALE ports support the features, but support should be added to tap in the future. Reviewed by: jhb, bryanv Differential Revision: https://reviews.freebsd.org/D20659 Added: stable/12/usr.sbin/bhyve/net_backends.c - copied unchanged from r349803, head/usr.sbin/bhyve/net_backends.c stable/12/usr.sbin/bhyve/net_backends.h - copied unchanged from r349803, head/usr.sbin/bhyve/net_backends.h Modified: stable/12/usr.sbin/bhyve/Makefile stable/12/usr.sbin/bhyve/pci_e82545.c stable/12/usr.sbin/bhyve/pci_virtio_net.c Modified: stable/12/usr.sbin/bhyve/Makefile ============================================================================== --- stable/12/usr.sbin/bhyve/Makefile Sun Jul 21 08:28:28 2019 (r350192) +++ stable/12/usr.sbin/bhyve/Makefile Sun Jul 21 10:58:25 2019 (r350193) @@ -3,7 +3,7 @@ # .include -CFLAGS+=-I${SRCTOP}/sys +CFLAGS+=-I${SRCTOP}/sys -DWITHOUT_CAPSICUM .PATH: ${SRCTOP}/sys/cam/ctl PROG= bhyve @@ -32,6 +32,7 @@ SRCS= \ mem.c \ mevent.c \ mptbl.c \ + net_backends.c \ net_utils.c \ pci_ahci.c \ pci_e82545.c \ Copied: stable/12/usr.sbin/bhyve/net_backends.c (from r349803, head/usr.sbin/bhyve/net_backends.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/bhyve/net_backends.c Sun Jul 21 10:58:25 2019 (r350193, copy of r349803, head/usr.sbin/bhyve/net_backends.c) @@ -0,0 +1,806 @@ +/*- + * Copyright (c) 2019 Vincenzo Maffione + * + * 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$ + */ + +/* + * This file implements multiple network backends (tap, netmap, ...), + * to be used by network frontends such as virtio-net and e1000. + * The API to access the backend (e.g. send/receive packets, negotiate + * features) is exported by net_backends.h. + */ + +#include /* u_short etc */ +#ifndef WITHOUT_CAPSICUM +#include +#endif +#include +#include +#include +#include + +#include +#include +#include +#define NETMAP_WITH_LIBS +#include + +#ifndef WITHOUT_CAPSICUM +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "iov.h" +#include "mevent.h" +#include "net_backends.h" + +#include + +/* + * Each network backend registers a set of function pointers that are + * used to implement the net backends API. + * This might need to be exposed if we implement backends in separate files. + */ +struct net_backend { + const char *prefix; /* prefix matching this backend */ + + /* + * Routines used to initialize and cleanup the resources needed + * by a backend. The cleanup function is used internally, + * and should not be called by the frontend. + */ + int (*init)(struct net_backend *be, const char *devname, + net_be_rxeof_t cb, void *param); + void (*cleanup)(struct net_backend *be); + + /* + * Called to serve a guest transmit request. The scatter-gather + * vector provided by the caller has 'iovcnt' elements and contains + * the packet to send. + */ + ssize_t (*send)(struct net_backend *be, struct iovec *iov, int iovcnt); + + /* + * Called to receive a packet from the backend. When the function + * returns a positive value 'len', the scatter-gather vector + * provided by the caller contains a packet with such length. + * The function returns 0 if the backend doesn't have a new packet to + * receive. + */ + ssize_t (*recv)(struct net_backend *be, struct iovec *iov, int iovcnt); + + /* + * Ask the backend for the virtio-net features it is able to + * support. Possible features are TSO, UFO and checksum offloading + * in both rx and tx direction and for both IPv4 and IPv6. + */ + uint64_t (*get_cap)(struct net_backend *be); + + /* + * Tell the backend to enable/disable the specified virtio-net + * features (capabilities). + */ + int (*set_cap)(struct net_backend *be, uint64_t features, + unsigned int vnet_hdr_len); + + struct pci_vtnet_softc *sc; + int fd; + + /* + * Length of the virtio-net header used by the backend and the + * frontend, respectively. A zero value means that the header + * is not used. + */ + unsigned int be_vnet_hdr_len; + unsigned int fe_vnet_hdr_len; + + /* Size of backend-specific private data. */ + size_t priv_size; + + /* Room for backend-specific data. */ + char opaque[0]; +}; + +SET_DECLARE(net_backend_set, struct net_backend); + +#define VNET_HDR_LEN sizeof(struct virtio_net_rxhdr) + +#define WPRINTF(params) printf params + +/* + * The tap backend + */ + +struct tap_priv { + struct mevent *mevp; +}; + +static void +tap_cleanup(struct net_backend *be) +{ + struct tap_priv *priv = (struct tap_priv *)be->opaque; + + if (priv->mevp) { + mevent_delete(priv->mevp); + } + if (be->fd != -1) { + close(be->fd); + be->fd = -1; + } +} + +static int +tap_init(struct net_backend *be, const char *devname, + net_be_rxeof_t cb, void *param) +{ + struct tap_priv *priv = (struct tap_priv *)be->opaque; + char tbuf[80]; + int fd; + int opt = 1; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif + + if (cb == NULL) { + WPRINTF(("TAP backend requires non-NULL callback\n")); + return (-1); + } + + strcpy(tbuf, "/dev/"); + strlcat(tbuf, devname, sizeof(tbuf)); + + fd = open(tbuf, O_RDWR); + if (fd == -1) { + WPRINTF(("open of tap device %s failed\n", tbuf)); + goto error; + } + + /* + * Set non-blocking and register for read + * notifications with the event loop + */ + if (ioctl(fd, FIONBIO, &opt) < 0) { + WPRINTF(("tap device O_NONBLOCK failed\n")); + goto error; + } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (caph_rights_limit(fd, &rights) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + + priv->mevp = mevent_add(fd, EVF_READ, cb, param); + if (priv->mevp == NULL) { + WPRINTF(("Could not register event\n")); + goto error; + } + + be->fd = fd; + + return (0); + +error: + tap_cleanup(be); + return (-1); +} + +/* + * Called to send a buffer chain out to the tap device + */ +static ssize_t +tap_send(struct net_backend *be, struct iovec *iov, int iovcnt) +{ + return (writev(be->fd, iov, iovcnt)); +} + +static ssize_t +tap_recv(struct net_backend *be, struct iovec *iov, int iovcnt) +{ + ssize_t ret; + + /* Should never be called without a valid tap fd */ + assert(be->fd != -1); + + ret = readv(be->fd, iov, iovcnt); + + if (ret < 0 && errno == EWOULDBLOCK) { + return (0); + } + + return (ret); +} + +static uint64_t +tap_get_cap(struct net_backend *be) +{ + + return (0); /* no capabilities for now */ +} + +static int +tap_set_cap(struct net_backend *be, uint64_t features, + unsigned vnet_hdr_len) +{ + + return ((features || vnet_hdr_len) ? -1 : 0); +} + +static struct net_backend tap_backend = { + .prefix = "tap", + .priv_size = sizeof(struct tap_priv), + .init = tap_init, + .cleanup = tap_cleanup, + .send = tap_send, + .recv = tap_recv, + .get_cap = tap_get_cap, + .set_cap = tap_set_cap, +}; + +/* A clone of the tap backend, with a different prefix. */ +static struct net_backend vmnet_backend = { + .prefix = "vmnet", + .priv_size = sizeof(struct tap_priv), + .init = tap_init, + .cleanup = tap_cleanup, + .send = tap_send, + .recv = tap_recv, + .get_cap = tap_get_cap, + .set_cap = tap_set_cap, +}; + +DATA_SET(net_backend_set, tap_backend); +DATA_SET(net_backend_set, vmnet_backend); + +/* + * The netmap backend + */ + +/* The virtio-net features supported by netmap. */ +#define NETMAP_FEATURES (VIRTIO_NET_F_CSUM | VIRTIO_NET_F_HOST_TSO4 | \ + VIRTIO_NET_F_HOST_TSO6 | VIRTIO_NET_F_HOST_UFO | \ + VIRTIO_NET_F_GUEST_CSUM | VIRTIO_NET_F_GUEST_TSO4 | \ + VIRTIO_NET_F_GUEST_TSO6 | VIRTIO_NET_F_GUEST_UFO) + +struct netmap_priv { + char ifname[IFNAMSIZ]; + struct nm_desc *nmd; + uint16_t memid; + struct netmap_ring *rx; + struct netmap_ring *tx; + struct mevent *mevp; + net_be_rxeof_t cb; + void *cb_param; +}; + +static void +nmreq_init(struct nmreq *req, char *ifname) +{ + + memset(req, 0, sizeof(*req)); + strlcpy(req->nr_name, ifname, sizeof(req->nr_name)); + req->nr_version = NETMAP_API; +} + +static int +netmap_set_vnet_hdr_len(struct net_backend *be, int vnet_hdr_len) +{ + int err; + struct nmreq req; + struct netmap_priv *priv = (struct netmap_priv *)be->opaque; + + nmreq_init(&req, priv->ifname); + req.nr_cmd = NETMAP_BDG_VNET_HDR; + req.nr_arg1 = vnet_hdr_len; + err = ioctl(be->fd, NIOCREGIF, &req); + if (err) { + WPRINTF(("Unable to set vnet header length %d\n", + vnet_hdr_len)); + return (err); + } + + be->be_vnet_hdr_len = vnet_hdr_len; + + return (0); +} + +static int +netmap_has_vnet_hdr_len(struct net_backend *be, unsigned vnet_hdr_len) +{ + int prev_hdr_len = be->be_vnet_hdr_len; + int ret; + + if (vnet_hdr_len == prev_hdr_len) { + return (1); + } + + ret = netmap_set_vnet_hdr_len(be, vnet_hdr_len); + if (ret) { + return (0); + } + + netmap_set_vnet_hdr_len(be, prev_hdr_len); + + return (1); +} + +static uint64_t +netmap_get_cap(struct net_backend *be) +{ + + return (netmap_has_vnet_hdr_len(be, VNET_HDR_LEN) ? + NETMAP_FEATURES : 0); +} + +static int +netmap_set_cap(struct net_backend *be, uint64_t features, + unsigned vnet_hdr_len) +{ + + return (netmap_set_vnet_hdr_len(be, vnet_hdr_len)); +} + +static int +netmap_init(struct net_backend *be, const char *devname, + net_be_rxeof_t cb, void *param) +{ + struct netmap_priv *priv = (struct netmap_priv *)be->opaque; + + strlcpy(priv->ifname, devname, sizeof(priv->ifname)); + priv->ifname[sizeof(priv->ifname) - 1] = '\0'; + + priv->nmd = nm_open(priv->ifname, NULL, NETMAP_NO_TX_POLL, NULL); + if (priv->nmd == NULL) { + WPRINTF(("Unable to nm_open(): interface '%s', errno (%s)\n", + devname, strerror(errno))); + free(priv); + return (-1); + } + + priv->memid = priv->nmd->req.nr_arg2; + priv->tx = NETMAP_TXRING(priv->nmd->nifp, 0); + priv->rx = NETMAP_RXRING(priv->nmd->nifp, 0); + priv->cb = cb; + priv->cb_param = param; + be->fd = priv->nmd->fd; + + priv->mevp = mevent_add(be->fd, EVF_READ, cb, param); + if (priv->mevp == NULL) { + WPRINTF(("Could not register event\n")); + return (-1); + } + + return (0); +} + +static void +netmap_cleanup(struct net_backend *be) +{ + struct netmap_priv *priv = (struct netmap_priv *)be->opaque; + + if (priv->mevp) { + mevent_delete(priv->mevp); + } + if (priv->nmd) { + nm_close(priv->nmd); + } + be->fd = -1; +} + +static ssize_t +netmap_send(struct net_backend *be, struct iovec *iov, + int iovcnt) +{ + struct netmap_priv *priv = (struct netmap_priv *)be->opaque; + struct netmap_ring *ring; + ssize_t totlen = 0; + int nm_buf_size; + int nm_buf_len; + uint32_t head; + void *nm_buf; + int j; + + ring = priv->tx; + head = ring->head; + if (head == ring->tail) { + WPRINTF(("No space, drop %zu bytes\n", count_iov(iov, iovcnt))); + goto txsync; + } + nm_buf = NETMAP_BUF(ring, ring->slot[head].buf_idx); + nm_buf_size = ring->nr_buf_size; + nm_buf_len = 0; + + for (j = 0; j < iovcnt; j++) { + int iov_frag_size = iov[j].iov_len; + void *iov_frag_buf = iov[j].iov_base; + + totlen += iov_frag_size; + + /* + * Split each iovec fragment over more netmap slots, if + * necessary. + */ + for (;;) { + int copylen; + + copylen = iov_frag_size < nm_buf_size ? iov_frag_size : nm_buf_size; + memcpy(nm_buf, iov_frag_buf, copylen); + + iov_frag_buf += copylen; + iov_frag_size -= copylen; + nm_buf += copylen; + nm_buf_size -= copylen; + nm_buf_len += copylen; + + if (iov_frag_size == 0) { + break; + } + + ring->slot[head].len = nm_buf_len; + ring->slot[head].flags = NS_MOREFRAG; + head = nm_ring_next(ring, head); + if (head == ring->tail) { + /* + * We ran out of netmap slots while + * splitting the iovec fragments. + */ + WPRINTF(("No space, drop %zu bytes\n", + count_iov(iov, iovcnt))); + goto txsync; + } + nm_buf = NETMAP_BUF(ring, ring->slot[head].buf_idx); + nm_buf_size = ring->nr_buf_size; + nm_buf_len = 0; + } + } + + /* Complete the last slot, which must not have NS_MOREFRAG set. */ + ring->slot[head].len = nm_buf_len; + ring->slot[head].flags = 0; + head = nm_ring_next(ring, head); + + /* Now update ring->head and ring->cur. */ + ring->head = ring->cur = head; +txsync: + ioctl(be->fd, NIOCTXSYNC, NULL); + + return (totlen); +} + +static ssize_t +netmap_recv(struct net_backend *be, struct iovec *iov, int iovcnt) +{ + struct netmap_priv *priv = (struct netmap_priv *)be->opaque; + struct netmap_slot *slot = NULL; + struct netmap_ring *ring; + void *iov_frag_buf; + int iov_frag_size; + ssize_t totlen = 0; + uint32_t head; + + assert(iovcnt); + + ring = priv->rx; + head = ring->head; + iov_frag_buf = iov->iov_base; + iov_frag_size = iov->iov_len; + + do { + int nm_buf_len; + void *nm_buf; + + if (head == ring->tail) { + return (0); + } + + slot = ring->slot + head; + nm_buf = NETMAP_BUF(ring, slot->buf_idx); + nm_buf_len = slot->len; + + for (;;) { + int copylen = nm_buf_len < iov_frag_size ? + nm_buf_len : iov_frag_size; + + memcpy(iov_frag_buf, nm_buf, copylen); + nm_buf += copylen; + nm_buf_len -= copylen; + iov_frag_buf += copylen; + iov_frag_size -= copylen; + totlen += copylen; + + if (nm_buf_len == 0) { + break; + } + + iov++; + iovcnt--; + if (iovcnt == 0) { + /* No space to receive. */ + WPRINTF(("Short iov, drop %zd bytes\n", + totlen)); + return (-ENOSPC); + } + iov_frag_buf = iov->iov_base; + iov_frag_size = iov->iov_len; + } + + head = nm_ring_next(ring, head); + + } while (slot->flags & NS_MOREFRAG); + + /* Release slots to netmap. */ + ring->head = ring->cur = head; + + return (totlen); +} + +static struct net_backend netmap_backend = { + .prefix = "netmap", + .priv_size = sizeof(struct netmap_priv), + .init = netmap_init, + .cleanup = netmap_cleanup, + .send = netmap_send, + .recv = netmap_recv, + .get_cap = netmap_get_cap, + .set_cap = netmap_set_cap, +}; + +/* A clone of the netmap backend, with a different prefix. */ +static struct net_backend vale_backend = { + .prefix = "vale", + .priv_size = sizeof(struct netmap_priv), + .init = netmap_init, + .cleanup = netmap_cleanup, + .send = netmap_send, + .recv = netmap_recv, + .get_cap = netmap_get_cap, + .set_cap = netmap_set_cap, +}; + +DATA_SET(net_backend_set, netmap_backend); +DATA_SET(net_backend_set, vale_backend); + +/* + * Initialize a backend and attach to the frontend. + * This is called during frontend initialization. + * @pbe is a pointer to the backend to be initialized + * @devname is the backend-name as supplied on the command line, + * e.g. -s 2:0,frontend-name,backend-name[,other-args] + * @cb is the receive callback supplied by the frontend, + * and it is invoked in the event loop when a receive + * event is generated in the hypervisor, + * @param is a pointer to the frontend, and normally used as + * the argument for the callback. + */ +int +netbe_init(struct net_backend **ret, const char *devname, net_be_rxeof_t cb, + void *param) +{ + struct net_backend **pbe, *nbe, *tbe = NULL; + int err; + + /* + * Find the network backend that matches the user-provided + * device name. net_backend_set is built using a linker set. + */ + SET_FOREACH(pbe, net_backend_set) { + if (strncmp(devname, (*pbe)->prefix, + strlen((*pbe)->prefix)) == 0) { + tbe = *pbe; + assert(tbe->init != NULL); + assert(tbe->cleanup != NULL); + assert(tbe->send != NULL); + assert(tbe->recv != NULL); + assert(tbe->get_cap != NULL); + assert(tbe->set_cap != NULL); + break; + } + } + + *ret = NULL; + if (tbe == NULL) + return (EINVAL); + nbe = calloc(1, sizeof(*nbe) + tbe->priv_size); + *nbe = *tbe; /* copy the template */ + nbe->fd = -1; + nbe->sc = param; + nbe->be_vnet_hdr_len = 0; + nbe->fe_vnet_hdr_len = 0; + + /* Initialize the backend. */ + err = nbe->init(nbe, devname, cb, param); + if (err) { + free(nbe); + return (err); + } + + *ret = nbe; + + return (0); +} + +void +netbe_cleanup(struct net_backend *be) +{ + + if (be != NULL) { + be->cleanup(be); + free(be); + } +} + +uint64_t +netbe_get_cap(struct net_backend *be) +{ + + assert(be != NULL); + return (be->get_cap(be)); +} + +int +netbe_set_cap(struct net_backend *be, uint64_t features, + unsigned vnet_hdr_len) +{ + int ret; + + assert(be != NULL); + + /* There are only three valid lengths, i.e., 0, 10 and 12. */ + if (vnet_hdr_len && vnet_hdr_len != VNET_HDR_LEN + && vnet_hdr_len != (VNET_HDR_LEN - sizeof(uint16_t))) + return (-1); + + be->fe_vnet_hdr_len = vnet_hdr_len; + + ret = be->set_cap(be, features, vnet_hdr_len); + assert(be->be_vnet_hdr_len == 0 || + be->be_vnet_hdr_len == be->fe_vnet_hdr_len); + + return (ret); +} + +static __inline struct iovec * +iov_trim(struct iovec *iov, int *iovcnt, unsigned int tlen) +{ + struct iovec *riov; + + /* XXX short-cut: assume first segment is >= tlen */ + assert(iov[0].iov_len >= tlen); + + iov[0].iov_len -= tlen; + if (iov[0].iov_len == 0) { + assert(*iovcnt > 1); + *iovcnt -= 1; + riov = &iov[1]; + } else { + iov[0].iov_base = (void *)((uintptr_t)iov[0].iov_base + tlen); + riov = &iov[0]; + } + + return (riov); +} + +ssize_t +netbe_send(struct net_backend *be, struct iovec *iov, int iovcnt) +{ + + assert(be != NULL); + if (be->be_vnet_hdr_len != be->fe_vnet_hdr_len) { + /* + * The frontend uses a virtio-net header, but the backend + * does not. We ignore it (as it must be all zeroes) and + * strip it. + */ + assert(be->be_vnet_hdr_len == 0); + iov = iov_trim(iov, &iovcnt, be->fe_vnet_hdr_len); + } + + return (be->send(be, iov, iovcnt)); +} + +/* + * Try to read a packet from the backend, without blocking. + * If no packets are available, return 0. In case of success, return + * the length of the packet just read. Return -1 in case of errors. + */ +ssize_t +netbe_recv(struct net_backend *be, struct iovec *iov, int iovcnt) +{ + /* Length of prepended virtio-net header. */ + unsigned int hlen = be->fe_vnet_hdr_len; + int ret; + + assert(be != NULL); + + if (hlen && hlen != be->be_vnet_hdr_len) { + /* + * The frontend uses a virtio-net header, but the backend + * does not. We need to prepend a zeroed header. + */ + struct virtio_net_rxhdr *vh; + + assert(be->be_vnet_hdr_len == 0); + + /* + * Get a pointer to the rx header, and use the + * data immediately following it for the packet buffer. + */ + vh = iov[0].iov_base; + iov = iov_trim(iov, &iovcnt, hlen); + + /* + * The only valid field in the rx packet header is the + * number of buffers if merged rx bufs were negotiated. + */ + memset(vh, 0, hlen); + if (hlen == VNET_HDR_LEN) { + vh->vrh_bufs = 1; + } + } + + ret = be->recv(be, iov, iovcnt); + if (ret > 0) { + ret += hlen; + } + + return (ret); +} + +/* + * Read a packet from the backend and discard it. + * Returns the size of the discarded packet or zero if no packet was available. + * A negative error code is returned in case of read error. + */ +ssize_t +netbe_rx_discard(struct net_backend *be) +{ + /* + * MP note: the dummybuf is only used to discard frames, + * so there is no need for it to be per-vtnet or locked. + * We only make it large enough for TSO-sized segment. + */ + static uint8_t dummybuf[65536 + 64]; + struct iovec iov; + + iov.iov_base = dummybuf; + iov.iov_len = sizeof(dummybuf); + + return netbe_recv(be, &iov, 1); +} + Copied: stable/12/usr.sbin/bhyve/net_backends.h (from r349803, head/usr.sbin/bhyve/net_backends.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/bhyve/net_backends.h Sun Jul 21 10:58:25 2019 (r350193, copy of r349803, head/usr.sbin/bhyve/net_backends.h) @@ -0,0 +1,87 @@ +/*- + * Copyright (c) 2019 Vincenzo Maffione + * + * 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 __NET_BACKENDS_H__ +#define __NET_BACKENDS_H__ + +#include + +/* Opaque type representing a network backend. */ +typedef struct net_backend net_backend_t; + +/* Interface between network frontends and the network backends. */ +typedef void (*net_be_rxeof_t)(int, enum ev_type, void *param); +int netbe_init(net_backend_t **be, const char *devname, net_be_rxeof_t cb, + void *param); +void netbe_cleanup(net_backend_t *be); +uint64_t netbe_get_cap(net_backend_t *be); +int netbe_set_cap(net_backend_t *be, uint64_t cap, + unsigned vnet_hdr_len); +ssize_t netbe_send(net_backend_t *be, struct iovec *iov, int iovcnt); +ssize_t netbe_recv(net_backend_t *be, struct iovec *iov, int iovcnt); +ssize_t netbe_rx_discard(net_backend_t *be); + + +/* + * Network device capabilities taken from the VirtIO standard. + * Despite the name, these capabilities can be used by different frontents + * (virtio-net, ptnet) and supported by different backends (netmap, tap, ...). + */ +#define VIRTIO_NET_F_CSUM (1 << 0) /* host handles partial cksum */ +#define VIRTIO_NET_F_GUEST_CSUM (1 << 1) /* guest handles partial cksum */ +#define VIRTIO_NET_F_MAC (1 << 5) /* host supplies MAC */ +#define VIRTIO_NET_F_GSO_DEPREC (1 << 6) /* deprecated: host handles GSO */ +#define VIRTIO_NET_F_GUEST_TSO4 (1 << 7) /* guest can rcv TSOv4 */ +#define VIRTIO_NET_F_GUEST_TSO6 (1 << 8) /* guest can rcv TSOv6 */ +#define VIRTIO_NET_F_GUEST_ECN (1 << 9) /* guest can rcv TSO with ECN */ +#define VIRTIO_NET_F_GUEST_UFO (1 << 10) /* guest can rcv UFO */ +#define VIRTIO_NET_F_HOST_TSO4 (1 << 11) /* host can rcv TSOv4 */ +#define VIRTIO_NET_F_HOST_TSO6 (1 << 12) /* host can rcv TSOv6 */ +#define VIRTIO_NET_F_HOST_ECN (1 << 13) /* host can rcv TSO with ECN */ +#define VIRTIO_NET_F_HOST_UFO (1 << 14) /* host can rcv UFO */ +#define VIRTIO_NET_F_MRG_RXBUF (1 << 15) /* host can merge RX buffers */ +#define VIRTIO_NET_F_STATUS (1 << 16) /* config status field available */ +#define VIRTIO_NET_F_CTRL_VQ (1 << 17) /* control channel available */ +#define VIRTIO_NET_F_CTRL_RX (1 << 18) /* control channel RX mode support */ +#define VIRTIO_NET_F_CTRL_VLAN (1 << 19) /* control channel VLAN filtering */ +#define VIRTIO_NET_F_GUEST_ANNOUNCE \ + (1 << 21) /* guest can send gratuitous pkts */ + +/* + * Fixed network header size + */ +struct virtio_net_rxhdr { + uint8_t vrh_flags; + uint8_t vrh_gso_type; + uint16_t vrh_hdr_len; + uint16_t vrh_gso_size; + uint16_t vrh_csum_start; + uint16_t vrh_csum_offset; + uint16_t vrh_bufs; +} __packed; + +#endif /* __NET_BACKENDS_H__ */ Modified: stable/12/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_e82545.c Sun Jul 21 08:28:28 2019 (r350192) +++ stable/12/usr.sbin/bhyve/pci_e82545.c Sun Jul 21 10:58:25 2019 (r350193) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include "pci_emul.h" #include "mevent.h" #include "net_utils.h" +#include "net_backends.h" /* Hardware/register definitions XXX: move some to common code. */ #define E82545_VENDOR_ID_INTEL 0x8086 @@ -245,11 +246,10 @@ struct eth_uni { struct e82545_softc { struct pci_devinst *esc_pi; struct vmctx *esc_ctx; - struct mevent *esc_mevp; struct mevent *esc_mevpitr; pthread_mutex_t esc_mtx; struct ether_addr esc_mac; - int esc_tapfd; + net_backend_t *esc_be; /* General */ uint32_t esc_CTRL; /* x0000 device ctl */ @@ -355,7 +355,7 @@ struct e82545_softc { static void e82545_reset(struct e82545_softc *sc, int dev); static void e82545_rx_enable(struct e82545_softc *sc); static void e82545_rx_disable(struct e82545_softc *sc); -static void e82545_tap_callback(int fd, enum ev_type type, void *param); +static void e82545_rx_callback(int fd, enum ev_type type, void *param); static void e82545_tx_start(struct e82545_softc *sc); static void e82545_tx_enable(struct e82545_softc *sc); static void e82545_tx_disable(struct e82545_softc *sc); @@ -824,11 +824,9 @@ e82545_bufsz(uint32_t rctl) return (256); /* Forbidden value. */ } -static uint8_t dummybuf[2048]; - /* XXX one packet at a time until this is debugged */ static void -e82545_tap_callback(int fd, enum ev_type type, void *param) +e82545_rx_callback(int fd, enum ev_type type, void *param) { struct e82545_softc *sc = param; struct e1000_rx_desc *rxd; @@ -843,7 +841,7 @@ e82545_tap_callback(int fd, enum ev_type type, void *p if (!sc->esc_rx_enabled || sc->esc_rx_loopback) { DPRINTF("rx disabled (!%d || %d) -- packet(s) dropped\r\n", sc->esc_rx_enabled, sc->esc_rx_loopback); - while (read(sc->esc_tapfd, dummybuf, sizeof(dummybuf)) > 0) { + while (netbe_rx_discard(sc->esc_be) > 0) { } goto done1; } @@ -856,7 +854,7 @@ e82545_tap_callback(int fd, enum ev_type type, void *p if (left < maxpktdesc) { DPRINTF("rx overflow (%d < %d) -- packet(s) dropped\r\n", left, maxpktdesc); - while (read(sc->esc_tapfd, dummybuf, sizeof(dummybuf)) > 0) { + while (netbe_rx_discard(sc->esc_be) > 0) { } goto done1; } @@ -873,9 +871,9 @@ e82545_tap_callback(int fd, enum ev_type type, void *p rxd->buffer_addr, bufsz); vec[i].iov_len = bufsz; } - len = readv(sc->esc_tapfd, vec, maxpktdesc); + len = netbe_recv(sc->esc_be, vec, maxpktdesc); if (len <= 0) { - DPRINTF("tap: readv() returned %d\n", len); + DPRINTF("netbe_recv() returned %d\n", len); goto done; } @@ -1050,10 +1048,10 @@ static void e82545_transmit_backend(struct e82545_softc *sc, struct iovec *iov, int iovcnt) { - if (sc->esc_tapfd == -1) + if (sc->esc_be == NULL) return; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jul 21 11:07: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 5F1A6B0B6B; Sun, 21 Jul 2019 11:07:40 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 4246C75209; Sun, 21 Jul 2019 11:07:40 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BDED2229F; Sun, 21 Jul 2019 11:07:40 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6LB7d5Z011479; Sun, 21 Jul 2019 11:07:39 GMT (envelope-from rene@FreeBSD.org) Received: (from rene@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6LB7dNp011478; Sun, 21 Jul 2019 11:07:39 GMT (envelope-from rene@FreeBSD.org) Message-Id: <201907211107.x6LB7dNp011478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rene set sender to rene@FreeBSD.org using -f From: Rene Ladan Date: Sun, 21 Jul 2019 11:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350194 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: rene X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 350194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4246C75209 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_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: Sun, 21 Jul 2019 11:07:40 -0000 Author: rene (doc,ports committer) Date: Sun Jul 21 11:07:39 2019 New Revision: 350194 URL: https://svnweb.freebsd.org/changeset/base/350194 Log: Mark Felder has stepped down from portmgr and ports-secteam Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Sun Jul 21 10:58:25 2019 (r350193) +++ head/share/misc/organization.dot Sun Jul 21 11:07:39 2019 (r350194) @@ -30,11 +30,11 @@ coresecretary [label="Core Team Secretary\ncore-secret doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nbcr, gabor, gjb, hrs,\nblackend, ryusuke, wblock"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] -portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nadamw, antoine, bapt, bdrewery\nfeld, mat, rene, swills"] +portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nadamw, antoine, bapt, bdrewery\nmat, rene, swills"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\ngjb, kib,\nbdrewery, blackend,\nrgrimes, delphij,\nhrs, glebius,\nmarius"] secteam [label="Security Team\nsecteam@FreeBSD.org\nbenno, delphij,\ndes, emaste,\ngjb, gordon,\nremko"] -portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, amdmi3, eadler, feld, jgh, rea, riggs, sbz, simon, swills, zi"] +portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, amdmi3, eadler, jgh, rea, riggs, sbz, simon, swills, zi"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\nbenno, delphij,\ndes, emaste,\ngjb, gordon,\nremko"] srccommitters [label="Src Committers\nsrc-committers@FreeBSD.org"] From owner-svn-src-all@freebsd.org Sun Jul 21 11:26: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 625B1B1196; Sun, 21 Jul 2019 11:26: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 43B2B75AE6; Sun, 21 Jul 2019 11:26: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 1E84322652; Sun, 21 Jul 2019 11:26:51 +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 x6LBQo9j023721; Sun, 21 Jul 2019 11:26:50 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6LBQoW6023718; Sun, 21 Jul 2019 11:26:50 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907211126.x6LBQoW6023718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 21 Jul 2019 11:26:50 +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: r350195 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 350195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 43B2B75AE6 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.950,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, 21 Jul 2019 11:26:51 -0000 Author: vmaffione Date: Sun Jul 21 11:26:49 2019 New Revision: 350195 URL: https://svnweb.freebsd.org/changeset/base/350195 Log: MFC r349867 bhyve: add missing license identifiers in net_utils and net_backend Reviewed by: jhb, markj, imp Differential Revision: https://reviews.freebsd.org/D20874 Modified: stable/12/usr.sbin/bhyve/net_backends.c stable/12/usr.sbin/bhyve/net_backends.h stable/12/usr.sbin/bhyve/net_utils.c stable/12/usr.sbin/bhyve/net_utils.h Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/net_backends.c ============================================================================== --- stable/12/usr.sbin/bhyve/net_backends.c Sun Jul 21 11:07:39 2019 (r350194) +++ stable/12/usr.sbin/bhyve/net_backends.c Sun Jul 21 11:26:49 2019 (r350195) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2019 Vincenzo Maffione * * Redistribution and use in source and binary forms, with or without Modified: stable/12/usr.sbin/bhyve/net_backends.h ============================================================================== --- stable/12/usr.sbin/bhyve/net_backends.h Sun Jul 21 11:07:39 2019 (r350194) +++ stable/12/usr.sbin/bhyve/net_backends.h Sun Jul 21 11:26:49 2019 (r350195) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2019 Vincenzo Maffione * * Redistribution and use in source and binary forms, with or without Modified: stable/12/usr.sbin/bhyve/net_utils.c ============================================================================== --- stable/12/usr.sbin/bhyve/net_utils.c Sun Jul 21 11:07:39 2019 (r350194) +++ stable/12/usr.sbin/bhyve/net_utils.c Sun Jul 21 11:26:49 2019 (r350195) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011 NetApp, Inc. * * Redistribution and use in source and binary forms, with or without Modified: stable/12/usr.sbin/bhyve/net_utils.h ============================================================================== --- stable/12/usr.sbin/bhyve/net_utils.h Sun Jul 21 11:07:39 2019 (r350194) +++ stable/12/usr.sbin/bhyve/net_utils.h Sun Jul 21 11:26:49 2019 (r350195) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2019 Vincenzo Maffione * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@freebsd.org Sun Jul 21 11:28: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 BDBBCB1273; Sun, 21 Jul 2019 11:28:41 +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 6123F75CE0; Sun, 21 Jul 2019 11:28:41 +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 38D5922657; Sun, 21 Jul 2019 11:28:41 +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 x6LBSfx7023851; Sun, 21 Jul 2019 11:28:41 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6LBSetV023849; Sun, 21 Jul 2019 11:28:40 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907211128.x6LBSetV023849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 21 Jul 2019 11:28: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: r350196 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 350196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6123F75CE0 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.950,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, 21 Jul 2019 11:28:41 -0000 Author: vmaffione Date: Sun Jul 21 11:28:40 2019 New Revision: 350196 URL: https://svnweb.freebsd.org/changeset/base/350196 Log: MFC r349868 bhyve: net_backends.c: add missing __FBSDID Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D20883 Modified: stable/12/usr.sbin/bhyve/Makefile stable/12/usr.sbin/bhyve/net_backends.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/Makefile ============================================================================== --- stable/12/usr.sbin/bhyve/Makefile Sun Jul 21 11:26:49 2019 (r350195) +++ stable/12/usr.sbin/bhyve/Makefile Sun Jul 21 11:28:40 2019 (r350196) @@ -3,7 +3,7 @@ # .include -CFLAGS+=-I${SRCTOP}/sys -DWITHOUT_CAPSICUM +CFLAGS+=-I${SRCTOP}/sys .PATH: ${SRCTOP}/sys/cam/ctl PROG= bhyve Modified: stable/12/usr.sbin/bhyve/net_backends.c ============================================================================== --- stable/12/usr.sbin/bhyve/net_backends.c Sun Jul 21 11:26:49 2019 (r350195) +++ stable/12/usr.sbin/bhyve/net_backends.c Sun Jul 21 11:28:40 2019 (r350196) @@ -34,11 +34,13 @@ * features) is exported by net_backends.h. */ +#include +__FBSDID("$FreeBSD$"); + #include /* u_short etc */ #ifndef WITHOUT_CAPSICUM #include #endif -#include #include #include #include From owner-svn-src-all@freebsd.org Sun Jul 21 11:34: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 AD231B152E; Sun, 21 Jul 2019 11:34:15 +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 8F02D76194; Sun, 21 Jul 2019 11:34:15 +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 613FB22841; Sun, 21 Jul 2019 11:34:15 +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 x6LBYFRu029345; Sun, 21 Jul 2019 11:34:15 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6LBYF9h029344; Sun, 21 Jul 2019 11:34:15 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907211134.x6LBYF9h029344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 21 Jul 2019 11:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350197 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 350197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F02D76194 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.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: Sun, 21 Jul 2019 11:34:15 -0000 Author: vmaffione Date: Sun Jul 21 11:34:14 2019 New Revision: 350197 URL: https://svnweb.freebsd.org/changeset/base/350197 Log: MFC r349935 usr.sbin/bhyve: free resources when erroring out of pci_vtnet_init() Submitted by: seanc Coverity CID: 1402978 Approved by: vmaffione Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D20912 Modified: stable/12/usr.sbin/bhyve/pci_virtio_net.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_virtio_net.c Sun Jul 21 11:28:40 2019 (r350196) +++ stable/12/usr.sbin/bhyve/pci_virtio_net.c Sun Jul 21 11:34:14 2019 (r350197) @@ -411,6 +411,7 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * err = net_parsemac(vtopts, sc->vsc_config.mac); if (err != 0) { free(devname); + free(sc); return (err); } mac_provided = 1; @@ -419,8 +420,10 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * err = netbe_init(&sc->vsc_be, devname, pci_vtnet_rx_callback, sc); free(devname); - if (err) + if (err) { + free(sc); return (err); + } sc->vsc_consts.vc_hv_caps |= netbe_get_cap(sc->vsc_be); } @@ -442,8 +445,10 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * sc->vsc_vs.vs_mtx = &sc->vsc_mtx; /* use BAR 1 to map MSI-X table and PBA, if we're using MSI-X */ - if (vi_intr_init(&sc->vsc_vs, 1, fbsdrun_virtio_msix())) + if (vi_intr_init(&sc->vsc_vs, 1, fbsdrun_virtio_msix())) { + free(sc); return (1); + } /* use BAR 0 to map config regs in IO space */ vi_set_io_bar(&sc->vsc_vs, 0); From owner-svn-src-all@freebsd.org Sun Jul 21 11: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 70036B1648; Sun, 21 Jul 2019 11:40:01 +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 406D576362; Sun, 21 Jul 2019 11:40:01 +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 D29C62284B; Sun, 21 Jul 2019 11:40:00 +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 x6LBe063029730; Sun, 21 Jul 2019 11:40:00 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6LBe0ZM029729; Sun, 21 Jul 2019 11:40:00 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907211140.x6LBe0ZM029729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 21 Jul 2019 11:40: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: r350198 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 350198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 406D576362 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.974,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, 21 Jul 2019 11:40:01 -0000 Author: vmaffione Date: Sun Jul 21 11:40:00 2019 New Revision: 350198 URL: https://svnweb.freebsd.org/changeset/base/350198 Log: MFC r349952 usr.sbin/bhyve: close backend file descriptor during tap init error Submitted by: seanc Coverity CID: 1402953 Reviewed by: scottl, markj, aleksandr.fedorov -at- itglobal.com Approved by: vmaffione, jhb Differential Revision: https://reviews.freebsd.org/D20913 Modified: stable/12/usr.sbin/bhyve/net_backends.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/net_backends.c ============================================================================== --- stable/12/usr.sbin/bhyve/net_backends.c Sun Jul 21 11:34:14 2019 (r350197) +++ stable/12/usr.sbin/bhyve/net_backends.c Sun Jul 21 11:40:00 2019 (r350198) @@ -175,7 +175,6 @@ tap_init(struct net_backend *be, const char *devname, { struct tap_priv *priv = (struct tap_priv *)be->opaque; char tbuf[80]; - int fd; int opt = 1; #ifndef WITHOUT_CAPSICUM cap_rights_t rights; @@ -189,8 +188,8 @@ tap_init(struct net_backend *be, const char *devname, strcpy(tbuf, "/dev/"); strlcat(tbuf, devname, sizeof(tbuf)); - fd = open(tbuf, O_RDWR); - if (fd == -1) { + be->fd = open(tbuf, O_RDWR); + if (be->fd == -1) { WPRINTF(("open of tap device %s failed\n", tbuf)); goto error; } @@ -199,24 +198,22 @@ tap_init(struct net_backend *be, const char *devname, * Set non-blocking and register for read * notifications with the event loop */ - if (ioctl(fd, FIONBIO, &opt) < 0) { + if (ioctl(be->fd, FIONBIO, &opt) < 0) { WPRINTF(("tap device O_NONBLOCK failed\n")); goto error; } #ifndef WITHOUT_CAPSICUM cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); - if (caph_rights_limit(fd, &rights) == -1) + if (caph_rights_limit(be->fd, &rights) == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif - priv->mevp = mevent_add(fd, EVF_READ, cb, param); + priv->mevp = mevent_add(be->fd, EVF_READ, cb, param); if (priv->mevp == NULL) { WPRINTF(("Could not register event\n")); goto error; } - - be->fd = fd; return (0); From owner-svn-src-all@freebsd.org Sun Jul 21 15:07: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 20CF0B5920; Sun, 21 Jul 2019 15:07:14 +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 F155883A5E; Sun, 21 Jul 2019 15:07:13 +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 C8A3424FAE; Sun, 21 Jul 2019 15:07:13 +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 x6LF7Dll053556; Sun, 21 Jul 2019 15:07:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6LF7C7G053552; Sun, 21 Jul 2019 15:07:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907211507.x6LF7C7G053552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 21 Jul 2019 15:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350199 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 350199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F155883A5E 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.984,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, 21 Jul 2019 15:07:14 -0000 Author: kib Date: Sun Jul 21 15:07:12 2019 New Revision: 350199 URL: https://svnweb.freebsd.org/changeset/base/350199 Log: Check and avoid overflow when incrementing fp->f_count in fget_unlocked() and fhold(). On sufficiently large machine, f_count can be legitimately very large, e.g. malicious code can dup same fd up to the per-process filedescriptors limit, and then fork as much as it can. On some smaller machine, I see kern.maxfilesperproc: 939132 kern.maxprocperuid: 34203 which already overflows u_int. More, the malicious code can create transient references by sending fds over unix sockets. I realized that this check is missed after reading https://secfault-security.com/blog/FreeBSD-SA-1902.fd.html Reviewed by: markj (previous version), mjg Tested by: pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20947 Modified: head/sys/kern/kern_descrip.c head/sys/kern/sys_generic.c head/sys/kern/uipc_usrreq.c head/sys/sys/file.h head/sys/sys/refcount.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Jul 21 11:40:00 2019 (r350198) +++ head/sys/kern/kern_descrip.c Sun Jul 21 15:07:12 2019 (r350199) @@ -853,6 +853,10 @@ kern_dup(struct thread *td, u_int mode, int flags, int goto unlock; } + oldfde = &fdp->fd_ofiles[old]; + if (!fhold(oldfde->fde_file)) + goto unlock; + /* * If the caller specified a file descriptor, make sure the file * table is large enough to hold it, and grab it. Otherwise, just @@ -861,13 +865,17 @@ kern_dup(struct thread *td, u_int mode, int flags, int switch (mode) { case FDDUP_NORMAL: case FDDUP_FCNTL: - if ((error = fdalloc(td, new, &new)) != 0) + if ((error = fdalloc(td, new, &new)) != 0) { + fdrop(oldfde->fde_file, td); goto unlock; + } break; case FDDUP_MUSTREPLACE: /* Target file descriptor must exist. */ - if (fget_locked(fdp, new) == NULL) + if (fget_locked(fdp, new) == NULL) { + fdrop(oldfde->fde_file, td); goto unlock; + } break; case FDDUP_FIXED: if (new >= fdp->fd_nfiles) { @@ -884,6 +892,7 @@ kern_dup(struct thread *td, u_int mode, int flags, int error = racct_set_unlocked(p, RACCT_NOFILE, new + 1); if (error != 0) { error = EMFILE; + fdrop(oldfde->fde_file, td); goto unlock; } } @@ -899,8 +908,6 @@ kern_dup(struct thread *td, u_int mode, int flags, int KASSERT(old != new, ("new fd is same as old")); - oldfde = &fdp->fd_ofiles[old]; - fhold(oldfde->fde_file); newfde = &fdp->fd_ofiles[new]; delfp = newfde->fde_file; @@ -1901,12 +1908,14 @@ finstall(struct thread *td, struct file *fp, int *fd, MPASS(fd != NULL); + if (!fhold(fp)) + return (EBADF); FILEDESC_XLOCK(fdp); if ((error = fdalloc(td, 0, fd))) { FILEDESC_XUNLOCK(fdp); + fdrop(fp, td); return (error); } - fhold(fp); _finstall(fdp, fp, *fd, flags, fcaps); FILEDESC_XUNLOCK(fdp); return (0); @@ -2047,7 +2056,8 @@ fdcopy(struct filedesc *fdp) for (i = 0; i <= fdp->fd_lastfile; ++i) { ofde = &fdp->fd_ofiles[i]; if (ofde->fde_file == NULL || - (ofde->fde_file->f_ops->fo_flags & DFLAG_PASSABLE) == 0) { + (ofde->fde_file->f_ops->fo_flags & DFLAG_PASSABLE) == 0 || + !fhold(ofde->fde_file)) { if (newfdp->fd_freefile == -1) newfdp->fd_freefile = i; continue; @@ -2055,7 +2065,6 @@ fdcopy(struct filedesc *fdp) nfde = &newfdp->fd_ofiles[i]; *nfde = *ofde; filecaps_copy(&ofde->fde_caps, &nfde->fde_caps, true); - fhold(nfde->fde_file); fdused_init(newfdp, i); newfdp->fd_lastfile = i; } @@ -2108,10 +2117,13 @@ fdcopy_remapped(struct filedesc *fdp, const int *fds, error = EINVAL; goto bad; } + if (!fhold(nfde->fde_file)) { + error = EBADF; + goto bad; + } nfde = &newfdp->fd_ofiles[i]; *nfde = *ofde; filecaps_copy(&ofde->fde_caps, &nfde->fde_caps, true); - fhold(nfde->fde_file); fdused_init(newfdp, i); newfdp->fd_lastfile = i; } @@ -2153,9 +2165,9 @@ fdclearlocks(struct thread *td) (p->p_leader->p_flag & P_ADVLOCK) != 0) { for (i = 0; i <= fdp->fd_lastfile; i++) { fp = fdp->fd_ofiles[i].fde_file; - if (fp == NULL || fp->f_type != DTYPE_VNODE) + if (fp == NULL || fp->f_type != DTYPE_VNODE || + !fhold(fp)) continue; - fhold(fp); FILEDESC_XUNLOCK(fdp); lf.l_whence = SEEK_SET; lf.l_start = 0; @@ -2596,8 +2608,8 @@ fget_cap(struct thread *td, int fd, cap_rights_t *need get_locked: FILEDESC_SLOCK(fdp); error = fget_cap_locked(fdp, fd, needrightsp, fpp, havecapsp); - if (error == 0) - fhold(*fpp); + if (error == 0 && !fhold(*fpp)) + error = EBADF; FILEDESC_SUNLOCK(fdp); #endif return (error); @@ -2656,14 +2668,19 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights * table before this fd was closed, so it possible that * there is a stale fp pointer in cached version. */ - fdt = *(const struct fdescenttbl * const volatile *)&(fdp->fd_files); + fdt = *(const struct fdescenttbl * const volatile *) + &(fdp->fd_files); continue; } + if (__predict_false(count + 1 < count)) + return (EBADF); + /* * Use an acquire barrier to force re-reading of fdt so it is * refreshed for verification. */ - if (atomic_fcmpset_acq_int(&fp->f_count, &count, count + 1) == 0) + if (__predict_false(atomic_fcmpset_acq_int(&fp->f_count, + &count, count + 1) == 0)) goto retry; fdt = fdp->fd_files; #ifdef CAPABILITIES @@ -3048,7 +3065,11 @@ dupfdopen(struct thread *td, struct filedesc *fdp, int FILEDESC_XUNLOCK(fdp); return (EACCES); } - fhold(fp); + if (!fhold(fp)) { + fdunused(fdp, indx); + FILEDESC_XUNLOCK(fdp); + return (EBADF); + } newfde = &fdp->fd_ofiles[indx]; oldfde = &fdp->fd_ofiles[dfd]; ioctls = filecaps_copy_prep(&oldfde->fde_caps); Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Sun Jul 21 11:40:00 2019 (r350198) +++ head/sys/kern/sys_generic.c Sun Jul 21 15:07:12 2019 (r350199) @@ -757,7 +757,11 @@ kern_ioctl(struct thread *td, int fd, u_long com, cadd fp = NULL; /* fhold() was not called yet */ goto out; } - fhold(fp); + if (!fhold(fp)) { + error = EBADF; + fp = NULL; + goto out; + } if (locked == LA_SLOCKED) { FILEDESC_SUNLOCK(fdp); locked = LA_UNLOCKED; Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sun Jul 21 11:40:00 2019 (r350198) +++ head/sys/kern/uipc_usrreq.c Sun Jul 21 15:07:12 2019 (r350199) @@ -2154,7 +2154,7 @@ unp_internalize(struct mbuf **controlp, struct thread struct timespec *ts; void *data; socklen_t clen, datalen; - int i, error, *fdp, oldfds; + int i, j, error, *fdp, oldfds; u_int newlen; UNP_LINK_UNLOCK_ASSERT(); @@ -2237,6 +2237,19 @@ unp_internalize(struct mbuf **controlp, struct thread goto out; } fdp = data; + for (i = 0; i < oldfds; i++, fdp++) { + if (!fhold(fdesc->fd_ofiles[*fdp].fde_file)) { + fdp = data; + for (j = 0; j < i; j++, fdp++) { + fdrop(fdesc->fd_ofiles[*fdp]. + fde_file, td); + } + FILEDESC_SUNLOCK(fdesc); + error = EBADF; + goto out; + } + } + fdp = data; fdep = (struct filedescent **) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); fdev = malloc(sizeof(*fdev) * oldfds, M_FILECAPS, @@ -2440,7 +2453,6 @@ unp_internalize_fp(struct file *fp) unp->unp_file = fp; unp->unp_msgcount++; } - fhold(fp); unp_rights++; UNP_LINK_WUNLOCK(); } @@ -2601,10 +2613,10 @@ unp_gc(__unused void *arg, int pending) if ((unp->unp_gcflag & UNPGC_DEAD) != 0) { f = unp->unp_file; if (unp->unp_msgcount == 0 || f == NULL || - f->f_count != unp->unp_msgcount) + f->f_count != unp->unp_msgcount || + !fhold(f)) continue; unref[total++] = f; - fhold(f); KASSERT(total <= unp_unreachable, ("unp_gc: incorrect unreachable count.")); } Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Sun Jul 21 11:40:00 2019 (r350198) +++ head/sys/sys/file.h Sun Jul 21 15:07:12 2019 (r350199) @@ -284,8 +284,12 @@ _fnoop(void) return (0); } -#define fhold(fp) \ - (refcount_acquire(&(fp)->f_count)) +static __inline __result_use_check bool +fhold(struct file *fp) +{ + return (refcount_acquire_checked(&fp->f_count)); +} + #define fdrop(fp, td) \ (refcount_release(&(fp)->f_count) ? _fdrop((fp), (td)) : _fnoop()) Modified: head/sys/sys/refcount.h ============================================================================== --- head/sys/sys/refcount.h Sun Jul 21 11:40:00 2019 (r350198) +++ head/sys/sys/refcount.h Sun Jul 21 15:07:12 2019 (r350199) @@ -54,6 +54,20 @@ refcount_acquire(volatile u_int *count) atomic_add_int(count, 1); } +static __inline __result_use_check bool +refcount_acquire_checked(volatile u_int *count) +{ + u_int lcount; + + for (lcount = *count;;) { + if (__predict_false(lcount + 1 < lcount)) + return (false); + if (__predict_true(atomic_fcmpset_int(count, &lcount, + lcount + 1) == 1)) + return (true); + } +} + static __inline int refcount_release(volatile u_int *count) { From owner-svn-src-all@freebsd.org Sun Jul 21 16:24: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 DFBAEB78FB; Sun, 21 Jul 2019 16:24: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 C1E978617C; Sun, 21 Jul 2019 16:24: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 B244925EF4; Sun, 21 Jul 2019 16:24:40 +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 x6LGOess000225; Sun, 21 Jul 2019 16:24:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6LGOeSj000224; Sun, 21 Jul 2019 16:24:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907211624.x6LGOeSj000224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 21 Jul 2019 16:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350200 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 350200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C1E978617C 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.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: Sun, 21 Jul 2019 16:24:40 -0000 Author: kib Date: Sun Jul 21 16:24:40 2019 New Revision: 350200 URL: https://svnweb.freebsd.org/changeset/base/350200 Log: Fix userspace build after r350199. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/sys/refcount.h Modified: head/sys/sys/refcount.h ============================================================================== --- head/sys/sys/refcount.h Sun Jul 21 15:07:12 2019 (r350199) +++ head/sys/sys/refcount.h Sun Jul 21 16:24:40 2019 (r350200) @@ -36,6 +36,7 @@ #ifdef _KERNEL #include #else +#include #define KASSERT(exp, msg) /* */ #endif From owner-svn-src-all@freebsd.org Sun Jul 21 16:35: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 05188B7CF2; Sun, 21 Jul 2019 16:35: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 DBCF0867C1; Sun, 21 Jul 2019 16:35:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2A3C2610E; Sun, 21 Jul 2019 16:35: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 x6LGZnTX006326; Sun, 21 Jul 2019 16:35:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6LGZn8P006325; Sun, 21 Jul 2019 16:35:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907211635.x6LGZn8P006325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 21 Jul 2019 16:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350201 - head/lib/libcasper/services/cap_fileargs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libcasper/services/cap_fileargs X-SVN-Commit-Revision: 350201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DBCF0867C1 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_LONG(-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] 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, 21 Jul 2019 16:35:50 -0000 Author: markj Date: Sun Jul 21 16:35:49 2019 New Revision: 350201 URL: https://svnweb.freebsd.org/changeset/base/350201 Log: Link fileargs_lstat.3. Sponsored by: The FreeBSD Foundation Modified: head/lib/libcasper/services/cap_fileargs/Makefile Modified: head/lib/libcasper/services/cap_fileargs/Makefile ============================================================================== --- head/lib/libcasper/services/cap_fileargs/Makefile Sun Jul 21 16:24:40 2019 (r350200) +++ head/lib/libcasper/services/cap_fileargs/Makefile Sun Jul 21 16:35:49 2019 (r350201) @@ -30,6 +30,7 @@ MLINKS+=cap_fileargs.3 fileargs_fopen.3 MLINKS+=cap_fileargs.3 fileargs_free.3 MLINKS+=cap_fileargs.3 fileargs_init.3 MLINKS+=cap_fileargs.3 fileargs_initnv.3 +MLINKS+=cap_fileargs.3 fileargs_lstat.3 MLINKS+=cap_fileargs.3 fileargs_open.3 .include From owner-svn-src-all@freebsd.org Sun Jul 21 16: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 359FCB7DB1; Sun, 21 Jul 2019 16:39:26 +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 614E886937; Sun, 21 Jul 2019 16:39:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f53.google.com with SMTP id q22so68749230iog.4; Sun, 21 Jul 2019 09:39:24 -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=JWpC9SGXYUeZ6BhWNRDVDBOWBV7McCftT/cuawQzqQE=; b=BkLMMtKMM2E8Ujg0EfwiXmshz9TtYiAgLu396G2nzTxrrC1yLcONH0+ghP1Ph/l7hL vN7H/hH8fPYeCmIx+z4rQKSED704UIZ6o2I5xl6B6SYPPFq14gkggdkU73kswKNM+Hqi cQFQojVNMq4IuRnSNw9pLMMcZl8HIcYECkXWembJAR495wj7Okk8026VjEun1qcRbnH+ IvWVRPfMad4gAdBFkNwj4JBky76bo7BzYuCJLrducV56B/453bGkLoEU+Lff7nb08Fb3 oVt54zt5tv0aC2KUf2n0cgm6MUfKAe9dZ42ymDMTTeCBIpvoEnRn8nucCL8LueTjTTYf LUjg== X-Gm-Message-State: APjAAAUxLh/GKkzUZ9JXGRU5wtj+Fn3AQTkY+8Yp9RqO/qhwZk5Ndwr9 1EaeG0RGD4wUtbTI/onh+9xy97oi X-Google-Smtp-Source: APXvYqwA9gCWKnGv2FbSgTjNOUAoABUFTRKGnc8jK/naQUsLRc7bmsZ1rCuTaRYitJtW1e3VOwq+cw== X-Received: by 2002:a02:a595:: with SMTP id b21mr14258799jam.28.1563726665653; Sun, 21 Jul 2019 09:31:05 -0700 (PDT) Received: from mail-io1-f49.google.com (mail-io1-f49.google.com. [209.85.166.49]) by smtp.gmail.com with ESMTPSA id t4sm29050866iop.0.2019.07.21.09.31.05 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jul 2019 09:31:05 -0700 (PDT) Received: by mail-io1-f49.google.com with SMTP id q22so68723169iog.4; Sun, 21 Jul 2019 09:31:05 -0700 (PDT) X-Received: by 2002:a02:6016:: with SMTP id i22mr43480844jac.56.1563726665114; Sun, 21 Jul 2019 09:31:05 -0700 (PDT) MIME-Version: 1.0 References: <201907202056.x6KKuWsF011171@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 21 Jul 2019 09:30:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r350184 - in head: libexec/rc/rc.d release/picobsd/tinyware/login share/man/man5 usr.bin/login To: Dimitry Andric Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 614E886937 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.70 / 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.86)[-0.855,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]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,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)[53.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.83)[ip: (-3.24), ipnet: 209.85.128.0/17(-3.44), asn: 15169(-2.43), country: US(-0.05)]; 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, 21 Jul 2019 16:39:26 -0000 On Sun, Jul 21, 2019 at 3:52 AM Dimitry Andric wrote: > On 20 Jul 2019, at 22:56, Conrad Meyer wrote: > > 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 > > And the "why?" is probably: "to avoid writing in /etc"? Yep. I could have done a better job of summarizing the issues brought up in discussion in response to r349256. Templated formatting works for both ends: syncs and other writes are mostly elided, and the possibility of corrupting the source template is removed. Cheers, Conrad From owner-svn-src-all@freebsd.org Sun Jul 21 16:59: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 D3A6BB8222 for ; Sun, 21 Jul 2019 16:59:01 +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 4D5248708E for ; Sun, 21 Jul 2019 16:59:01 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1563728333; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=WvN4zCzVHZsAPL3IbK7AZGzlCNvE494rQKYSaqgGbwo15/4tgXE1OgJE/Wx6SPgyj5du0t/gh8hqh GinRuS0Lr66RTNXmocxHB7/ZeynDSwIh5S0JP5kXNAJ9/aIJkKQ4j+qUDRl9fifNn49q/GvaHwPgzQ vji6Rrc2pNa6snIflmRmBhI9BOckHb8MuijlzOIuEhd4HsbANTBKmaXM1Ay2wqGEYEaIetOiPT54is KhDMwOW6uNd50gWKUE7ZBeJg2hq+lM1ukTlAXa603oui57coPsB2Ospcg1h3EDw4BMFKU3B9swGQJ5 +llhuoMViLCcM3JOkA9JgwxeqoEhKxw== 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:to:from:subject:message-id:dkim-signature:from; bh=mw6yQv8J4XQOm7WZ6ETnqjS5yXJZDWKv/aSqN7OzDgQ=; b=mCnX4inmtU7g58aetAG3W13CGdCWy4RbwnJ58POsANFEs/HusY9ocmGHRPCVUKg13mjrZWXKUG/35 cJSZBarPFz3lee25SK/YuCy7hi6bwNessxB6uAC+HzkhlcLWtWxBL/Y0MgBSBJzxmRqWrlvQSli479 n0d5D/FF5y9mxBizg9Zj2JyHwhtUUZU4dhuVPZuz85ygCciDXD/Iie8662rjvjkpkLIO4VwOVWAKUS thmJXjOFk+8lY3lZ8LOUiPR/ljaqLa4bXlF8Cld4eqWAFxf5Ny/duG9cs8rkVm2xFVjHl98q5H/wAp swMm+U6ZsRa0z4mb+nj4fZ0o5VW1blw== 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:to:from:subject:message-id:from; bh=mw6yQv8J4XQOm7WZ6ETnqjS5yXJZDWKv/aSqN7OzDgQ=; b=FIfrwlzElV3VRePvvqKJZkGVshQgII4KtdfF7o2maX6XI6dJbKOcrDtMU42YPcnFhlgXDfj9zEYl6 dWjSYyMdqfK6vorju5NDd+KKO6H4k9BbfMw34Jy5Pbzu439zByjDjcLUhgJrshoW393d67gEMSPVDR yXceYvSyVxGzSn+ihXe6Q4+TPrs9CuF+4xdxl8m4E/AKZzTaksf5yiBen7S77aLcBr5WUvRBo8bJqY svJD/3Cx29Qm1y+J536rwfvB02nuuIS6Cl9Iss0OpXGOHSbvoNji9Cmydzeop6nItMKrFqnNFzvZos 7l+QD5dIhsY2L8fZHnCeGgQKmq2nu2w== X-MHO-RoutePath: aGlwcGll X-MHO-User: cfc61ec5-abd8-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 cfc61ec5-abd8-11e9-90e8-c17e0c9f2e02; Sun, 21 Jul 2019 16:58:51 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x6LGwnaH057414; Sun, 21 Jul 2019 10:58:49 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r350184 - in head: libexec/rc/rc.d release/picobsd/tinyware/login share/man/man5 usr.bin/login From: Ian Lepore To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 21 Jul 2019 10:58:49 -0600 In-Reply-To: <201907202056.x6KKuWsF011171@repo.freebsd.org> References: <201907202056.x6KKuWsF011171@repo.freebsd.org> 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: 4D5248708E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 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.99)[-0.994,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: Sun, 21 Jul 2019 16:59:01 -0000 On Sat, 2019-07-20 at 20:56 +0000, Conrad Meyer wrote: > 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 (r350 > 183) > +++ head/share/man/man5/motd.5 Sat Jul 20 20:56:31 2019 (r350 > 184) > @@ -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 (r350 > 183) > +++ head/usr.bin/login/Makefile Sat Jul 20 20:56:31 2019 (r350 > 184) > @@ -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 (r350 > 183) > +++ head/usr.bin/login/login.1 Sat Jul 20 20:56:31 2019 (r350 > 184) > @@ -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 (r350 > 183) > +++ head/usr.bin/login/login.conf Sat Jul 20 20:56:31 2019 (r350 > 184) > @@ -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 (r350 > 184) > @@ -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 (r350 > 183) > +++ head/usr.bin/login/pathnames.h Sat Jul 20 20:56:31 2019 (r350 > 184) > @@ -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" > This change doesn't appear to provide any mechanism for maintaining historic behavior of having an immutable /etc/motd file that gets presented to the user. If you set motd_enable=false there will be nothing in /var/run/motd so nothing will be presented to the user at login. Otherwise you end up with the user seeing a modified copy of the motd file. We have products that are mandated by the customer (and I believe by law in some cases) to provide specific exact text at login, and now I think there is no straighforward way to achieve that. -- Ian From owner-svn-src-all@freebsd.org Sun Jul 21 17:00: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 BAC57B82A9; Sun, 21 Jul 2019 17:00:19 +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 9C3CC8723F; Sun, 21 Jul 2019 17:00:19 +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 7554C264D0; Sun, 21 Jul 2019 17:00:19 +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 x6LH0Jcf018264; Sun, 21 Jul 2019 17:00:19 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6LH0J4H018263; Sun, 21 Jul 2019 17:00:19 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201907211700.x6LH0J4H018263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 21 Jul 2019 17:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350202 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 350202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C3CC8723F 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.974,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, 21 Jul 2019 17:00:19 -0000 Author: alc Date: Sun Jul 21 17:00:19 2019 New Revision: 350202 URL: https://svnweb.freebsd.org/changeset/base/350202 Log: With the introduction of software dirty bit emulation for managed mappings, we should test ATTR_SW_DBM, not ATTR_AP_RW, to determine whether to set PGA_WRITEABLE. In effect, we are currently setting PGA_WRITEABLE based on whether the dirty bit is preset, not whether the mapping is writeable. Correct this mistake. Reviewed by: markj X-MFC with: r350004 Differential Revision: https://reviews.freebsd.org/D21013 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sun Jul 21 16:35:49 2019 (r350201) +++ head/sys/arm64/arm64/pmap.c Sun Jul 21 17:00:19 2019 (r350202) @@ -3361,7 +3361,7 @@ havel3: CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, pa); TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; - if ((new_l3 & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) + if ((new_l3 & ATTR_SW_DBM) != 0) vm_page_aflag_set(m, PGA_WRITEABLE); } @@ -3554,7 +3554,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t va, pmap); return (KERN_RESOURCE_SHORTAGE); } - if ((new_l2 & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) + if ((new_l2 & ATTR_SW_DBM) != 0) for (mt = m; mt < &m[L2_SIZE / PAGE_SIZE]; mt++) vm_page_aflag_set(mt, PGA_WRITEABLE); } From owner-svn-src-all@freebsd.org Sun Jul 21 17:14: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 A3CACB89CF; Sun, 21 Jul 2019 17:14:40 +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 84C5D880B5; Sun, 21 Jul 2019 17:14:40 +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 5FC28268B6; Sun, 21 Jul 2019 17:14:40 +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 x6LHEe5P029809; Sun, 21 Jul 2019 17:14:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6LHEesk029808; Sun, 21 Jul 2019 17:14:40 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201907211714.x6LHEesk029808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 21 Jul 2019 17:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350203 - 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: 350203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84C5D880B5 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.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: Sun, 21 Jul 2019 17:14:40 -0000 Author: ian Date: Sun Jul 21 17:14:39 2019 New Revision: 350203 URL: https://svnweb.freebsd.org/changeset/base/350203 Log: Add support for setting the aging/frequency-offset register via sysctl. The 2127 and 2129 chips support a frequency tuning value in the range of -7 through +8 PPM; add a sysctl handler to read and set the value. Modified: head/sys/dev/iicbus/nxprtc.c Modified: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- head/sys/dev/iicbus/nxprtc.c Sun Jul 21 17:00:19 2019 (r350202) +++ head/sys/dev/iicbus/nxprtc.c Sun Jul 21 17:14:39 2019 (r350203) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -109,6 +110,8 @@ __FBSDID("$FreeBSD$"); #define PCF2127_R_TS_CTL 0x12 /* Timestamp control */ #define PCF2127_B_TSOFF 0x40 /* Turn off timestamp function */ +#define PCF2127_R_AGING_OFFSET 0x19 /* Frequency aging offset in PPM */ + /* * PCA/PCF2129-specific registers, bits, and masks. */ @@ -204,6 +207,7 @@ struct nxprtc_softc { u_int flags; /* SC_F_* flags */ u_int chiptype; /* Type of PCF85xx chip */ time_t bat_time; /* Next time to check battery */ + int freqadj; /* Current freq adj in PPM */ uint8_t secaddr; /* Address of seconds register */ uint8_t tmcaddr; /* Address of timer count register */ bool use_timer; /* Use timer for fractional sec */ @@ -356,6 +360,30 @@ write_timeregs(struct nxprtc_softc *sc, struct time_re } static int +freqadj_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct nxprtc_softc *sc; + int err, freqppm, newppm; + + sc = arg1; + + /* PPM range [-7,8] maps to reg value range [0,15] */ + freqppm = newppm = 8 - sc->freqadj; + + err = sysctl_handle_int(oidp, &newppm, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + if (freqppm != newppm) { + if (newppm < -7 || newppm > 8) + return (EINVAL); + sc->freqadj = 8 - newppm; + err = write_reg(sc, PCF2127_R_AGING_OFFSET, sc->freqadj); + } + + return (err); +} + +static int pcf8523_battery_check(struct nxprtc_softc *sc) { struct timespec ts; @@ -409,6 +437,8 @@ pcf8523_battery_check(struct nxprtc_softc *sc) static int pcf8523_start(struct nxprtc_softc *sc) { + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *tree; struct csr { uint8_t cs1; uint8_t cs2; @@ -416,7 +446,7 @@ pcf8523_start(struct nxprtc_softc *sc) uint8_t sec; } csr; int err; - uint8_t clkout; + uint8_t clkout, freqadj; /* Read the control and status registers. */ if ((err = nxprtc_readfrom(sc->dev, PCF85xx_R_CS1, &csr, @@ -492,10 +522,28 @@ pcf8523_start(struct nxprtc_softc *sc) * 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. + * + * Also, for 212x chips, retrieve the current frequency aging offset, + * and set up the sysctl handler for reading/setting it. */ if (sc->is212x) { if (csr.cs1 & PCF2129_B_CS1_12HR) sc->use_ampm = true; + + err = read_reg(sc, PCF2127_R_AGING_OFFSET, &freqadj); + if (err != 0) { + device_printf(sc->dev, + "cannot read AGINGOFFSET register\n"); + return (err); + } + sc->freqadj = (int8_t)freqadj; + + ctx = device_get_sysctl_ctx(sc->dev); + tree = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); + + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "freqadj", + CTLFLAG_RWTUN | CTLTYPE_INT | CTLFLAG_MPSAFE, sc, 0, + freqadj_sysctl, "I", "Frequency adjust in PPM, range [-7,+8]"); } else { if (csr.cs1 & PCF8523_B_CS1_12HR) sc->use_ampm = true; From owner-svn-src-all@freebsd.org Sun Jul 21 20:16:49 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 D175ABC77A; Sun, 21 Jul 2019 20:16:49 +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 B4A3E8E8E5; Sun, 21 Jul 2019 20:16:49 +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 90F21BB1; Sun, 21 Jul 2019 20:16: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 x6LKGnF7036433; Sun, 21 Jul 2019 20:16:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6LKGnjH036431; Sun, 21 Jul 2019 20:16:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907212016.x6LKGnjH036431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 21 Jul 2019 20:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350204 - in head: share/man/man9 sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: share/man/man9 sys/sys X-SVN-Commit-Revision: 350204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4A3E8E8E5 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.960,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, 21 Jul 2019 20:16:49 -0000 Author: kib Date: Sun Jul 21 20:16:48 2019 New Revision: 350204 URL: https://svnweb.freebsd.org/changeset/base/350204 Log: Switch the rest of the refcount(9) functions to bool return type. There are some explicit comparisions of refcount_release(9) result with 0/1, which are fine. Reviewed by: markj, mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21014 Modified: head/share/man/man9/refcount.9 head/sys/sys/refcount.h Modified: head/share/man/man9/refcount.9 ============================================================================== --- head/share/man/man9/refcount.9 Sun Jul 21 17:14:39 2019 (r350203) +++ head/share/man/man9/refcount.9 Sun Jul 21 20:16:48 2019 (r350204) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2009 +.Dd July 21, 2019 .Dt REFCOUNT 9 .Os .Sh NAME @@ -42,7 +42,7 @@ .Fn refcount_init "volatile u_int *count" "u_int value" .Ft void .Fn refcount_acquire "volatile u_int *count" -.Ft int +.Ft bool .Fn refcount_release "volatile u_int *count" .Sh DESCRIPTION The @@ -73,9 +73,9 @@ protection for acquiring a new reference. The .Fn refcount_release function is used to release an existing reference. -The function returns a non-zero value if the reference being released was +The function returns true if the reference being released was the last reference; -otherwise, it returns zero. +otherwise, it returns false. .Pp Note that these routines do not provide any inter-CPU synchronization, data protection, @@ -89,7 +89,7 @@ is released. .Sh RETURN VALUES The .Nm refcount_release -function returns non-zero when releasing the last reference and zero when +function returns true when releasing the last reference and false when releasing any other reference. .Sh HISTORY These functions were introduced in Modified: head/sys/sys/refcount.h ============================================================================== --- head/sys/sys/refcount.h Sun Jul 21 17:14:39 2019 (r350203) +++ head/sys/sys/refcount.h Sun Jul 21 20:16:48 2019 (r350204) @@ -69,7 +69,7 @@ refcount_acquire_checked(volatile u_int *count) } } -static __inline int +static __inline bool refcount_release(volatile u_int *count) { u_int old; @@ -78,7 +78,7 @@ refcount_release(volatile u_int *count) old = atomic_fetchadd_int(count, -1); KASSERT(old > 0, ("refcount %p is zero", count)); if (old > 1) - return (0); + return (false); /* * Last reference. Signal the user to call the destructor. @@ -87,14 +87,14 @@ refcount_release(volatile u_int *count) * at the start of the function synchronized with this fence. */ atomic_thread_fence_acq(); - return (1); + return (true); } /* * This functions returns non-zero if the refcount was * incremented. Else zero is returned. */ -static __inline __result_use_check int +static __inline __result_use_check bool refcount_acquire_if_not_zero(volatile u_int *count) { u_int old; @@ -103,13 +103,13 @@ refcount_acquire_if_not_zero(volatile u_int *count) for (;;) { KASSERT(old < UINT_MAX, ("refcount %p overflowed", count)); if (old == 0) - return (0); + return (false); if (atomic_fcmpset_int(count, &old, old + 1)) - return (1); + return (true); } } -static __inline __result_use_check int +static __inline __result_use_check bool refcount_release_if_not_last(volatile u_int *count) { u_int old; @@ -118,9 +118,9 @@ refcount_release_if_not_last(volatile u_int *count) for (;;) { KASSERT(old > 0, ("refcount %p is zero", count)); if (old == 1) - return (0); + return (false); if (atomic_fcmpset_int(count, &old, old - 1)) - return (1); + return (true); } } From owner-svn-src-all@freebsd.org Mon Jul 22 01:06: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 A682FA3EDE; Mon, 22 Jul 2019 01:06:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 807F471F08; Mon, 22 Jul 2019 01:06:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53A9F4601; Mon, 22 Jul 2019 01:06:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6M167R2012230; Mon, 22 Jul 2019 01:06:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6M167kt012229; Mon, 22 Jul 2019 01:06:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907220106.x6M167kt012229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Jul 2019 01:06: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: r350205 - stable/12/sys/dev/nand X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/dev/nand X-SVN-Commit-Revision: 350205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 807F471F08 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.949,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: Mon, 22 Jul 2019 01:06:07 -0000 Author: emaste Date: Mon Jul 22 01:06:06 2019 New Revision: 350205 URL: https://svnweb.freebsd.org/changeset/base/350205 Log: nand: create device with 0640 permission rw-r----- is the usual/standard permissions for such devices. Direct commit to stable/12 as this code has been removed in HEAD. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/dev/nand/nand_cdev.c Modified: stable/12/sys/dev/nand/nand_cdev.c ============================================================================== --- stable/12/sys/dev/nand/nand_cdev.c Sun Jul 21 20:16:48 2019 (r350204) +++ stable/12/sys/dev/nand/nand_cdev.c Mon Jul 22 01:06:06 2019 (r350205) @@ -101,7 +101,7 @@ nand_make_dev(struct nand_chip *chip) parent_unit = device_get_unit(parent); unit = parent_unit * 4 + chip->num; chip->cdev = make_dev(&nand_cdevsw, unit, UID_ROOT, GID_WHEEL, - 0666, "%s%d.%d", name, parent_unit, chip->num); + 0640, "%s%d.%d", name, parent_unit, chip->num); if (chip->cdev == NULL) return (ENXIO); From owner-svn-src-all@freebsd.org Mon Jul 22 03:14: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 CB668A65F5; Mon, 22 Jul 2019 03:14:48 +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 680F476AA2; Mon, 22 Jul 2019 03:13:22 +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 577E462CE; Mon, 22 Jul 2019 03:11:55 +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 x6M3BtL5086407; Mon, 22 Jul 2019 03:11:55 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6M3Bto3086406; Mon, 22 Jul 2019 03:11:55 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907220311.x6M3Bto3086406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 22 Jul 2019 03:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350206 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 350206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 680F476AA2 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.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: Mon, 22 Jul 2019 03:14:48 -0000 Author: jhibbits Date: Mon Jul 22 03:11:54 2019 New Revision: 350206 URL: https://svnweb.freebsd.org/changeset/base/350206 Log: powerpc64/mmu: Make moea64_pvo_enter() return if an entry already exists Summary: Instead of searching for a PVO entry before adding, take advantage of the fact that RB_INSERT() returns NULL if it inserts, and the existing entry if an entry exists, without inserting a new entry. This saves an extra tree traversal in the cases where the PVO does not exist. Reviewed by: luporl Differential Revision: https://reviews.freebsd.org/D20944 Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Jul 22 01:06:06 2019 (r350205) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Jul 22 03:11:54 2019 (r350206) @@ -231,7 +231,7 @@ int moea64_large_page_shift = 0; * PVO calls. */ static int moea64_pvo_enter(mmu_t mmu, struct pvo_entry *pvo, - struct pvo_head *pvo_head); + struct pvo_head *pvo_head, struct pvo_entry **oldpvo); static void moea64_pvo_remove_from_pmap(mmu_t mmu, struct pvo_entry *pvo); static void moea64_pvo_remove_from_page(mmu_t mmu, struct pvo_entry *pvo); static void moea64_pvo_remove_from_page_locked(mmu_t mmu, @@ -675,7 +675,7 @@ moea64_setup_direct_map(mmu_t mmup, vm_offset_t kernel pvo->pvo_pte.prot = VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE; pvo->pvo_pte.pa = pa | pte_lo; - moea64_pvo_enter(mmup, pvo, NULL); + moea64_pvo_enter(mmup, pvo, NULL, NULL); } } PMAP_UNLOCK(kernel_pmap); @@ -1424,8 +1424,8 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, v (m->oflags & VPO_UNMANAGED) == 0) vm_page_aflag_set(m, PGA_WRITEABLE); - oldpvo = moea64_pvo_find_va(pmap, va); - if (oldpvo != NULL) { + error = moea64_pvo_enter(mmu, pvo, pvo_head, &oldpvo); + if (error == EEXIST) { if (oldpvo->pvo_vaddr == pvo->pvo_vaddr && oldpvo->pvo_pte.pa == pvo->pvo_pte.pa && oldpvo->pvo_pte.prot == prot) { @@ -1449,8 +1449,8 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, v KASSERT(oldpvo->pvo_pmap == pmap, ("pmap of old " "mapping does not match new mapping")); moea64_pvo_remove_from_pmap(mmu, oldpvo); + error = moea64_pvo_enter(mmu, pvo, pvo_head, NULL); } - error = moea64_pvo_enter(mmu, pvo, pvo_head); PV_PAGE_UNLOCK(m); PMAP_UNLOCK(pmap); @@ -1641,7 +1641,7 @@ moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes init_pvo_entry(pvo, kernel_pmap, va); pvo->pvo_vaddr |= PVO_WIRED; - moea64_pvo_enter(installed_mmu, pvo, NULL); + moea64_pvo_enter(installed_mmu, pvo, NULL, NULL); if (needed_lock) PMAP_UNLOCK(kernel_pmap); @@ -1872,7 +1872,7 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_t va, vm_paddr if (oldpvo != NULL) moea64_pvo_remove_from_pmap(mmu, oldpvo); init_pvo_entry(pvo, kernel_pmap, va); - error = moea64_pvo_enter(mmu, pvo, NULL); + error = moea64_pvo_enter(mmu, pvo, NULL, NULL); PMAP_UNLOCK(kernel_pmap); /* Free any dead pages */ @@ -2514,9 +2514,11 @@ moea64_bootstrap_alloc(vm_size_t size, vm_size_t align } static int -moea64_pvo_enter(mmu_t mmu, struct pvo_entry *pvo, struct pvo_head *pvo_head) +moea64_pvo_enter(mmu_t mmu, struct pvo_entry *pvo, struct pvo_head *pvo_head, + struct pvo_entry **oldpvop) { int first, err; + struct pvo_entry *old_pvo; PMAP_LOCK_ASSERT(pvo->pvo_pmap, MA_OWNED); KASSERT(moea64_pvo_find_va(pvo->pvo_pmap, PVO_VADDR(pvo)) == NULL, @@ -2527,7 +2529,13 @@ moea64_pvo_enter(mmu_t mmu, struct pvo_entry *pvo, str /* * Add to pmap list */ - RB_INSERT(pvo_tree, &pvo->pvo_pmap->pmap_pvo, pvo); + old_pvo = RB_INSERT(pvo_tree, &pvo->pvo_pmap->pmap_pvo, pvo); + + if (old_pvo != NULL) { + if (oldpvop != NULL) + *oldpvop = old_pvo; + return (EEXIST); + } /* * Remember if the list was empty and therefore will be the first From owner-svn-src-all@freebsd.org Mon Jul 22 04:14: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 15224A7366; Mon, 22 Jul 2019 04:14:55 +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 BC4458251A; Mon, 22 Jul 2019 04:14:54 +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 288E471E6; Mon, 22 Jul 2019 04:14:54 +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 x6M4EsZ9025533; Mon, 22 Jul 2019 04:14:54 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6M4EsF5025532; Mon, 22 Jul 2019 04:14:54 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907220414.x6M4EsF5025532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 22 Jul 2019 04:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350207 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 350207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BC4458251A 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,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, 22 Jul 2019 04:14:55 -0000 Author: asomers Date: Mon Jul 22 04:14:53 2019 New Revision: 350207 URL: https://svnweb.freebsd.org/changeset/base/350207 Log: VOP_PATHCONF.9: correct the type of the retval argument It was changed from int to register_t in r22521 and from register_t to long in r328099, but the man page wasn't updated either time. MFC after: 2 weeks Modified: head/share/man/man9/VOP_PATHCONF.9 Modified: head/share/man/man9/VOP_PATHCONF.9 ============================================================================== --- head/share/man/man9/VOP_PATHCONF.9 Mon Jul 22 03:11:54 2019 (r350206) +++ head/share/man/man9/VOP_PATHCONF.9 Mon Jul 22 04:14:53 2019 (r350207) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd July 21, 2019 .Dt VOP_PATHCONF 9 .Os .Sh NAME @@ -39,7 +39,7 @@ .In sys/vnode.h .In sys/unistd.h .Ft int -.Fn VOP_PATHCONF "struct vnode *vp" "int name" "int *retval" +.Fn VOP_PATHCONF "struct vnode *vp" "int name" "long *retval" .Sh DESCRIPTION The arguments are: .Bl -tag -width retval From owner-svn-src-all@freebsd.org Mon Jul 22 08:27:46 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 4290EAB7F4; Mon, 22 Jul 2019 08:27:46 +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 239738A6C9; Mon, 22 Jul 2019 08:27:46 +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 DDB77A073; Mon, 22 Jul 2019 08:27:45 +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 x6M8RjP0072193; Mon, 22 Jul 2019 08:27:45 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6M8RiDB072189; Mon, 22 Jul 2019 08:27:44 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907220827.x6M8RiDB072189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 22 Jul 2019 08:27:44 +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: r350209 - stable/11/tests/sys/opencrypto X-SVN-Group: stable-11 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/11/tests/sys/opencrypto X-SVN-Commit-Revision: 350209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 239738A6C9 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_SHORT(-0.93)[-0.927,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: Mon, 22 Jul 2019 08:27:46 -0000 Author: lwhsu Date: Mon Jul 22 08:27:44 2019 New Revision: 350209 URL: https://svnweb.freebsd.org/changeset/base/350209 Log: MFC r346431, r349872 r346431 Specify using Python2, these .py files have not been converted to use Python3 yet, but the default Python version in ports has been switched to 3. Sponsored by: The FreeBSD Foundation 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/11/tests/sys/opencrypto/Makefile stable/11/tests/sys/opencrypto/cryptodev.py stable/11/tests/sys/opencrypto/cryptotest.py stable/11/tests/sys/opencrypto/runtests.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/opencrypto/Makefile ============================================================================== --- stable/11/tests/sys/opencrypto/Makefile Mon Jul 22 07:19:46 2019 (r350208) +++ stable/11/tests/sys/opencrypto/Makefile Mon Jul 22 08:27:44 2019 (r350209) @@ -7,7 +7,7 @@ BINDIR= ${TESTSDIR} PLAIN_TESTS_SH= runtests -TEST_METADATA.runtests+= required_programs="python" +TEST_METADATA.runtests+= required_programs="python2" TEST_METADATA.runtests+= required_user="root" PYMODULES= cryptodev.py cryptodevh.py cryptotest.py dpkt.py Modified: stable/11/tests/sys/opencrypto/cryptodev.py ============================================================================== --- stable/11/tests/sys/opencrypto/cryptodev.py Mon Jul 22 07:19:46 2019 (r350208) +++ stable/11/tests/sys/opencrypto/cryptodev.py Mon Jul 22 08:27:44 2019 (r350209) @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/local/bin/python2 # # Copyright (c) 2014 The FreeBSD Foundation # Copyright 2014 John-Mark Gurney @@ -34,6 +34,7 @@ import array import dpkt from fcntl import ioctl import os +import platform import signal from struct import pack as _pack @@ -105,14 +106,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) Modified: stable/11/tests/sys/opencrypto/cryptotest.py ============================================================================== --- stable/11/tests/sys/opencrypto/cryptotest.py Mon Jul 22 07:19:46 2019 (r350208) +++ stable/11/tests/sys/opencrypto/cryptotest.py Mon Jul 22 08:27:44 2019 (r350209) @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/local/bin/python2 # # Copyright (c) 2014 The FreeBSD Foundation # All rights reserved. Modified: stable/11/tests/sys/opencrypto/runtests.sh ============================================================================== --- stable/11/tests/sys/opencrypto/runtests.sh Mon Jul 22 07:19:46 2019 (r350208) +++ stable/11/tests/sys/opencrypto/runtests.sh Mon Jul 22 08:27:44 2019 (r350209) @@ -61,6 +61,6 @@ done oldcdas=$(sysctl -e kern.cryptodevallowsoft) sysctl kern.cryptodevallowsoft=1 -python $(dirname $0)/cryptotest.py +python2 $(dirname $0)/cryptotest.py sysctl "$oldcdas" From owner-svn-src-all@freebsd.org Mon Jul 22 10:18: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 BBD24AD970; Mon, 22 Jul 2019 10:18:00 +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 976F88E3FB; Mon, 22 Jul 2019 10:18:00 +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 6C8B8B51D; Mon, 22 Jul 2019 10:18:00 +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 x6MAI0F8037146; Mon, 22 Jul 2019 10:18:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MAI0IZ037145; Mon, 22 Jul 2019 10:18:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907221018.x6MAI0IZ037145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 22 Jul 2019 10:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350210 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 350210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 976F88E3FB 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.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, 22 Jul 2019 10:18:00 -0000 Author: manu Date: Mon Jul 22 10:17:59 2019 New Revision: 350210 URL: https://svnweb.freebsd.org/changeset/base/350210 Log: arm: Use -O2 instead of -O as optimization flag When using Clang -O is equivalent to -O2, change it -O2 to make it consistent with other platforms. Reference: https://clang.llvm.org/docs/ClangCommandLineReference.html#optimization-level Submitted by: Daniel Engberg (daniel.engberg.lists@pyret.net) Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D21021 Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Mon Jul 22 08:27:44 2019 (r350209) +++ head/share/mk/sys.mk Mon Jul 22 10:17:59 2019 (r350210) @@ -166,7 +166,7 @@ CC ?= c89 CFLAGS ?= -O .else CC ?= cc -.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" +.if ${MACHINE_CPUARCH} == "mips" CFLAGS ?= -O -pipe .else CFLAGS ?= -O2 -pipe From owner-svn-src-all@freebsd.org Mon Jul 22 10:37: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 A914BAE1A2; Mon, 22 Jul 2019 10:37: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 8AAB58F99C; Mon, 22 Jul 2019 10:37: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 645A3B8F8; Mon, 22 Jul 2019 10:37: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 x6MAbvKt049182; Mon, 22 Jul 2019 10:37:57 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MAbvNo049181; Mon, 22 Jul 2019 10:37:57 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907221037.x6MAbvNo049181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 22 Jul 2019 10:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350211 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 350211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8AAB58F99C 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.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: Mon, 22 Jul 2019 10:37:57 -0000 Author: lwhsu Date: Mon Jul 22 10:37:56 2019 New Revision: 350211 URL: https://svnweb.freebsd.org/changeset/base/350211 Log: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__follow_fork_child_detached_unrelated_debugger PR: 239292 Sponsored by: The FreeBSD Foundation 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 22 10:17:59 2019 (r350210) +++ head/tests/sys/kern/ptrace_test.c Mon Jul 22 10:37:56 2019 (r350211) @@ -867,6 +867,8 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelat pid_t children[2], fpid, wpid; int cpipe[2], status; + atf_tc_skip("https://bugs.freebsd.org/bug239292"); + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { From owner-svn-src-all@freebsd.org Mon Jul 22 12:58: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 B65FFB1486; Mon, 22 Jul 2019 12:58:44 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 649A26E16B; Mon, 22 Jul 2019 12:58:43 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id pXtmht09hUIS2pXtnh6xpP; Mon, 22 Jul 2019 06:58:40 -0600 X-Authority-Analysis: v=2.3 cv=N41X6F1B c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=8nJEP1OIZ-IA:10 a=0o9FgrsRnhwA:10 a=6I5d2MoRAAAA:8 a=pGLkceISAAAA:8 a=YxBL1-UpAAAA:8 a=dtX7w2-E1j9ObSnXGssA:9 a=AqDxhjTVg04_zwjF:21 a=7yibKyhn37eTI5BM:21 a=wPNLvfGTeEIA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id A84E77D6; Mon, 22 Jul 2019 05:58:37 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x6MCwbPf011530; Mon, 22 Jul 2019 05:58:37 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x6MCwbZj011527; Mon, 22 Jul 2019 05:58:37 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201907221258.x6MCwbZj011527@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Conrad Meyer cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342977 - in head/sys/dev: amdsmn amdtemp In-reply-to: <201901122236.x0CMaXsK017117@repo.freebsd.org> References: <201901122236.x0CMaXsK017117@repo.freebsd.org> Comments: In-reply-to Conrad Meyer message dated "Sat, 12 Jan 2019 22:36:33 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Mon, 22 Jul 2019 05:58:37 -0700 X-CMAE-Envelope: MS4wfFw+gF1qVf8Ytz/Vkzt523bHszdosLhoj4G9CGDuFLGKr1Nlv8egF79muNCEyXqUZQD/CDEEwV/1uItAFSzykLnrj2CDPHSRcU1+VIdfQ1iNbRTf/IIR 1JPdsa1KYQZFo3cPL5GUqJwg96VdDk5tkbP1wfHOg6S90HQ0R8cpl2zKFHQGIh/a+et8zzsN1fAo0WUqZFjDaZLGnsTm/ew9VtqoWNbs04OBqgKAzLpYVYqa Osvqw7xCxGDHN8r3nTv+c4BJaeoRV2XG3wNNazZMYUd8Pf7mBeKH+6uijcd+fHIW X-Rspamd-Queue-Id: 649A26E16B X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.58 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; IP_SCORE(-2.51)[ip: (-6.70), ipnet: 64.59.128.0/20(-3.23), asn: 6327(-2.51), country: CA(-0.09)]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.47)[-0.465,0]; RCVD_IN_DNSWL_NONE(0.00)[12.134.59.64.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11] 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, 22 Jul 2019 12:58:44 -0000 In message <201901122236.x0CMaXsK017117@repo.freebsd.org>, Conrad Meyer writes: > Author: cem > Date: Sat Jan 12 22:36:33 2019 > New Revision: 342977 > URL: https://svnweb.freebsd.org/changeset/base/342977 > > Log: > amdtemp(4): Add support for Family 15h, Model >=60h > > Family 15h is a bit of an oddball. Early models used the same temperature > register and spec (mostly[1]) as earlier CPU families. > > Model 60h-6Fh and 70-7Fh use something more like Family 17h's Service > Management Network, communicating with it in a similar fashion. To support > them, add support for their version of SMU indirection to amdsmn(4) and use > it in amdtemp(4) on these models. > > While here, clarify some of the deviceid macros in amdtemp(4) that were > added with arbitrary, incorrect family numbers, and remove ones that were > not used. Additionally, clarify intent and condition of heterogenous > multi-socket system detection. > > [1]: 15h adds the "adjust range by -49°C if a certain condition is met," > which previous families did not have. > > Reported by: D. C. > PR: 234657 > Tested by: D. C. > > Modified: > head/sys/dev/amdsmn/amdsmn.c > head/sys/dev/amdtemp/amdtemp.c > > Modified: head/sys/dev/amdsmn/amdsmn.c > ============================================================================= > = > --- head/sys/dev/amdsmn/amdsmn.c Sat Jan 12 22:10:31 2019 (r34297 > 6) > +++ head/sys/dev/amdsmn/amdsmn.c Sat Jan 12 22:36:33 2019 (r34297 > 7) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2017 Conrad Meyer > + * Copyright (c) 2017-2019 Conrad Meyer > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -25,7 +25,7 @@ > */ > > /* > - * Driver for the AMD Family 17h CPU System Management Network. > + * Driver for the AMD Family 15h and 17h CPU System Management Network. > */ > > #include > @@ -51,24 +51,45 @@ __FBSDID("$FreeBSD$"); > > #include > > -#define SMN_ADDR_REG 0x60 > -#define SMN_DATA_REG 0x64 > +#define F15H_SMN_ADDR_REG 0xb8 > +#define F15H_SMN_DATA_REG 0xbc > +#define F17H_SMN_ADDR_REG 0x60 > +#define F17H_SMN_DATA_REG 0x64 > > +#define PCI_DEVICE_ID_AMD_15H_M60H_ROOT 0x1576 > #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 > -#define PCI_DEVICE_ID_AMD_17H_ROOT_DF_F3 0x1463 > #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 > -#define PCI_DEVICE_ID_AMD_17H_M10H_ROOT_DF_F3 0x15eb > > +struct pciid; > struct amdsmn_softc { > struct mtx smn_lock; > + const struct pciid *smn_pciid; > }; > > -static struct pciid { > +static const struct pciid { > uint16_t amdsmn_vendorid; > uint16_t amdsmn_deviceid; > + uint8_t amdsmn_addr_reg; > + uint8_t amdsmn_data_reg; > } amdsmn_ids[] = { > - { CPU_VENDOR_AMD, PCI_DEVICE_ID_AMD_17H_ROOT }, > - { CPU_VENDOR_AMD, PCI_DEVICE_ID_AMD_17H_M10H_ROOT }, > + { > + .amdsmn_vendorid = CPU_VENDOR_AMD, > + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_15H_M60H_ROOT, > + .amdsmn_addr_reg = F15H_SMN_ADDR_REG, > + .amdsmn_data_reg = F15H_SMN_DATA_REG, > + }, > + { > + .amdsmn_vendorid = CPU_VENDOR_AMD, > + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_ROOT, > + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, > + .amdsmn_data_reg = F17H_SMN_DATA_REG, > + }, > + { > + .amdsmn_vendorid = CPU_VENDOR_AMD, > + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_M10H_ROOT, > + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, > + .amdsmn_data_reg = F17H_SMN_DATA_REG, > + }, > }; > > /* > @@ -101,7 +122,7 @@ MODULE_PNP_INFO("U16:vendor;U16:device", pci, amdsmn, > nitems(amdsmn_ids)); > > static bool > -amdsmn_match(device_t parent) > +amdsmn_match(device_t parent, const struct pciid **pciid_out) > { > uint16_t vendor, device; > size_t i; > @@ -109,10 +130,14 @@ amdsmn_match(device_t parent) > vendor = pci_get_vendor(parent); > device = pci_get_device(parent); > > - for (i = 0; i < nitems(amdsmn_ids); i++) > + for (i = 0; i < nitems(amdsmn_ids); i++) { > if (vendor == amdsmn_ids[i].amdsmn_vendorid && > - device == amdsmn_ids[i].amdsmn_deviceid) > + device == amdsmn_ids[i].amdsmn_deviceid) { > + if (pciid_out != NULL) > + *pciid_out = &amdsmn_ids[i]; > return (true); > + } > + } > return (false); > } > > @@ -124,7 +149,7 @@ amdsmn_identify(driver_t *driver, device_t parent) > /* Make sure we're not being doubly invoked. */ > if (device_find_child(parent, "amdsmn", -1) != NULL) > return; > - if (!amdsmn_match(parent)) > + if (!amdsmn_match(parent, NULL)) > return; > > child = device_add_child(parent, "amdsmn", -1); > @@ -136,21 +161,25 @@ static int > amdsmn_probe(device_t dev) > { > uint32_t family; > + char buf[64]; > > if (resource_disabled("amdsmn", 0)) > return (ENXIO); > - if (!amdsmn_match(device_get_parent(dev))) > + if (!amdsmn_match(device_get_parent(dev), NULL)) > return (ENXIO); > > family = CPUID_TO_FAMILY(cpu_id); > > switch (family) { > + case 0x15: > case 0x17: > break; > default: > return (ENXIO); > } > - device_set_desc(dev, "AMD Family 17h System Management Network"); > + snprintf(buf, sizeof(buf), "AMD Family %xh System Management Network", > + family); > + device_set_desc_copy(dev, buf); > > return (BUS_PROBE_GENERIC); > } > @@ -160,6 +189,9 @@ amdsmn_attach(device_t dev) > { > struct amdsmn_softc *sc = device_get_softc(dev); > > + if (!amdsmn_match(device_get_parent(dev), &sc->smn_pciid)) > + return (ENXIO); > + > mtx_init(&sc->smn_lock, "SMN mtx", "SMN", MTX_DEF); > return (0); > } > @@ -182,8 +214,8 @@ amdsmn_read(device_t dev, uint32_t addr, uint32_t *val > parent = device_get_parent(dev); > > mtx_lock(&sc->smn_lock); > - pci_write_config(parent, SMN_ADDR_REG, addr, 4); > - *value = pci_read_config(parent, SMN_DATA_REG, 4); > + pci_write_config(parent, sc->smn_pciid->amdsmn_addr_reg, addr, 4); > + *value = pci_read_config(parent, sc->smn_pciid->amdsmn_data_reg, 4); > mtx_unlock(&sc->smn_lock); > > return (0); > @@ -198,8 +230,8 @@ amdsmn_write(device_t dev, uint32_t addr, uint32_t val > parent = device_get_parent(dev); > > mtx_lock(&sc->smn_lock); > - pci_write_config(parent, SMN_ADDR_REG, addr, 4); > - pci_write_config(parent, SMN_DATA_REG, value, 4); > + pci_write_config(parent, sc->smn_pciid->amdsmn_addr_reg, addr, 4); > + pci_write_config(parent, sc->smn_pciid->amdsmn_data_reg, value, 4); > mtx_unlock(&sc->smn_lock); > > return (0); > > Modified: head/sys/dev/amdtemp/amdtemp.c > ============================================================================= > = > --- head/sys/dev/amdtemp/amdtemp.c Sat Jan 12 22:10:31 2019 (r34297 > 6) > +++ head/sys/dev/amdtemp/amdtemp.c Sat Jan 12 22:36:33 2019 (r34297 > 7) > @@ -5,6 +5,8 @@ > * Copyright (c) 2009 Norikatsu Shigemura > * Copyright (c) 2009-2012 Jung-uk Kim > * All rights reserved. > + * Copyright (c) 2017-2019 Conrad Meyer > + * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > @@ -76,44 +78,67 @@ struct amdtemp_softc { > device_t sc_smn; > }; > > +/* > + * N.B. The numbers in macro names below are significant and represent CPU > + * family and model numbers. Do not make up fictitious family or model numb > ers > + * when adding support for new devices. > + */ > #define VENDORID_AMD 0x1022 > #define DEVICEID_AMD_MISC0F 0x1103 > #define DEVICEID_AMD_MISC10 0x1203 > #define DEVICEID_AMD_MISC11 0x1303 > -#define DEVICEID_AMD_MISC12 0x1403 > #define DEVICEID_AMD_MISC14 0x1703 > #define DEVICEID_AMD_MISC15 0x1603 > +#define DEVICEID_AMD_MISC15_M10H 0x1403 > +#define DEVICEID_AMD_MISC15_M30H 0x141d > +#define DEVICEID_AMD_MISC15_M60H_ROOT 0x1576 > #define DEVICEID_AMD_MISC16 0x1533 > #define DEVICEID_AMD_MISC16_M30H 0x1583 > -#define DEVICEID_AMD_MISC17 0x141d > #define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 > -#define DEVICEID_AMD_HOSTB17H_DF_F3 0x1463 > #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 > -#define DEVICEID_AMD_HOSTB17H_M10H_DF_F3 0x15eb > > -static struct amdtemp_product { > +static const struct amdtemp_product { > uint16_t amdtemp_vendorid; > uint16_t amdtemp_deviceid; > + /* > + * 0xFC register is only valid on the D18F3 PCI device; SMN temp > + * drivers do not attach to that device. > + */ > + bool amdtemp_has_cpuid; > } amdtemp_products[] = { > - { VENDORID_AMD, DEVICEID_AMD_MISC0F }, > - { VENDORID_AMD, DEVICEID_AMD_MISC10 }, > - { VENDORID_AMD, DEVICEID_AMD_MISC11 }, > - { VENDORID_AMD, DEVICEID_AMD_MISC12 }, > - { VENDORID_AMD, DEVICEID_AMD_MISC14 }, > - { VENDORID_AMD, DEVICEID_AMD_MISC15 }, > - { VENDORID_AMD, DEVICEID_AMD_MISC16 }, > - { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H }, > - { VENDORID_AMD, DEVICEID_AMD_MISC17 }, > - { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT }, > - { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT }, > + { VENDORID_AMD, DEVICEID_AMD_MISC0F, true }, > + { VENDORID_AMD, DEVICEID_AMD_MISC10, true }, > + { VENDORID_AMD, DEVICEID_AMD_MISC11, true }, > + { VENDORID_AMD, DEVICEID_AMD_MISC14, true }, > + { VENDORID_AMD, DEVICEID_AMD_MISC15, true }, > + { VENDORID_AMD, DEVICEID_AMD_MISC15_M10H, true }, > + { VENDORID_AMD, DEVICEID_AMD_MISC15_M30H, true }, > + { VENDORID_AMD, DEVICEID_AMD_MISC15_M60H_ROOT, false }, > + { VENDORID_AMD, DEVICEID_AMD_MISC16, true }, > + { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H, true }, > + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT, false }, > + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT, false }, > }; > > /* > - * Reported Temperature Control Register > + * Reported Temperature Control Register, family 0Fh-15h (some models), 16h. > */ > #define AMDTEMP_REPTMP_CTRL 0xa4 > > +#define AMDTEMP_REPTMP10H_CURTMP_MASK 0x7ff > +#define AMDTEMP_REPTMP10H_CURTMP_SHIFT 21 > +#define AMDTEMP_REPTMP10H_TJSEL_MASK 0x3 > +#define AMDTEMP_REPTMP10H_TJSEL_SHIFT 16 > + > /* > + * Reported Temperature, Family 15h, M60+ > + * > + * Same register bit definitions as other Family 15h CPUs, but access is > + * indirect via SMN, like Family 17h. > + */ > +#define AMDTEMP_15H_M60H_REPTMP_CTRL 0xd8200ca4 > + > +/* > * Reported Temperature, Family 17h > * > * According to AMD OSRR for 17H, section 4.2.1, bits 31-21 of this register > @@ -123,9 +148,13 @@ static struct amdtemp_product { > */ > #define AMDTEMP_17H_CUR_TMP 0x59800 > #define AMDTEMP_17H_CUR_TMP_RANGE_SEL (1 << 19) > -#define AMDTEMP_17H_CUR_TMP_RANGE_OFF 490 > > /* > + * AMD temperature range adjustment, in deciKelvins (i.e., 49.0 Celsius). > + */ > +#define AMDTEMP_CURTMP_RANGE_ADJUST 490 > + > +/* > * Thermaltrip Status Register (Family 0Fh only) > */ > #define AMDTEMP_THERMTP_STAT 0xe4 > @@ -151,9 +180,9 @@ static int amdtemp_probe(device_t dev); > static int amdtemp_attach(device_t dev); > static void amdtemp_intrhook(void *arg); > static int amdtemp_detach(device_t dev); > -static int amdtemp_match(device_t dev); > static int32_t amdtemp_gettemp0f(device_t dev, amdsensor_t sensor); > static int32_t amdtemp_gettemp(device_t dev, amdsensor_t sensor); > +static int32_t amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor > ); > static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor); > static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS); > > @@ -180,8 +209,8 @@ MODULE_DEPEND(amdtemp, amdsmn, 1, 1, 1); > MODULE_PNP_INFO("U16:vendor;U16:device", pci, amdtemp, amdtemp_products, > nitems(amdtemp_products)); > > -static int > -amdtemp_match(device_t dev) > +static bool > +amdtemp_match(device_t dev, const struct amdtemp_product **product_out) > { > int i; > uint16_t vendor, devid; > @@ -191,11 +220,13 @@ amdtemp_match(device_t dev) > > for (i = 0; i < nitems(amdtemp_products); i++) { > if (vendor == amdtemp_products[i].amdtemp_vendorid && > - devid == amdtemp_products[i].amdtemp_deviceid) > - return (1); > + devid == amdtemp_products[i].amdtemp_deviceid) { > + if (product_out != NULL) > + *product_out = &amdtemp_products[i]; > + return (true); > + } > } > - > - return (0); > + return (false); > } > > static void > @@ -207,7 +238,7 @@ amdtemp_identify(driver_t *driver, device_t parent) > if (device_find_child(parent, "amdtemp", -1) != NULL) > return; > > - if (amdtemp_match(parent)) { > + if (amdtemp_match(parent, NULL)) { > child = device_add_child(parent, "amdtemp", -1); > if (child == NULL) > device_printf(parent, "add amdtemp child failed\n"); > @@ -221,7 +252,7 @@ amdtemp_probe(device_t dev) > > if (resource_disabled("amdtemp", 0)) > return (ENXIO); > - if (!amdtemp_match(device_get_parent(dev))) > + if (!amdtemp_match(device_get_parent(dev), NULL)) > return (ENXIO); > > family = CPUID_TO_FAMILY(cpu_id); > @@ -254,23 +285,42 @@ amdtemp_attach(device_t dev) > { > char tn[32]; > u_int regs[4]; > - struct amdtemp_softc *sc = device_get_softc(dev); > + const struct amdtemp_product *product; > + struct amdtemp_softc *sc; > struct sysctl_ctx_list *sysctlctx; > struct sysctl_oid *sysctlnode; > uint32_t cpuid, family, model; > u_int bid; > int erratum319, unit; > + bool needsmn; > > + sc = device_get_softc(dev); > erratum319 = 0; > + needsmn = false; > > - /* > - * CPUID Register is available from Revision F. > - */ > + if (!amdtemp_match(device_get_parent(dev), &product)) > + return (ENXIO); > + > cpuid = cpu_id; > family = CPUID_TO_FAMILY(cpuid); > model = CPUID_TO_MODEL(cpuid); > - if ((family != 0x0f || model >= 0x40) && family != 0x17) { > - cpuid = pci_read_config(dev, AMDTEMP_CPUID, 4); > + > + /* > + * This checks for the byzantine condition of running a heterogenous > + * revision multi-socket system where the attach thread is potentially > + * probing a remote socket's PCI device. > + * > + * Currently, such scenarios are unsupported on models using the SMN > + * (because on those models, amdtemp(4) attaches to a different PCI > + * device than the one that contains AMDTEMP_CPUID). > + * > + * The ancient 0x0F family of devices only supports this register from > + * models 40h+. > + */ > + if (product->amdtemp_has_cpuid && (family > 0x0f || > + (family == 0x0f && model >= 0x40))) { > + cpuid = pci_read_config(device_get_parent(dev), AMDTEMP_CPUID, > + 4); > family = CPUID_TO_FAMILY(cpuid); > model = CPUID_TO_MODEL(cpuid); > } > @@ -364,16 +414,30 @@ amdtemp_attach(device_t dev) > case 0x14: > case 0x15: > case 0x16: > + sc->sc_ntemps = 1; > /* > - * There is only one sensor per package. > + * Some later (60h+) models of family 15h use a similar SMN > + * network as family 17h. (However, the register index differs > + * from 17h and the decoding matches other 10h-15h models, > + * which differ from 17h.) > */ > - sc->sc_ntemps = 1; > - > - sc->sc_gettemp = amdtemp_gettemp; > + if (family == 0x15 && model >= 0x60) { > + sc->sc_gettemp = amdtemp_gettemp15hm60h; > + needsmn = true; > + } else > + sc->sc_gettemp = amdtemp_gettemp; > break; > case 0x17: > sc->sc_ntemps = 1; > sc->sc_gettemp = amdtemp_gettemp17h; > + needsmn = true; > + break; > + default: > + device_printf(dev, "Bogus family 0x%x\n", family); > + return (ENXIO); > + } > + > + if (needsmn) { > sc->sc_smn = device_find_child( > device_get_parent(dev), "amdsmn", -1); > if (sc->sc_smn == NULL) { > @@ -381,7 +445,6 @@ amdtemp_attach(device_t dev) > device_printf(dev, "No SMN device found\n"); > return (ENXIO); > } > - break; > } > > /* Find number of cores per package. */ > @@ -585,6 +648,29 @@ amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) > return (temp); > } > > +static uint32_t > +amdtemp_decode_fam10h_to_16h(int32_t sc_offset, uint32_t val) > +{ > + uint32_t temp; > + > + /* Convert raw register subfield units (0.125C) to units of 0.1C. */ > + temp = ((val >> AMDTEMP_REPTMP10H_CURTMP_SHIFT) & > + AMDTEMP_REPTMP10H_CURTMP_MASK) * 5 / 4; > + > + /* > + * On Family 15h and higher, if CurTmpTjSel is 11b, the range is > + * adjusted down by 49.0 degrees Celsius. (This adjustment is not > + * documented in BKDGs prior to family 15h model 00h.) > + */ > + if (CPUID_TO_FAMILY(cpu_id) >= 0x15 && > + ((val >> AMDTEMP_REPTMP10H_TJSEL_SHIFT) & > + AMDTEMP_REPTMP10H_TJSEL_MASK) == 0x3) > + temp -= AMDTEMP_CURTMP_RANGE_ADJUST; > + > + temp += AMDTEMP_ZERO_C_TO_K + sc_offset * 10; > + return (temp); > +} > + > static int32_t > amdtemp_gettemp(device_t dev, amdsensor_t sensor) > { > @@ -592,10 +678,19 @@ amdtemp_gettemp(device_t dev, amdsensor_t sensor) > uint32_t temp; > > temp = pci_read_config(dev, AMDTEMP_REPTMP_CTRL, 4); > - temp = ((temp >> 21) & 0x7ff) * 5 / 4; > - temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; > + return (amdtemp_decode_fam10h_to_16h(sc->sc_offset, temp)); > +} > > - return (temp); > +static int32_t > +amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor) > +{ > + struct amdtemp_softc *sc = device_get_softc(dev); > + uint32_t val; > + int error; > + > + error = amdsmn_read(sc->sc_smn, AMDTEMP_15H_M60H_REPTMP_CTRL, &val); > + KASSERT(error == 0, ("amdsmn_read")); > + return (amdtemp_decode_fam10h_to_16h(sc->sc_offset, val)); > } > > static int32_t > @@ -610,7 +705,7 @@ amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) > > temp = ((val >> 21) & 0x7ff) * 5 / 4; > if ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0) > - temp -= AMDTEMP_17H_CUR_TMP_RANGE_OFF; > + temp -= AMDTEMP_CURTMP_RANGE_ADJUST; > temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10; > > return (temp); > This broke/removed support for family 0fh. I'm seeing strange temperatures and negative on one machine. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Mon Jul 22 16:01: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 CAEF5B4D26; Mon, 22 Jul 2019 16:01:22 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 B093675658; Mon, 22 Jul 2019 16:01:22 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A7C1F97E; Mon, 22 Jul 2019 16:01:22 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6MG1Mto067720; Mon, 22 Jul 2019 16:01:22 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MG1KJb067708; Mon, 22 Jul 2019 16:01:20 GMT (envelope-from br@FreeBSD.org) Message-Id: <201907221601.x6MG1KJb067708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 22 Jul 2019 16:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350212 - in head/sys: conf dev/altera/msgdma dev/xdma mips/beri X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf dev/altera/msgdma dev/xdma mips/beri X-SVN-Commit-Revision: 350212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B093675658 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.934,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, 22 Jul 2019 16:01:22 -0000 Author: br Date: Mon Jul 22 16:01:20 2019 New Revision: 350212 URL: https://svnweb.freebsd.org/changeset/base/350212 Log: o Add support for BERI IOMMU device o Add an experimental IOMMU support to xDMA framework The BERI IOMMU device is the part of CHERI device-model project [1]. It translates memory addresses for various BERI peripherals modelled in software. It accepts FreeBSD/mips64 page directories format and manages BERI TLB. 1. https://github.com/CTSRD-CHERI/device-model Sponsored by: DARPA, AFRL Added: head/sys/dev/xdma/xdma_iommu.c (contents, props changed) head/sys/mips/beri/beri_iommu.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/altera/msgdma/msgdma.c head/sys/dev/xdma/xdma.c head/sys/dev/xdma/xdma.h head/sys/dev/xdma/xdma_if.m head/sys/dev/xdma/xdma_sg.c head/sys/mips/beri/files.beri Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jul 22 10:37:56 2019 (r350211) +++ head/sys/conf/files Mon Jul 22 16:01:20 2019 (r350212) @@ -3431,6 +3431,7 @@ dev/xdma/xdma_bank.c optional xdma dev/xdma/xdma_bio.c optional xdma dev/xdma/xdma_fdt_test.c optional xdma xdma_test fdt dev/xdma/xdma_if.m optional xdma +dev/xdma/xdma_iommu.c optional xdma dev/xdma/xdma_mbuf.c optional xdma dev/xdma/xdma_queue.c optional xdma dev/xdma/xdma_sg.c optional xdma Modified: head/sys/dev/altera/msgdma/msgdma.c ============================================================================== --- head/sys/dev/altera/msgdma/msgdma.c Mon Jul 22 10:37:56 2019 (r350211) +++ head/sys/dev/altera/msgdma/msgdma.c Mon Jul 22 16:01:20 2019 (r350212) @@ -414,7 +414,8 @@ msgdma_channel_alloc(device_t dev, struct xdma_channel if (chan->used == 0) { chan->xchan = xchan; xchan->chan = (void *)chan; - xchan->caps |= XCHAN_CAP_BUSDMA; + if ((xchan->caps & XCHAN_CAP_IOMMU) == 0) + xchan->caps |= XCHAN_CAP_BUSDMA; chan->index = i; chan->sc = sc; chan->used = 1; Modified: head/sys/dev/xdma/xdma.c ============================================================================== --- head/sys/dev/xdma/xdma.c Mon Jul 22 10:37:56 2019 (r350211) +++ head/sys/dev/xdma/xdma.c Mon Jul 22 16:01:20 2019 (r350212) @@ -70,6 +70,39 @@ static struct mtx xdma_mtx; #define FDT_REG_CELLS 4 +#ifdef FDT +static int +xdma_get_iommu_fdt(xdma_controller_t *xdma, xdma_channel_t *xchan) +{ + struct xdma_iommu *xio; + phandle_t node; + pcell_t prop; + size_t len; + + node = ofw_bus_get_node(xdma->dma_dev); + if (OF_getproplen(node, "xdma,iommu") <= 0) + return (0); + + len = OF_getencprop(node, "xdma,iommu", &prop, sizeof(prop)); + if (len != sizeof(prop)) { + device_printf(xdma->dev, + "%s: Can't get iommu device node\n", __func__); + return (0); + } + + xio = &xchan->xio; + xio->dev = OF_device_from_xref(prop); + if (xio->dev == NULL) { + device_printf(xdma->dev, + "%s: Can't get iommu device\n", __func__); + return (0); + } + + /* Found */ + return (1); +} +#endif + /* * Allocate virtual xDMA channel. */ @@ -81,6 +114,13 @@ xdma_channel_alloc(xdma_controller_t *xdma, uint32_t c xchan = malloc(sizeof(xdma_channel_t), M_XDMA, M_WAITOK | M_ZERO); xchan->xdma = xdma; + +#ifdef FDT + /* Check if this DMA controller supports IOMMU. */ + if (xdma_get_iommu_fdt(xdma, xchan)) + caps |= XCHAN_CAP_IOMMU | XCHAN_CAP_NOSEG; +#endif + xchan->caps = caps; XDMA_LOCK(); @@ -109,6 +149,9 @@ xdma_channel_alloc(xdma_controller_t *xdma, uint32_t c TAILQ_INIT(&xchan->queue_out); TAILQ_INIT(&xchan->processing); + if (xchan->caps & XCHAN_CAP_IOMMU) + xdma_iommu_init(&xchan->xio); + TAILQ_INSERT_TAIL(&xdma->channels, xchan, xchan_next); XDMA_UNLOCK(); @@ -139,6 +182,9 @@ xdma_channel_free(xdma_channel_t *xchan) if (xchan->flags & XCHAN_TYPE_SG) xdma_channel_free_sg(xchan); + if (xchan->caps & XCHAN_CAP_IOMMU) + xdma_iommu_release(&xchan->xio); + xdma_teardown_all_intr(xchan); mtx_destroy(&xchan->mtx_lock); @@ -306,7 +352,7 @@ xdma_ofw_md_data(xdma_controller_t *xdma, pcell_t *cel return (ret); } -static int +int xdma_handle_mem_node(vmem_t *vmem, phandle_t memory) { pcell_t reg[FDT_REG_CELLS * FDT_MEM_REGIONS]; Modified: head/sys/dev/xdma/xdma.h ============================================================================== --- head/sys/dev/xdma/xdma.h Mon Jul 22 10:37:56 2019 (r350211) +++ head/sys/dev/xdma/xdma.h Mon Jul 22 16:01:20 2019 (r350212) @@ -37,6 +37,14 @@ #include #include +#ifdef FDT +#include +#include +#endif + +#include +#include + enum xdma_direction { XDMA_MEM_TO_MEM, XDMA_MEM_TO_DEV, @@ -121,6 +129,12 @@ struct xdma_sglist { bool last; }; +struct xdma_iommu { + struct pmap p; + vmem_t *vmem; /* VA space */ + device_t dev; /* IOMMU device */ +}; + struct xdma_channel { xdma_controller_t *xdma; vmem_t *vmem; @@ -138,6 +152,7 @@ struct xdma_channel { #define XCHAN_CAP_BUSDMA (1 << 0) #define XCHAN_CAP_NOSEG (1 << 1) #define XCHAN_CAP_BOUNCE (1 << 2) +#define XCHAN_CAP_IOMMU (1 << 3) /* A real hardware driver channel. */ void *chan; @@ -171,6 +186,9 @@ struct xdma_channel { TAILQ_HEAD(, xdma_request) queue_in; TAILQ_HEAD(, xdma_request) queue_out; TAILQ_HEAD(, xdma_request) processing; + + /* iommu */ + struct xdma_iommu xio; }; typedef struct xdma_channel xdma_channel_t; @@ -216,6 +234,9 @@ xdma_controller_t *xdma_ofw_get(device_t dev, const ch int xdma_put(xdma_controller_t *xdma); vmem_t * xdma_get_memory(device_t dev); void xdma_put_memory(vmem_t *vmem); +#ifdef FDT +int xdma_handle_mem_node(vmem_t *vmem, phandle_t memory); +#endif /* xDMA channel ops */ xdma_channel_t * xdma_channel_alloc(xdma_controller_t *, uint32_t caps); @@ -270,5 +291,12 @@ void xchan_bank_init(xdma_channel_t *xchan); int xchan_bank_free(xdma_channel_t *xchan); struct xdma_request * xchan_bank_get(xdma_channel_t *xchan); int xchan_bank_put(xdma_channel_t *xchan, struct xdma_request *xr); + +/* IOMMU */ +void xdma_iommu_add_entry(xdma_channel_t *xchan, vm_offset_t *va, + vm_paddr_t pa, vm_size_t size, vm_prot_t prot); +void xdma_iommu_remove_entry(xdma_channel_t *xchan, vm_offset_t va); +int xdma_iommu_init(struct xdma_iommu *xio); +int xdma_iommu_release(struct xdma_iommu *xio); #endif /* !_DEV_XDMA_XDMA_H_ */ Modified: head/sys/dev/xdma/xdma_if.m ============================================================================== --- head/sys/dev/xdma/xdma_if.m Mon Jul 22 10:37:56 2019 (r350211) +++ head/sys/dev/xdma/xdma_if.m Mon Jul 22 16:01:20 2019 (r350212) @@ -1,5 +1,5 @@ #- -# Copyright (c) 2016-2018 Ruslan Bukin +# Copyright (c) 2016-2019 Ruslan Bukin # All rights reserved. # # This software was developed by SRI International and the University of @@ -112,4 +112,41 @@ METHOD int channel_control { device_t dev; struct xdma_channel *xchan; int cmd; +}; + +# IOMMU interface + +# +# pmap is initialized +# +METHOD int iommu_init { + device_t dev; + struct xdma_iommu *xio; +}; + +# +# pmap is released +# +METHOD int iommu_release { + device_t dev; + struct xdma_iommu *xio; +}; + +# +# Mapping entered +# +METHOD int iommu_enter { + device_t dev; + struct xdma_iommu *xio; + vm_offset_t va; + vm_offset_t pa; +}; + +# +# Mapping removed +# +METHOD int iommu_remove { + device_t dev; + struct xdma_iommu *xio; + vm_offset_t va; }; Added: head/sys/dev/xdma/xdma_iommu.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xdma/xdma_iommu.c Mon Jul 22 16:01:20 2019 (r350212) @@ -0,0 +1,174 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +#include +#include "xdma_if.h" + +void +xdma_iommu_remove_entry(xdma_channel_t *xchan, vm_offset_t va) +{ + struct xdma_iommu *xio; + + xio = &xchan->xio; + + va &= ~(PAGE_SIZE - 1); + pmap_remove(&xio->p, va, va + PAGE_SIZE); + + XDMA_IOMMU_REMOVE(xio->dev, xio, va); + + vmem_free(xio->vmem, va, PAGE_SIZE); +} + +static void +xdma_iommu_enter(struct xdma_iommu *xio, vm_offset_t va, + vm_paddr_t pa, vm_size_t size, vm_prot_t prot) +{ + vm_page_t m; + pmap_t p; + + p = &xio->p; + + KASSERT((size & PAGE_MASK) == 0, + ("%s: device mapping not page-sized", __func__)); + + for (; size > 0; size -= PAGE_SIZE) { + m = PHYS_TO_VM_PAGE(pa); + pmap_enter(p, va, m, prot, prot | PMAP_ENTER_WIRED, 0); + + XDMA_IOMMU_ENTER(xio->dev, xio, va, pa); + + va += PAGE_SIZE; + pa += PAGE_SIZE; + } +} + +void +xdma_iommu_add_entry(xdma_channel_t *xchan, vm_offset_t *va, + vm_paddr_t pa, vm_size_t size, vm_prot_t prot) +{ + struct xdma_iommu *xio; + vm_offset_t addr; + + size = roundup2(size, PAGE_SIZE); + xio = &xchan->xio; + + if (vmem_alloc(xio->vmem, size, + M_FIRSTFIT | M_NOWAIT, &addr)) { + panic("Could not allocate virtual address.\n"); + } + + addr |= pa & (PAGE_SIZE - 1); + + if (va) + *va = addr; + + xdma_iommu_enter(xio, addr, pa, size, prot); +} + +int +xdma_iommu_init(struct xdma_iommu *xio) +{ +#ifdef FDT + phandle_t mem_node, node; + pcell_t mem_handle; +#endif + + pmap_pinit(&xio->p); + +#ifdef FDT + node = ofw_bus_get_node(xio->dev); + if (!OF_hasprop(node, "va-region")) + return (ENXIO); + + if (OF_getencprop(node, "va-region", (void *)&mem_handle, + sizeof(mem_handle)) <= 0) + return (ENXIO); +#endif + + xio->vmem = vmem_create("xDMA vmem", 0, 0, PAGE_SIZE, + PAGE_SIZE, M_FIRSTFIT | M_WAITOK); + if (xio->vmem == NULL) + return (ENXIO); + +#ifdef FDT + mem_node = OF_node_from_xref(mem_handle); + if (xdma_handle_mem_node(xio->vmem, mem_node) != 0) { + vmem_destroy(xio->vmem); + return (ENXIO); + } +#endif + + XDMA_IOMMU_INIT(xio->dev, xio); + + return (0); +} + +int +xdma_iommu_release(struct xdma_iommu *xio) +{ + + pmap_release(&xio->p); + + vmem_destroy(xio->vmem); + + XDMA_IOMMU_RELEASE(xio->dev, xio); + + return (0); +} Modified: head/sys/dev/xdma/xdma_sg.c ============================================================================== --- head/sys/dev/xdma/xdma_sg.c Mon Jul 22 10:37:56 2019 (r350211) +++ head/sys/dev/xdma/xdma_sg.c Mon Jul 22 16:01:20 2019 (r350212) @@ -327,6 +327,7 @@ xchan_seg_done(xdma_channel_t *xchan, struct xdma_request *xr; xdma_controller_t *xdma; struct xchan_buf *b; + bus_addr_t addr; xdma = xchan->xdma; @@ -352,6 +353,12 @@ xchan_seg_done(xdma_channel_t *xchan, xr->direction == XDMA_DEV_TO_MEM) m_copyback(xr->m, 0, st->transferred, (void *)xr->buf.vaddr); + } else if (xchan->caps & XCHAN_CAP_IOMMU) { + if (xr->direction == XDMA_MEM_TO_DEV) + addr = xr->src_addr; + else + addr = xr->dst_addr; + xdma_iommu_remove_entry(xchan, addr); } xr->status.error = st->error; xr->status.transferred = st->transferred; @@ -484,11 +491,17 @@ _xdma_load_data(xdma_channel_t *xchan, struct xdma_req xdma_controller_t *xdma; struct mbuf *m; uint32_t nsegs; + vm_offset_t va, addr; + bus_addr_t pa; + vm_prot_t prot; xdma = xchan->xdma; m = xr->m; + KASSERT(xchan->caps & XCHAN_CAP_NOSEG, + ("Handling segmented data is not implemented here.")); + nsegs = 1; switch (xr->req_type) { @@ -498,6 +511,27 @@ _xdma_load_data(xdma_channel_t *xchan, struct xdma_req m_copydata(m, 0, m->m_pkthdr.len, (void *)xr->buf.vaddr); seg[0].ds_addr = (bus_addr_t)xr->buf.paddr; + } else if (xchan->caps & XCHAN_CAP_IOMMU) { + addr = mtod(m, bus_addr_t); + pa = vtophys(addr); + + if (xr->direction == XDMA_MEM_TO_DEV) + prot = VM_PROT_READ; + else + prot = VM_PROT_WRITE; + + xdma_iommu_add_entry(xchan, &va, + pa, m->m_pkthdr.len, prot); + + /* + * Save VA so we can unload data later + * after completion of this transfer. + */ + if (xr->direction == XDMA_MEM_TO_DEV) + xr->src_addr = va; + else + xr->dst_addr = va; + seg[0].ds_addr = va; } else seg[0].ds_addr = mtod(m, bus_addr_t); seg[0].ds_len = m->m_pkthdr.len; Added: head/sys/mips/beri/beri_iommu.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/beri/beri_iommu.c Mon Jul 22 16:01:20 2019 (r350212) @@ -0,0 +1,237 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "xdma_if.h" + +#define IOMMU_INVALIDATE 0x00 +#define IOMMU_SET_BASE 0x08 + +struct beri_iommu_softc { + struct resource *res[1]; + device_t dev; + bus_space_tag_t bst_data; + bus_space_handle_t bsh_data; + uint32_t offs; +}; + +static struct resource_spec beri_iommu_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static void +beri_iommu_invalidate(struct beri_iommu_softc *sc, vm_offset_t addr) +{ + + bus_write_8(sc->res[0], IOMMU_INVALIDATE, htole64(addr)); +} + +static void +beri_iommu_set_base(struct beri_iommu_softc *sc, vm_offset_t addr) +{ + + bus_write_8(sc->res[0], IOMMU_SET_BASE, htole64(addr)); +} + +static int +beri_iommu_release(device_t dev, struct xdma_iommu *xio) +{ + struct beri_iommu_softc *sc; + + sc = device_get_softc(dev); + + beri_iommu_set_base(sc, 0); + + return (0); +} + +static int +beri_iommu_init(device_t dev, struct xdma_iommu *xio) +{ + struct beri_iommu_softc *sc; + + sc = device_get_softc(dev); + + beri_iommu_set_base(sc, (uintptr_t)xio->p.pm_segtab); + + return (0); +} + +static int +beri_iommu_remove(device_t dev, struct xdma_iommu *xio, vm_offset_t va) +{ + struct beri_iommu_softc *sc; + + sc = device_get_softc(dev); + + beri_iommu_invalidate(sc, va); + + return (0); +} + +static int +beri_iommu_enter(device_t dev, struct xdma_iommu *xio, vm_offset_t va, + vm_paddr_t pa) +{ + struct beri_iommu_softc *sc; + pt_entry_t opte, npte; + pt_entry_t *pte; + pmap_t p; + + sc = device_get_softc(dev); + p = &xio->p; + + pte = pmap_pte(p, va); + if (pte == NULL) + panic("pte is NULL\n"); + + /* Make pte uncacheable. */ + opte = *pte; + npte = opte & ~PTE_C_MASK; + npte |= PTE_C(VM_MEMATTR_UNCACHEABLE); + *pte = npte; + + /* Write back, invalidate pte. */ + mips_dcache_wbinv_range((vm_offset_t)pte, sizeof(vm_offset_t)); + + /* Invalidate the entry. */ + if (pte_test(&opte, PTE_V) && opte != npte) + beri_iommu_invalidate(sc, va); + + return (0); +} + +static int +beri_iommu_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "beri,iommu")) + return (ENXIO); + + device_set_desc(dev, "BERI IOMMU"); + + return (BUS_PROBE_DEFAULT); +} + +static int +beri_iommu_attach(device_t dev) +{ + struct beri_iommu_softc *sc; + phandle_t xref, node; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, beri_iommu_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst_data = rman_get_bustag(sc->res[0]); + sc->bsh_data = rman_get_bushandle(sc->res[0]); + + node = ofw_bus_get_node(dev); + xref = OF_xref_from_node(node); + OF_device_register_xref(xref, dev); + + return (0); +} + +static int +beri_iommu_detach(device_t dev) +{ + struct beri_iommu_softc *sc; + + sc = device_get_softc(dev); + + bus_release_resources(dev, beri_iommu_spec, sc->res); + + return (0); +} + +static device_method_t beri_iommu_methods[] = { + + /* xDMA IOMMU interface */ + DEVMETHOD(xdma_iommu_init, beri_iommu_init), + DEVMETHOD(xdma_iommu_release, beri_iommu_release), + DEVMETHOD(xdma_iommu_enter, beri_iommu_enter), + DEVMETHOD(xdma_iommu_remove, beri_iommu_remove), + + /* Device interface */ + DEVMETHOD(device_probe, beri_iommu_probe), + DEVMETHOD(device_attach, beri_iommu_attach), + DEVMETHOD(device_detach, beri_iommu_detach), + + { 0, 0 } +}; + +static driver_t beri_iommu_driver = { + "beri_iommu", + beri_iommu_methods, + sizeof(struct beri_iommu_softc), +}; + +static devclass_t beri_iommu_devclass; + +DRIVER_MODULE(beri_iommu, simplebus, beri_iommu_driver, + beri_iommu_devclass, 0, 0); Modified: head/sys/mips/beri/files.beri ============================================================================== --- head/sys/mips/beri/files.beri Mon Jul 22 10:37:56 2019 (r350211) +++ head/sys/mips/beri/files.beri Mon Jul 22 16:01:20 2019 (r350212) @@ -20,6 +20,7 @@ dev/terasic/mtl/terasic_mtl_reg.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_syscons.c optional terasic_mtl sc dev/terasic/mtl/terasic_mtl_text.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_vt.c optional terasic_mtl vt +mips/beri/beri_iommu.c optional xdma mips/beri/beri_machdep.c standard mips/beri/beri_mp.c optional smp mips/beri/beri_pic.c optional fdt From owner-svn-src-all@freebsd.org Mon Jul 22 16:50: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 8422DB59E7; Mon, 22 Jul 2019 16:50:38 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 647E577214; Mon, 22 Jul 2019 16:50:38 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E38F1822E; Mon, 22 Jul 2019 16:50:38 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6MGocvm095482; Mon, 22 Jul 2019 16:50:38 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MGocxL095481; Mon, 22 Jul 2019 16:50:38 GMT (envelope-from br@FreeBSD.org) Message-Id: <201907221650.x6MGocxL095481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 22 Jul 2019 16:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350213 - head/sys/dev/xdma X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/xdma X-SVN-Commit-Revision: 350213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 647E577214 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: Mon, 22 Jul 2019 16:50:38 -0000 Author: br Date: Mon Jul 22 16:50:37 2019 New Revision: 350213 URL: https://svnweb.freebsd.org/changeset/base/350213 Log: Remove unused header. Sponsored by: DARPA, AFRL Modified: head/sys/dev/xdma/xdma_iommu.c Modified: head/sys/dev/xdma/xdma_iommu.c ============================================================================== --- head/sys/dev/xdma/xdma_iommu.c Mon Jul 22 16:01:20 2019 (r350212) +++ head/sys/dev/xdma/xdma_iommu.c Mon Jul 22 16:50:37 2019 (r350213) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include From owner-svn-src-all@freebsd.org Mon Jul 22 17:08: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 532EFB647E; Mon, 22 Jul 2019 17:08:20 +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 2CA0F800DA; Mon, 22 Jul 2019 17:08:20 +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 4FAF51859A; Mon, 22 Jul 2019 17:08:19 +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 x6MH8Jm7007483; Mon, 22 Jul 2019 17:08:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MH8IEu007481; Mon, 22 Jul 2019 17:08:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201907221708.x6MH8IEu007481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 22 Jul 2019 17:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350214 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 350214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2CA0F800DA 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: Mon, 22 Jul 2019 17:08:20 -0000 Author: mav Date: Mon Jul 22 17:08:18 2019 New Revision: 350214 URL: https://svnweb.freebsd.org/changeset/base/350214 Log: Unify BTL parsing for `camcontrol debug` and `reset`. This makes `camcontrol debug` also allow peripheral device specification. While there, make BTL parser more strict and switch from strtok() to strsep(). MFC after: 2 weeks Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Mon Jul 22 16:50:37 2019 (r350213) +++ head/sbin/camcontrol/camcontrol.8 Mon Jul 22 17:08:18 2019 (r350214) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2019 +.Dd July 22, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -185,7 +185,7 @@ .Op Fl X .Op Fl c .Op Fl p -.Aq all|off|bus Ns Op :target Ns Op :lun +.Aq all | off | device id | bus Ns Op :target Ns Op :lun .Nm .Ic tags .Op device id Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Jul 22 16:50:37 2019 (r350213) +++ head/sbin/camcontrol/camcontrol.c Mon Jul 22 17:08:18 2019 (r350214) @@ -3535,6 +3535,66 @@ atasecurity(struct cam_device *device, int retry_count } /* + * Convert periph name into a bus, target and lun. + * + * Returns the number of parsed components, or 0. + */ +static int +parse_btl_name(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, + cam_argmask *arglst) +{ + int fd; + union ccb ccb; + + bzero(&ccb, sizeof(ccb)); + ccb.ccb_h.func_code = XPT_GDEVLIST; + if (cam_get_device(tstr, ccb.cgdl.periph_name, + sizeof(ccb.cgdl.periph_name), &ccb.cgdl.unit_number) == -1) { + warnx("%s", cam_errbuf); + return (0); + } + + /* + * Attempt to get the passthrough device. This ioctl will + * fail if the device name is null, if the device doesn't + * exist, or if the passthrough driver isn't in the kernel. + */ + if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) { + warn("Unable to open %s", XPT_DEVICE); + return (0); + } + if (ioctl(fd, CAMGETPASSTHRU, &ccb) == -1) { + warn("Unable to find bus:target:lun for device %s%d", + ccb.cgdl.periph_name, ccb.cgdl.unit_number); + close(fd); + return (0); + } + close(fd); + if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + const struct cam_status_entry *entry; + + entry = cam_fetch_status_entry(ccb.ccb_h.status); + warnx("Unable to find bus:target_lun for device %s%d, " + "CAM status: %s (%#x)", + ccb.cgdl.periph_name, ccb.cgdl.unit_number, + entry ? entry->status_text : "Unknown", + ccb.ccb_h.status); + return (0); + } + + /* + * The kernel fills in the bus/target/lun. We don't + * need the passthrough device name and unit number since + * we aren't going to open it. + */ + *bus = ccb.ccb_h.path_id; + *target = ccb.ccb_h.target_id; + *lun = ccb.ccb_h.target_lun; + *arglst |= CAM_ARG_BUS | CAM_ARG_TARGET | CAM_ARG_LUN; + return (3); +} + +/* * Parse out a bus, or a bus, target and lun in the following * format: * bus @@ -3547,25 +3607,43 @@ static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, cam_argmask *arglst) { - char *tmpstr; + char *tmpstr, *end; int convs = 0; + *bus = CAM_BUS_WILDCARD; + *target = CAM_TARGET_WILDCARD; + *lun = CAM_LUN_WILDCARD; + while (isspace(*tstr) && (*tstr != '\0')) tstr++; - tmpstr = (char *)strtok(tstr, ":"); + if (strncasecmp(tstr, "all", strlen("all")) == 0) { + arglist |= CAM_ARG_BUS; + return (1); + } + + if (!isdigit(*tstr)) + return (parse_btl_name(tstr, bus, target, lun, arglst)); + + tmpstr = strsep(&tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')) { - *bus = strtol(tmpstr, NULL, 0); + *bus = strtol(tmpstr, &end, 0); + if (*end != '\0') + return (0); *arglst |= CAM_ARG_BUS; convs++; - tmpstr = (char *)strtok(NULL, ":"); + tmpstr = strsep(&tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')) { - *target = strtol(tmpstr, NULL, 0); + *target = strtol(tmpstr, &end, 0); + if (*end != '\0') + return (0); *arglst |= CAM_ARG_TARGET; convs++; - tmpstr = (char *)strtok(NULL, ":"); + tmpstr = strsep(&tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')) { - *lun = strtol(tmpstr, NULL, 0); + *lun = strtoll(tmpstr, &end, 0); + if (*end != '\0') + return (0); *arglst |= CAM_ARG_LUN; convs++; } @@ -3579,7 +3657,7 @@ static int dorescan_or_reset(int argc, char **argv, int rescan) { static const char must[] = - "you must specify \"all\", a bus, or a bus:target:lun to %s"; + "you must specify \"all\", a bus, a bus:target:lun or periph to %s"; int rv, error = 0; path_id_t bus = CAM_BUS_WILDCARD; target_id_t target = CAM_TARGET_WILDCARD; @@ -3596,118 +3674,19 @@ dorescan_or_reset(int argc, char **argv, int rescan) tstr++; if (strncasecmp(tstr, "all", strlen("all")) == 0) arglist |= CAM_ARG_BUS; - else if (isdigit(*tstr)) { + else { rv = parse_btl(argv[optind], &bus, &target, &lun, &arglist); if (rv != 1 && rv != 3) { - warnx(must, rescan? "rescan" : "reset"); + warnx(must, rescan ? "rescan" : "reset"); return (1); } - } else { - char name[30]; - int unit; - int fd = -1; - union ccb ccb; - - /* - * Note that resetting or rescanning a device used to - * require a bus or bus:target:lun. This is because the - * device in question may not exist and you're trying to - * get the controller to rescan to find it. It may also be - * because the device is hung / unresponsive, and opening - * an unresponsive device is not desireable. - * - * It can be more convenient to reference a device by - * peripheral name and unit number, though, and it is - * possible to get the bus:target:lun for devices that - * currently exist in the EDT. So this can work for - * devices that we want to reset, or devices that exist - * that we want to rescan, but not devices that do not - * exist yet. - * - * So, we are careful here to look up the bus/target/lun - * for the device the user wants to operate on, specified - * by peripheral instance (e.g. da0, pass32) without - * actually opening that device. The process is similar to - * what cam_lookup_pass() does, except that we don't - * actually open the passthrough driver instance in the end. - */ - - if (cam_get_device(tstr, name, sizeof(name), &unit) == -1) { - warnx("%s", cam_errbuf); - error = 1; - goto bailout; - } - - if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) { - warn("Unable to open %s", XPT_DEVICE); - error = 1; - goto bailout; - } - - bzero(&ccb, sizeof(ccb)); - - /* - * The function code isn't strictly necessary for the - * GETPASSTHRU ioctl. - */ - ccb.ccb_h.func_code = XPT_GDEVLIST; - - /* - * These two are necessary for the GETPASSTHRU ioctl to - * work. - */ - strlcpy(ccb.cgdl.periph_name, name, - sizeof(ccb.cgdl.periph_name)); - ccb.cgdl.unit_number = unit; - - /* - * Attempt to get the passthrough device. This ioctl will - * fail if the device name is null, if the device doesn't - * exist, or if the passthrough driver isn't in the kernel. - */ - if (ioctl(fd, CAMGETPASSTHRU, &ccb) == -1) { - warn("Unable to find bus:target:lun for device %s%d", - name, unit); - error = 1; - close(fd); - goto bailout; - } - if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - const struct cam_status_entry *entry; - - entry = cam_fetch_status_entry(ccb.ccb_h.status); - warnx("Unable to find bus:target_lun for device %s%d, " - "CAM status: %s (%#x)", name, unit, - entry ? entry->status_text : "Unknown", - ccb.ccb_h.status); - error = 1; - close(fd); - goto bailout; - } - - /* - * The kernel fills in the bus/target/lun. We don't - * need the passthrough device name and unit number since - * we aren't going to open it. - */ - bus = ccb.ccb_h.path_id; - target = ccb.ccb_h.target_id; - lun = ccb.ccb_h.target_lun; - - arglist |= CAM_ARG_BUS | CAM_ARG_TARGET | CAM_ARG_LUN; - - close(fd); } - if ((arglist & CAM_ARG_BUS) - && (arglist & CAM_ARG_TARGET) - && (arglist & CAM_ARG_LUN)) + if (arglist & CAM_ARG_LUN) error = scanlun_or_reset_dev(bus, target, lun, rescan); else error = rescan_or_reset_bus(bus, rescan); -bailout: - return (error); } @@ -5091,9 +5070,9 @@ camdebug(int argc, char **argv, char *combinedopt) path_id_t bus = CAM_BUS_WILDCARD; target_id_t target = CAM_TARGET_WILDCARD; lun_id_t lun = CAM_LUN_WILDCARD; - char *tstr, *tmpstr = NULL; + char *tstr; union ccb ccb; - int error = 0; + int error = 0, rv; bzero(&ccb, sizeof(union ccb)); @@ -5132,23 +5111,16 @@ camdebug(int argc, char **argv, char *combinedopt) } } - if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - warnx("error opening transport layer device %s", XPT_DEVICE); - warn("%s", XPT_DEVICE); - return (1); - } argc -= optind; argv += optind; if (argc <= 0) { warnx("you must specify \"off\", \"all\" or a bus,"); - warnx("bus:target, or bus:target:lun"); - close(fd); + warnx("bus:target, bus:target:lun or periph"); return (1); } tstr = *argv; - while (isspace(*tstr) && (*tstr != '\0')) tstr++; @@ -5157,66 +5129,54 @@ camdebug(int argc, char **argv, char *combinedopt) arglist &= ~(CAM_ARG_DEBUG_INFO|CAM_ARG_DEBUG_PERIPH| CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE| CAM_ARG_DEBUG_XPT|CAM_ARG_DEBUG_PROBE); - } else if (strncmp(tstr, "all", 3) != 0) { - tmpstr = (char *)strtok(tstr, ":"); - if ((tmpstr != NULL) && (*tmpstr != '\0')){ - bus = strtol(tmpstr, NULL, 0); - arglist |= CAM_ARG_BUS; - tmpstr = (char *)strtok(NULL, ":"); - if ((tmpstr != NULL) && (*tmpstr != '\0')){ - target = strtol(tmpstr, NULL, 0); - arglist |= CAM_ARG_TARGET; - tmpstr = (char *)strtok(NULL, ":"); - if ((tmpstr != NULL) && (*tmpstr != '\0')){ - lun = strtol(tmpstr, NULL, 0); - arglist |= CAM_ARG_LUN; - } - } - } else { - error = 1; + } else { + rv = parse_btl(tstr, &bus, &target, &lun, &arglist); + if (rv < 1) { warnx("you must specify \"all\", \"off\", or a bus,"); - warnx("bus:target, or bus:target:lun to debug"); + warnx("bus:target, bus:target:lun or periph to debug"); + return (1); } } - if (error == 0) { + if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { + warnx("error opening transport layer device %s", XPT_DEVICE); + warn("%s", XPT_DEVICE); + return (1); + } - ccb.ccb_h.func_code = XPT_DEBUG; - ccb.ccb_h.path_id = bus; - ccb.ccb_h.target_id = target; - ccb.ccb_h.target_lun = lun; + ccb.ccb_h.func_code = XPT_DEBUG; + ccb.ccb_h.path_id = bus; + ccb.ccb_h.target_id = target; + ccb.ccb_h.target_lun = lun; - if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - warn("CAMIOCOMMAND ioctl failed"); + if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { + warn("CAMIOCOMMAND ioctl failed"); + error = 1; + } else { + if ((ccb.ccb_h.status & CAM_STATUS_MASK) == + CAM_FUNC_NOTAVAIL) { + warnx("CAM debugging not available"); + warnx("you need to put options CAMDEBUG in" + " your kernel config file!"); error = 1; - } - - if (error == 0) { - if ((ccb.ccb_h.status & CAM_STATUS_MASK) == - CAM_FUNC_NOTAVAIL) { - warnx("CAM debugging not available"); - warnx("you need to put options CAMDEBUG in" - " your kernel config file!"); - error = 1; - } else if ((ccb.ccb_h.status & CAM_STATUS_MASK) != - CAM_REQ_CMP) { - warnx("XPT_DEBUG CCB failed with status %#x", - ccb.ccb_h.status); - error = 1; + } else if ((ccb.ccb_h.status & CAM_STATUS_MASK) != + CAM_REQ_CMP) { + warnx("XPT_DEBUG CCB failed with status %#x", + ccb.ccb_h.status); + error = 1; + } else { + if (ccb.cdbg.flags == CAM_DEBUG_NONE) { + fprintf(stderr, + "Debugging turned off\n"); } else { - if (ccb.cdbg.flags == CAM_DEBUG_NONE) { - fprintf(stderr, - "Debugging turned off\n"); - } else { - fprintf(stderr, - "Debugging enabled for " - "%d:%d:%jx\n", - bus, target, (uintmax_t)lun); - } + fprintf(stderr, + "Debugging enabled for " + "%d:%d:%jx\n", + bus, target, (uintmax_t)lun); } } - close(fd); } + close(fd); return (error); } @@ -9887,7 +9847,7 @@ usage(int printlong) " camcontrol smpphylist [dev_id][generic args][-l][-q]\n" " camcontrol smpmaninfo [dev_id][generic args][-l]\n" " camcontrol debug [-I][-P][-T][-S][-X][-c]\n" -" \n" +" \n" " camcontrol tags [dev_id][generic args] [-N tags] [-q] [-v]\n" " camcontrol negotiate [dev_id][generic args] [-a][-c]\n" " [-D ][-M mode][-O offset]\n" From owner-svn-src-all@freebsd.org Mon Jul 22 17:25: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 88041B6E1C; Mon, 22 Jul 2019 17:25:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 6B4028120D; Mon, 22 Jul 2019 17:25:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4616418930; Mon, 22 Jul 2019 17:25:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6MHPa2T019622; Mon, 22 Jul 2019 17:25:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MHPapH019621; Mon, 22 Jul 2019 17:25:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907221725.x6MHPapH019621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Jul 2019 17:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350215 - head/usr.sbin/mptutil X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/mptutil X-SVN-Commit-Revision: 350215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B4028120D 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.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: Mon, 22 Jul 2019 17:25:36 -0000 Author: emaste Date: Mon Jul 22 17:25:35 2019 New Revision: 350215 URL: https://svnweb.freebsd.org/changeset/base/350215 Log: mptutil: emit a warning on big-endian architectures It is known to be broken. PR: 162513 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/mptutil/mptutil.c Modified: head/usr.sbin/mptutil/mptutil.c ============================================================================== --- head/usr.sbin/mptutil/mptutil.c Mon Jul 22 17:08:18 2019 (r350214) +++ head/usr.sbin/mptutil/mptutil.c Mon Jul 22 17:25:35 2019 (r350215) @@ -114,6 +114,10 @@ main(int ac, char **av) if (ac == 0) usage(); +#if BYTE_ORDER == BIG_ENDIAN + warnx("mptutil is known to be broken on big-endian architectures"); +#endif + SET_FOREACH(cmd, MPT_DATASET(top)) { if (strcmp((*cmd)->name, av[0]) == 0) { if ((*cmd)->handler(ac, av)) From owner-svn-src-all@freebsd.org Mon Jul 22 18:11: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 8DE0DB7D57; Mon, 22 Jul 2019 18:11:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 6FDEE831A3; Mon, 22 Jul 2019 18:11:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B7FF1908F; Mon, 22 Jul 2019 18:11:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6MIBaHv046413; Mon, 22 Jul 2019 18:11:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MIBaXe046412; Mon, 22 Jul 2019 18:11:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907221811.x6MIBaXe046412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 22 Jul 2019 18:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350216 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 350216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6FDEE831A3 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_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, 22 Jul 2019 18:11:36 -0000 Author: tuexen Date: Mon Jul 22 18:11:35 2019 New Revision: 350216 URL: https://svnweb.freebsd.org/changeset/base/350216 Log: Wakeup the application when doing PD-API for unordered DATA chunks. Work done with rrs@. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Jul 22 17:25:35 2019 (r350215) +++ head/sys/netinet/sctp_indata.c Mon Jul 22 18:11:35 2019 (r350216) @@ -915,6 +915,9 @@ restart: break; } } + if (cnt_added && strm->pd_api_started) { + sctp_wakeup_the_read_socket(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); + } if ((control->length > pd_point) && (strm->pd_api_started == 0)) { strm->pd_api_started = 1; control->pdapi_started = 1; From owner-svn-src-all@freebsd.org Mon Jul 22 18:14: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 36D4DB7F44; Mon, 22 Jul 2019 18:14:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 180668353A; Mon, 22 Jul 2019 18:14:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5A31191E9; Mon, 22 Jul 2019 18:14:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6MIEYGv049965; Mon, 22 Jul 2019 18:14:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MIEYfD049964; Mon, 22 Jul 2019 18:14:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907221814.x6MIEYfD049964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Jul 2019 18:14:34 +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: r350217 - stable/11/sys/compat/freebsd32 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/compat/freebsd32 X-SVN-Commit-Revision: 350217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 180668353A 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,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, 22 Jul 2019 18:14:35 -0000 Author: emaste Date: Mon Jul 22 18:14:34 2019 New Revision: 350217 URL: https://svnweb.freebsd.org/changeset/base/350217 Log: Avoid kernel memory disclosure in freebsd32_ioctl_pciocgetconf This has been addressed in HEAD with other compat32 changes, but was not yet addressed in stable/11. admbugs: 797 Reported by: Ilja Van Sprundel Security: CVE-2019-5605 Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/compat/freebsd32/freebsd32_ioctl.c Modified: stable/11/sys/compat/freebsd32/freebsd32_ioctl.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_ioctl.c Mon Jul 22 18:11:35 2019 (r350216) +++ stable/11/sys/compat/freebsd32/freebsd32_ioctl.c Mon Jul 22 18:14:34 2019 (r350217) @@ -262,6 +262,8 @@ freebsd32_ioctl_pciocgetconf(struct thread *td, vm_offset_t addr; int error; + memset(&pmc, 0, sizeof(pmc)); + memset(&pc32, 0, sizeof(pc32)); if ((error = copyin(uap->data, &pci32, sizeof(pci32))) != 0) return (error); From owner-svn-src-all@freebsd.org Mon Jul 22 18:27: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 392C0B8686; Mon, 22 Jul 2019 18:27:18 +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 1AAFA83EE9; Mon, 22 Jul 2019 18:27:18 +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 E8AAB193E6; Mon, 22 Jul 2019 18:27:17 +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 x6MIRH2D055740; Mon, 22 Jul 2019 18:27:17 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MIRH79055739; Mon, 22 Jul 2019 18:27:17 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907221827.x6MIRH79055739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 22 Jul 2019 18:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350218 - head/lib/libproc X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libproc X-SVN-Commit-Revision: 350218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1AAFA83EE9 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.974,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, 22 Jul 2019 18:27:18 -0000 Author: brooks Date: Mon Jul 22 18:27:17 2019 New Revision: 350218 URL: https://svnweb.freebsd.org/changeset/base/350218 Log: Be consistent about temporary variable use in adjacent loops. Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Mon Jul 22 18:14:34 2019 (r350217) +++ head/lib/libproc/proc_sym.c Mon Jul 22 18:27:17 2019 (r350218) @@ -559,10 +559,11 @@ _proc_name2map(struct proc_handle *p, const char *name } /* If we didn't find a match, try matching prefixes of the basename. */ for (i = 0; i < p->nmappings; i++) { - strlcpy(path, p->mappings[i].map.pr_mapname, sizeof(path)); + mapping = &p->mappings[i]; + strlcpy(path, mapping->map.pr_mapname, sizeof(path)); base = basename(path); if (strncmp(base, name, len) == 0) - return (&p->mappings[i]); + return (mapping); } if (strcmp(name, "a.out") == 0) return (_proc_addr2map(p, From owner-svn-src-all@freebsd.org Mon Jul 22 18:42: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 24846B8BB3; Mon, 22 Jul 2019 18:42:56 +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 050608490A; Mon, 22 Jul 2019 18:42:56 +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 D189F1976F; Mon, 22 Jul 2019 18:42:55 +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 x6MIgtni067645; Mon, 22 Jul 2019 18:42:55 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MIgtLx067644; Mon, 22 Jul 2019 18:42:55 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907221842.x6MIgtLx067644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 22 Jul 2019 18:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350219 - head/contrib/netbsd-tests/lib/libc/regex X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libc/regex X-SVN-Commit-Revision: 350219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 050608490A 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.974,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, 22 Jul 2019 18:42:56 -0000 Author: lwhsu Date: Mon Jul 22 18:42:55 2019 New Revision: 350219 URL: https://svnweb.freebsd.org/changeset/base/350219 Log: Temporarily skip lib.libc.regex.exhaust_test.regcomp_too_big and lib.libregex.exhaust_test.regcomp_too_big on i386 as they are flakey on it PR: 237450 Sponsored by: The FreeBSD Foundation Modified: head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Modified: head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Mon Jul 22 18:27:17 2019 (r350218) +++ head/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Mon Jul 22 18:42:55 2019 (r350219) @@ -186,6 +186,10 @@ ATF_TC_BODY(regcomp_too_big, tc) int e; struct rlimit limit; +#if defined(__i386__) + atf_tc_skip("https://bugs.freebsd.org/237450"); +#endif + limit.rlim_cur = limit.rlim_max = 256 * 1024 * 1024; ATF_REQUIRE(setrlimit(RLIMIT_VMEM, &limit) != -1); From owner-svn-src-all@freebsd.org Mon Jul 22 18:43: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 CFB9FB8C34; Mon, 22 Jul 2019 18:43:47 +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 A667A84A67; Mon, 22 Jul 2019 18:43:47 +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 4CF7D19774; Mon, 22 Jul 2019 18:43:47 +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 x6MIhlwD067746; Mon, 22 Jul 2019 18:43:47 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MIhlXM067745; Mon, 22 Jul 2019 18:43:47 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907221843.x6MIhlXM067745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 22 Jul 2019 18:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350220 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 350220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A667A84A67 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.974,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, 22 Jul 2019 18:43:47 -0000 Author: lwhsu Date: Mon Jul 22 18:43:46 2019 New Revision: 350220 URL: https://svnweb.freebsd.org/changeset/base/350220 Log: Fix URL. Sponsored by: The FreeBSD Foundation 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 22 18:42:55 2019 (r350219) +++ head/tests/sys/kern/ptrace_test.c Mon Jul 22 18:43:46 2019 (r350220) @@ -867,7 +867,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelat pid_t children[2], fpid, wpid; int cpipe[2], status; - atf_tc_skip("https://bugs.freebsd.org/bug239292"); + atf_tc_skip("https://bugs.freebsd.org/239292"); ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((fpid = fork()) != -1); From owner-svn-src-all@freebsd.org Mon Jul 22 18:54: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 278DCB8E48; Mon, 22 Jul 2019 18:54:27 +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 018E484FFC; Mon, 22 Jul 2019 18:54:27 +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 CC57B19928; Mon, 22 Jul 2019 18:54: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 x6MIsQGK073463; Mon, 22 Jul 2019 18:54:26 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MIsQHB073461; Mon, 22 Jul 2019 18:54:26 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907221854.x6MIsQHB073461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 22 Jul 2019 18:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350221 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 350221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 018E484FFC 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.974,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, 22 Jul 2019 18:54:27 -0000 Author: lwhsu Date: Mon Jul 22 18:54:26 2019 New Revision: 350221 URL: https://svnweb.freebsd.org/changeset/base/350221 Log: Temporarily skip sys.netpfil.pf.forward.{v4,v6} and sys.netpfil.pf.set_tos.v4 on i386 as they are flakey on it PR: 239380 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netpfil/pf/forward.sh head/tests/sys/netpfil/pf/set_tos.sh Modified: head/tests/sys/netpfil/pf/forward.sh ============================================================================== --- head/tests/sys/netpfil/pf/forward.sh Mon Jul 22 18:43:46 2019 (r350220) +++ head/tests/sys/netpfil/pf/forward.sh Mon Jul 22 18:54:26 2019 (r350221) @@ -14,6 +14,10 @@ v4_head() v4_body() { + if [ `uname -p` = "i386" ]; then + atf_skip "https://bugs.freebsd.org/239380" + fi + pft_init epair_send=$(vnet_mkepair) @@ -73,6 +77,10 @@ v6_head() v6_body() { + if [ `uname -p` = "i386" ]; then + atf_skip "https://bugs.freebsd.org/239380" + fi + pft_init epair_send=$(vnet_mkepair) Modified: head/tests/sys/netpfil/pf/set_tos.sh ============================================================================== --- head/tests/sys/netpfil/pf/set_tos.sh Mon Jul 22 18:43:46 2019 (r350220) +++ head/tests/sys/netpfil/pf/set_tos.sh Mon Jul 22 18:54:26 2019 (r350221) @@ -14,6 +14,10 @@ v4_head() v4_body() { + if [ `uname -p` = "i386" ]; then + atf_skip "https://bugs.freebsd.org/239380" + fi + pft_init epair_send=$(vnet_mkepair) From owner-svn-src-all@freebsd.org Mon Jul 22 19:25: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 4CEF1B9CB6; Mon, 22 Jul 2019 19:25:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 F39A586F15; Mon, 22 Jul 2019 19:25:06 +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 7E90819EBA; Mon, 22 Jul 2019 19:25:06 +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 x6MJP6k4093412; Mon, 22 Jul 2019 19:25:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MJP6AR093411; Mon, 22 Jul 2019 19:25:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907221925.x6MJP6AR093411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 22 Jul 2019 19:25: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: r350222 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 350222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F39A586F15 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,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, 22 Jul 2019 19:25:07 -0000 Author: kib Date: Mon Jul 22 19:25:05 2019 New Revision: 350222 URL: https://svnweb.freebsd.org/changeset/base/350222 Log: MFC r350156: Fix leak of memory and file refs with sendmsg(2) over unix domain sockets. Approved by: so (insta-MFC) Modified: stable/12/sys/kern/uipc_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/uipc_usrreq.c ============================================================================== --- stable/12/sys/kern/uipc_usrreq.c Mon Jul 22 18:54:26 2019 (r350221) +++ stable/12/sys/kern/uipc_usrreq.c Mon Jul 22 19:25:05 2019 (r350222) @@ -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 Mon Jul 22 19:27: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 D4648BA172; Mon, 22 Jul 2019 19:27:24 +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 A7685872D7; Mon, 22 Jul 2019 19:27:24 +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 37CFF19ED2; Mon, 22 Jul 2019 19:27:24 +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 x6MJROgm093574; Mon, 22 Jul 2019 19:27:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MJROdB093573; Mon, 22 Jul 2019 19:27:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907221927.x6MJROdB093573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 22 Jul 2019 19:27: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: r350223 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 350223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7685872D7 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,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, 22 Jul 2019 19:27:24 -0000 Author: kib Date: Mon Jul 22 19:27:23 2019 New Revision: 350223 URL: https://svnweb.freebsd.org/changeset/base/350223 Log: MFC r350156: Fix leak of memory and file refs with sendmsg(2) over unix domain sockets. Approved by: so (insta-MFC) Modified: stable/11/sys/kern/uipc_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_usrreq.c ============================================================================== --- stable/11/sys/kern/uipc_usrreq.c Mon Jul 22 19:25:05 2019 (r350222) +++ stable/11/sys/kern/uipc_usrreq.c Mon Jul 22 19:27:23 2019 (r350223) @@ -1908,30 +1908,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; @@ -2082,6 +2105,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 Mon Jul 22 20:04: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 82A7BBAB1A; Mon, 22 Jul 2019 20:04:56 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 64D8088B61; Mon, 22 Jul 2019 20:04:56 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BB561A691; Mon, 22 Jul 2019 20:04:56 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6MK4uek016966; Mon, 22 Jul 2019 20:04:56 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MK4tUH016964; Mon, 22 Jul 2019 20:04:55 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201907222004.x6MK4tUH016964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 22 Jul 2019 20:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350224 - in head: sbin/mount share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: in head: sbin/mount share/man/man5 X-SVN-Commit-Revision: 350224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 64D8088B61 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.947,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, 22 Jul 2019 20:04:56 -0000 Author: sobomax Date: Mon Jul 22 20:04:55 2019 New Revision: 350224 URL: https://svnweb.freebsd.org/changeset/base/350224 Log: Allow "update" option to be used in the fstab(5). Document possible use case. Approved by: mckusick MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18586 Modified: head/sbin/mount/mount.c head/share/man/man5/fstab.5 Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Mon Jul 22 19:27:23 2019 (r350223) +++ head/sbin/mount/mount.c Mon Jul 22 20:04:55 2019 (r350224) @@ -361,6 +361,7 @@ main(int argc, char *argv[]) else failok = 0; if (!(init_flags & MNT_UPDATE) && + !hasopt(fs->fs_mntops, "update") && ismounted(fs, mntbuf, mntsize)) continue; options = update_options(options, fs->fs_mntops, Modified: head/share/man/man5/fstab.5 ============================================================================== --- head/share/man/man5/fstab.5 Mon Jul 22 19:27:23 2019 (r350223) +++ head/share/man/man5/fstab.5 Mon Jul 22 20:04:55 2019 (r350224) @@ -190,6 +190,32 @@ see the .Xr mount 8 manual page. .Pp +If the option +.Dq update +is specified, it indicates that the status of an already mounted file +system should be changed accordingly. +This allows, for example, file systems mounted read-only to be upgraded +read-write and vice-versa. +By default, an entry corresponding to a file systems that is already +mounted is going to be skipped over when processing +.Nm , +unless it's a root file system, in which case logic similar to +.Dq update +is applied automatically. +.Pp +The +.Dq update +option is typically used in conjuction with two +.Nm +files. +The first +.Nm +file is used to set up the initial set of file systems. +The second +.Nm +file is then run to update the initial set of file systems and +to add additional file systems. +.Pp The type of the mount is extracted from the .Fa fs_mntops field and stored separately in the From owner-svn-src-all@freebsd.org Mon Jul 22 20:11: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 B9796BAD16; Mon, 22 Jul 2019 20:11:35 +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 9BA4789159; Mon, 22 Jul 2019 20:11:35 +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 3778A1A816; Mon, 22 Jul 2019 20:11:35 +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 x6MKBZS0019558; Mon, 22 Jul 2019 20:11:35 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MKBYqW019551; Mon, 22 Jul 2019 20:11:34 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907222011.x6MKBYqW019551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 22 Jul 2019 20:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350225 - in head: sbin/ping6 usr.sbin/mld6query usr.sbin/traceroute6 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sbin/ping6 usr.sbin/mld6query usr.sbin/traceroute6 X-SVN-Commit-Revision: 350225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9BA4789159 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]; 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, 22 Jul 2019 20:11:35 -0000 Author: asomers Date: Mon Jul 22 20:11:33 2019 New Revision: 350225 URL: https://svnweb.freebsd.org/changeset/base/350225 Log: Remove the USE_RFC2292BIS option and reap dead code This option was imported as part of the KAME project in r62627 (in 2000). It was turned on unconditionally in r121472 (in 2003) and has been on ever since. The old alternative code has bitrotted. Reap the dead code. Reported by: Ján Sučan MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20938 Modified: head/sbin/ping6/Makefile head/sbin/ping6/ping6.c head/usr.sbin/mld6query/Makefile head/usr.sbin/mld6query/mld6.c head/usr.sbin/traceroute6/Makefile head/usr.sbin/traceroute6/traceroute6.c Modified: head/sbin/ping6/Makefile ============================================================================== --- head/sbin/ping6/Makefile Mon Jul 22 20:04:55 2019 (r350224) +++ head/sbin/ping6/Makefile Mon Jul 22 20:11:33 2019 (r350225) @@ -4,7 +4,7 @@ PACKAGE=runtime PROG= ping6 MAN= ping6.8 -CFLAGS+=-DIPSEC -DKAME_SCOPEID -DUSE_RFC2292BIS +CFLAGS+=-DIPSEC -DKAME_SCOPEID WARNS?= 3 BINOWN= root Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Mon Jul 22 20:04:55 2019 (r350224) +++ head/sbin/ping6/ping6.c Mon Jul 22 20:11:33 2019 (r350225) @@ -307,9 +307,7 @@ main(int argc, char *argv[]) #endif int usepktinfo = 0; struct in6_pktinfo *pktinfo = NULL; -#ifdef USE_RFC2292BIS struct ip6_rthdr *rthdr = NULL; -#endif #ifdef IPSEC_POLICY_IPSEC char *policy_in = NULL; char *policy_out = NULL; @@ -902,11 +900,8 @@ main(int argc, char *argv[]) if (argc > 1) { /* some intermediate addrs are specified */ int hops; -#ifdef USE_RFC2292BIS int rthdrlen; -#endif -#ifdef USE_RFC2292BIS rthdrlen = inet6_rth_space(IPV6_RTHDR_TYPE_0, argc - 1); scmsgp->cmsg_len = CMSG_LEN(rthdrlen); scmsgp->cmsg_level = IPPROTO_IPV6; @@ -916,11 +911,6 @@ main(int argc, char *argv[]) IPV6_RTHDR_TYPE_0, argc - 1); if (rthdr == NULL) errx(1, "can't initialize rthdr"); -#else /* old advanced API */ - if ((scmsgp = (struct cmsghdr *)inet6_rthdr_init(scmsgp, - IPV6_RTHDR_TYPE_0)) == NULL) - errx(1, "can't initialize rthdr"); -#endif /* USE_RFC2292BIS */ for (hops = 0; hops < argc - 1; hops++) { memset(&hints, 0, sizeof(hints)); @@ -933,22 +923,11 @@ main(int argc, char *argv[]) errx(1, "bad addr family of an intermediate addr"); sin6 = (struct sockaddr_in6 *)(void *)res->ai_addr; -#ifdef USE_RFC2292BIS if (inet6_rth_add(rthdr, &sin6->sin6_addr)) errx(1, "can't add an intermediate node"); -#else /* old advanced API */ - if (inet6_rthdr_add(scmsg, &sin6->sin6_addr, - IPV6_RTHDR_LOOSE)) - errx(1, "can't add an intermediate node"); -#endif /* USE_RFC2292BIS */ freeaddrinfo(res); } -#ifndef USE_RFC2292BIS - if (inet6_rthdr_lasthop(scmsgp, IPV6_RTHDR_LOOSE)) - errx(1, "can't set the last flag"); -#endif - scmsgp = CMSG_NXTHDR(&smsghdr, scmsgp); } @@ -968,7 +947,6 @@ main(int argc, char *argv[]) src.sin6_port = ntohs(DUMMY_PORT); src.sin6_scope_id = dst.sin6_scope_id; -#ifdef USE_RFC2292BIS if (pktinfo && setsockopt(dummy, IPPROTO_IPV6, IPV6_PKTINFO, (void *)pktinfo, sizeof(*pktinfo))) @@ -988,12 +966,6 @@ main(int argc, char *argv[]) setsockopt(dummy, IPPROTO_IPV6, IPV6_RTHDR, (void *)rthdr, (rthdr->ip6r_len + 1) << 3)) err(1, "UDP setsockopt(IPV6_RTHDR)"); -#else /* old advanced API */ - if (smsghdr.msg_control && - setsockopt(dummy, IPPROTO_IPV6, IPV6_PKTOPTIONS, - (void *)smsghdr.msg_control, smsghdr.msg_controllen)) - err(1, "UDP setsockopt(IPV6_PKTOPTIONS)"); -#endif if (connect(dummy, (struct sockaddr *)&src, len) < 0) err(1, "UDP connect"); @@ -1785,7 +1757,6 @@ pr_exthdrs(struct msghdr *mhdr) } } -#ifdef USE_RFC2292BIS static void pr_ip6opt(void *extbuf, size_t bufsize) { @@ -1847,17 +1818,7 @@ pr_ip6opt(void *extbuf, size_t bufsize) } return; } -#else /* !USE_RFC2292BIS */ -/* ARGSUSED */ -static void -pr_ip6opt(void *extbuf, size_t bufsize __unused) -{ - putchar('\n'); - return; -} -#endif /* USE_RFC2292BIS */ -#ifdef USE_RFC2292BIS static void pr_rthdr(void *extbuf, size_t bufsize) { @@ -1912,16 +1873,6 @@ pr_rthdr(void *extbuf, size_t bufsize) return; } - -#else /* !USE_RFC2292BIS */ -/* ARGSUSED */ -static void -pr_rthdr(void *extbuf, size_t bufsize __unused) -{ - putchar('\n'); - return; -} -#endif /* USE_RFC2292BIS */ static int pr_bitrange(u_int32_t v, int soff, int ii) Modified: head/usr.sbin/mld6query/Makefile ============================================================================== --- head/usr.sbin/mld6query/Makefile Mon Jul 22 20:04:55 2019 (r350224) +++ head/usr.sbin/mld6query/Makefile Mon Jul 22 20:11:33 2019 (r350225) @@ -18,7 +18,7 @@ PROG= mld6query MAN= mld6query.8 SRCS= mld6.c -CFLAGS+= -DIPSEC -DUSE_RFC2292BIS +CFLAGS+= -DIPSEC WARNS?= 2 Modified: head/usr.sbin/mld6query/mld6.c ============================================================================== --- head/usr.sbin/mld6query/mld6.c Mon Jul 22 20:04:55 2019 (r350224) +++ head/usr.sbin/mld6query/mld6.c Mon Jul 22 20:11:33 2019 (r350225) @@ -203,12 +203,8 @@ make_msg(int index, struct in6_addr *addr, u_int type, static struct iovec iov[2]; static u_char *cmsgbuf; int cmsglen, hbhlen = 0; -#ifdef USE_RFC2292BIS void *hbhbuf = NULL, *optp = NULL; int currentlen; -#else - u_int8_t raopt[IP6OPT_RTALERT_LEN]; -#endif struct in6_pktinfo *pi; struct cmsghdr *cmsgp; u_short rtalert_code = htons(IP6OPT_RTALERT_MLD); @@ -253,7 +249,6 @@ make_msg(int index, struct in6_addr *addr, u_int type, src.s6_addr[2] = src.s6_addr[3] = 0; #endif -#ifdef USE_RFC2292BIS if ((hbhlen = inet6_opt_init(NULL, 0)) == -1) errx(1, "inet6_opt_init(0) failed"); if ((hbhlen = inet6_opt_append(NULL, 0, hbhlen, IP6OPT_ROUTER_ALERT, 2, @@ -262,11 +257,6 @@ make_msg(int index, struct in6_addr *addr, u_int type, if ((hbhlen = inet6_opt_finish(NULL, 0, hbhlen)) == -1) errx(1, "inet6_opt_finish(0) failed"); cmsglen = CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(hbhlen); -#else - hbhlen = sizeof(raopt); - cmsglen = CMSG_SPACE(sizeof(struct in6_pktinfo)) + - inet6_option_space(hbhlen); -#endif if ((cmsgbuf = malloc(cmsglen)) == NULL) errx(1, "can't allocate enough memory for cmsg"); @@ -282,7 +272,6 @@ make_msg(int index, struct in6_addr *addr, u_int type, memcpy(&pi->ipi6_addr, &src, sizeof(pi->ipi6_addr)); /* specifiy to insert router alert option in a hop-by-hop opt hdr. */ cmsgp = CMSG_NXTHDR(&m, cmsgp); -#ifdef USE_RFC2292BIS cmsgp->cmsg_len = CMSG_LEN(hbhlen); cmsgp->cmsg_level = IPPROTO_IPV6; cmsgp->cmsg_type = IPV6_HOPOPTS; @@ -297,15 +286,6 @@ make_msg(int index, struct in6_addr *addr, u_int type, (void)inet6_opt_set_val(optp, 0, &rtalert_code, sizeof(rtalert_code)); if ((currentlen = inet6_opt_finish(hbhbuf, hbhlen, currentlen)) == -1) errx(1, "inet6_opt_finish(buf) failed"); -#else /* old advanced API */ - if (inet6_option_init((void *)cmsgp, &cmsgp, IPV6_HOPOPTS)) - errx(1, "inet6_option_init failed\n"); - raopt[0] = IP6OPT_ROUTER_ALERT; - raopt[1] = IP6OPT_RTALERT_LEN - 2; - memcpy(&raopt[2], (caddr_t)&rtalert_code, sizeof(u_short)); - if (inet6_option_append(cmsgp, raopt, 4, 0)) - errx(1, "inet6_option_append failed\n"); -#endif } void Modified: head/usr.sbin/traceroute6/Makefile ============================================================================== --- head/usr.sbin/traceroute6/Makefile Mon Jul 22 20:04:55 2019 (r350224) +++ head/usr.sbin/traceroute6/Makefile Mon Jul 22 20:11:33 2019 (r350225) @@ -22,7 +22,7 @@ SRCS= as.c traceroute6.c BINOWN= root BINMODE= 4555 -CFLAGS+= -DIPSEC -DUSE_RFC2292BIS -DHAVE_POLL +CFLAGS+= -DIPSEC -DHAVE_POLL CFLAGS+= -I${.CURDIR} -I${TRACEROUTE_DISTDIR} -I. WARNS?= 3 Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Mon Jul 22 20:04:55 2019 (r350224) +++ head/usr.sbin/traceroute6/traceroute6.c Mon Jul 22 20:11:33 2019 (r350225) @@ -331,9 +331,7 @@ u_long datalen = 20; /* How much data */ #define ICMP6ECHOLEN 8 /* XXX: 2064 = 127(max hops in type 0 rthdr) * sizeof(ip6_hdr) + 16(margin) */ char rtbuf[2064]; -#ifdef USE_RFC2292BIS struct ip6_rthdr *rth; -#endif struct cmsghdr *cmsg; char *source = NULL; @@ -435,7 +433,6 @@ main(int argc, char *argv[]) "traceroute6: unknown host %s\n", optarg); exit(1); } -#ifdef USE_RFC2292BIS if (rth == NULL) { /* * XXX: We can't detect the number of @@ -456,12 +453,6 @@ main(int argc, char *argv[]) optarg); exit(1); } -#else /* old advanced API */ - if (cmsg == NULL) - cmsg = inet6_rthdr_init(rtbuf, IPV6_RTHDR_TYPE_0); - inet6_rthdr_add(cmsg, (struct in6_addr *)hp->h_addr, - IPV6_RTHDR_LOOSE); -#endif freehostent(hp); break; case 'I': @@ -763,7 +754,6 @@ main(int argc, char *argv[]) if (options & SO_DONTROUTE) (void) setsockopt(sndsock, SOL_SOCKET, SO_DONTROUTE, (char *)&on, sizeof(on)); -#ifdef USE_RFC2292BIS if (rth) {/* XXX: there is no library to finalize the header... */ rth->ip6r_len = rth->ip6r_segleft * 2; if (setsockopt(sndsock, IPPROTO_IPV6, IPV6_RTHDR, @@ -773,17 +763,6 @@ main(int argc, char *argv[]) exit(1); } } -#else /* old advanced API */ - if (cmsg != NULL) { - inet6_rthdr_lasthop(cmsg, IPV6_RTHDR_LOOSE); - if (setsockopt(sndsock, IPPROTO_IPV6, IPV6_PKTOPTIONS, - rtbuf, cmsg->cmsg_len) < 0) { - fprintf(stderr, "setsockopt(IPV6_PKTOPTIONS): %s\n", - strerror(errno)); - exit(1); - } - } -#endif /* USE_RFC2292BIS */ #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC /* From owner-svn-src-all@freebsd.org Mon Jul 22 20:33: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 17086BB529; Mon, 22 Jul 2019 20:33:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 ED0F58A068; Mon, 22 Jul 2019 20:33:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE18B1AC45; Mon, 22 Jul 2019 20:33:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6MKXJn1034697; Mon, 22 Jul 2019 20:33:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MKXJXk034696; Mon, 22 Jul 2019 20:33:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907222033.x6MKXJXk034696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Jul 2019 20:33: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: r350226 - stable/11/sys/dev/nand X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/dev/nand X-SVN-Commit-Revision: 350226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ED0F58A068 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,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, 22 Jul 2019 20:33:20 -0000 Author: emaste Date: Mon Jul 22 20:33:19 2019 New Revision: 350226 URL: https://svnweb.freebsd.org/changeset/base/350226 Log: MFS12 r350205: nand: create device with 0640 permission rw-r----- is the usual/standard permissions for such devices. Merge of direct commit to stable/12 as this code has been removed in HEAD. Note that the NAND subsystem is not built by default. Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/dev/nand/nand_cdev.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/nand/nand_cdev.c ============================================================================== --- stable/11/sys/dev/nand/nand_cdev.c Mon Jul 22 20:11:33 2019 (r350225) +++ stable/11/sys/dev/nand/nand_cdev.c Mon Jul 22 20:33:19 2019 (r350226) @@ -99,7 +99,7 @@ nand_make_dev(struct nand_chip *chip) parent_unit = device_get_unit(parent); unit = parent_unit * 4 + chip->num; chip->cdev = make_dev(&nand_cdevsw, unit, UID_ROOT, GID_WHEEL, - 0666, "%s%d.%d", name, parent_unit, chip->num); + 0640, "%s%d.%d", name, parent_unit, chip->num); if (chip->cdev == NULL) return (ENXIO); From owner-svn-src-all@freebsd.org Mon Jul 22 21:03: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 59AB4BBE69; Mon, 22 Jul 2019 21:03:53 +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 3A2518B292; Mon, 22 Jul 2019 21:03:53 +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 150171B1C6; Mon, 22 Jul 2019 21:03:53 +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 x6ML3qPZ052522; Mon, 22 Jul 2019 21:03:52 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6ML3qbL052521; Mon, 22 Jul 2019 21:03:52 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907222103.x6ML3qbL052521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 22 Jul 2019 21:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350227 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A2518B292 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.961,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, 22 Jul 2019 21:03:53 -0000 Author: asomers Date: Mon Jul 22 21:03:52 2019 New Revision: 350227 URL: https://svnweb.freebsd.org/changeset/base/350227 Log: [skip ci] Fix the comment for cache_purge(9) This is a merge of r348738 from projects/fuse2 Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Jul 22 20:33:19 2019 (r350226) +++ head/sys/kern/vfs_cache.c Mon Jul 22 21:03:52 2019 (r350227) @@ -1964,7 +1964,7 @@ cache_changesize(int newmaxvnodes) } /* - * Invalidate all entries to a particular vnode. + * Invalidate all entries from and to a particular vnode. */ void cache_purge(struct vnode *vp) From owner-svn-src-all@freebsd.org Mon Jul 22 21:07: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 7E382BBF75; Mon, 22 Jul 2019 21:07:59 +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 602AA8B4DB; Mon, 22 Jul 2019 21:07:59 +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 360F31B1C8; Mon, 22 Jul 2019 21:07:59 +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 x6ML7xk2052780; Mon, 22 Jul 2019 21:07:59 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6ML7xdL052779; Mon, 22 Jul 2019 21:07:59 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907222107.x6ML7xdL052779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 22 Jul 2019 21:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350228 - head/sys/cam/ata X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/cam/ata X-SVN-Commit-Revision: 350228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 602AA8B4DB 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.961,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, 22 Jul 2019 21:07:59 -0000 Author: brooks Date: Mon Jul 22 21:07:58 2019 New Revision: 350228 URL: https://svnweb.freebsd.org/changeset/base/350228 Log: ata_xpt: Use the correct union member when accessing valid. In principle this should not matter as it's a union and they point to the same memory location but based on the code above we should be accessing .sata and not .ata. Submitted by: arichardson Reviewed by: scottl, imp Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21002 Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Mon Jul 22 21:03:52 2019 (r350227) +++ head/sys/cam/ata/ata_xpt.c Mon Jul 22 21:07:58 2019 (r350228) @@ -452,7 +452,7 @@ negotiate: if (cts.xport_specific.ata.valid & CTS_ATA_VALID_MODE) mode = cts.xport_specific.ata.mode; } else { - if (cts.xport_specific.ata.valid & CTS_SATA_VALID_MODE) + if (cts.xport_specific.sata.valid & CTS_SATA_VALID_MODE) mode = cts.xport_specific.sata.mode; } /* If SIM disagree - renegotiate. */ From owner-svn-src-all@freebsd.org Mon Jul 22 21:53: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 81DA7BD707; Mon, 22 Jul 2019 21:53:59 +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 63E298D553; Mon, 22 Jul 2019 21:53:59 +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 3E5981BA9E; Mon, 22 Jul 2019 21:53:59 +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 x6MLrxEG082200; Mon, 22 Jul 2019 21:53:59 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MLrxDk082199; Mon, 22 Jul 2019 21:53:59 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907222153.x6MLrxDk082199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 22 Jul 2019 21:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350229 - head/sys/arm/ti X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/ti X-SVN-Commit-Revision: 350229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 63E298D553 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_LONG(-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] 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, 22 Jul 2019 21:53:59 -0000 Author: manu Date: Mon Jul 22 21:53:58 2019 New Revision: 350229 URL: https://svnweb.freebsd.org/changeset/base/350229 Log: arm: ti: Get the hwmods property from the parent node Since the Linux 5.0 dts the ti,hwmods property is on the parent ti.sysc node. Modified: head/sys/arm/ti/ti_hwmods.c Modified: head/sys/arm/ti/ti_hwmods.c ============================================================================== --- head/sys/arm/ti/ti_hwmods.c Mon Jul 22 21:07:58 2019 (r350228) +++ head/sys/arm/ti/ti_hwmods.c Mon Jul 22 21:53:58 2019 (r350229) @@ -110,7 +110,7 @@ ti_hwmods_get_clock(device_t dev) if ((node = ofw_bus_get_node(dev)) == 0) return (INVALID_CLK_IDENT); - if ((len = OF_getprop_alloc(node, "ti,hwmods", (void**)&name)) <= 0) + if ((len = OF_getprop_alloc(OF_parent(node), "ti,hwmods", (void**)&name)) <= 0) return (INVALID_CLK_IDENT); buf = name; @@ -148,7 +148,7 @@ int ti_hwmods_contains(device_t dev, const char *hwmod if ((node = ofw_bus_get_node(dev)) == 0) return (0); - if ((len = OF_getprop_alloc(node, "ti,hwmods", (void**)&name)) <= 0) + if ((len = OF_getprop_alloc(OF_parent(node), "ti,hwmods", (void**)&name)) <= 0) return (0); buf = name; @@ -182,7 +182,7 @@ ti_hwmods_get_unit(device_t dev, const char *hwmod) if ((node = ofw_bus_get_node(dev)) == 0) return (0); - if ((len = OF_getprop_alloc(node, "ti,hwmods", (void**)&name)) <= 0) + if ((len = OF_getprop_alloc(OF_parent(node), "ti,hwmods", (void**)&name)) <= 0) return (0); buf = name; From owner-svn-src-all@freebsd.org Mon Jul 22 21:55: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 7DF25BD7B1; Mon, 22 Jul 2019 21:55:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 578418D6F3; Mon, 22 Jul 2019 21:55:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A4141BAA2; Mon, 22 Jul 2019 21:55:34 +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 x6MLtYlZ082355; Mon, 22 Jul 2019 21:55:34 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MLtXpR082353; Mon, 22 Jul 2019 21:55:33 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907222155.x6MLtXpR082353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 22 Jul 2019 21:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350230 - head/sys/arm/ti X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/ti X-SVN-Commit-Revision: 350230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 578418D6F3 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]; 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, 22 Jul 2019 21:55:34 -0000 Author: manu Date: Mon Jul 22 21:55:33 2019 New Revision: 350230 URL: https://svnweb.freebsd.org/changeset/base/350230 Log: arm: ti: Add a driver for ti,sysc bus ti,sysc is a simple-bus like driver. Add a driver for it so child nodes can attach. Added: head/sys/arm/ti/ti_sysc.c (contents, props changed) Modified: head/sys/arm/ti/files.ti Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Mon Jul 22 21:53:58 2019 (r350229) +++ head/sys/arm/ti/files.ti Mon Jul 22 21:55:33 2019 (r350230) @@ -16,6 +16,7 @@ arm/ti/ti_gpio_if.m optional gpio arm/ti/ti_i2c.c optional ti_i2c arm/ti/ti_sdhci.c optional sdhci arm/ti/ti_spi.c optional ti_spi +arm/ti/ti_sysc.c standard dev/uart/uart_dev_ti8250.c optional uart dev/uart/uart_dev_ns8250.c optional uart Added: head/sys/arm/ti/ti_sysc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/ti_sysc.c Mon Jul 22 21:55:33 2019 (r350230) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +static struct ofw_compat_data compat_data[] = { + { "ti,sysc", 1 }, + { NULL, 0 } +}; + +struct ti_sysc_softc { + struct simplebus_softc sc; + device_t dev; +}; + +static int ti_sysc_probe(device_t dev); +static int ti_sysc_attach(device_t dev); +static int ti_sysc_detach(device_t dev); + +static int +ti_sysc_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, "TI SYSC Interconnect"); + return (BUS_PROBE_DEFAULT); +} + +static int +ti_sysc_attach(device_t dev) +{ + struct ti_sysc_softc *sc; + device_t cdev; + phandle_t node, child; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + simplebus_init(dev, node); + if (simplebus_fill_ranges(node, &sc->sc) < 0) { + device_printf(dev, "could not get ranges\n"); + return (ENXIO); + } + + for (child = OF_child(node); child > 0; child = OF_peer(child)) { + cdev = simplebus_add_device(dev, child, 0, NULL, -1, NULL); + if (cdev != NULL) + device_probe_and_attach(cdev); + } + + return (bus_generic_attach(dev)); +} + +static int +ti_sysc_detach(device_t dev) +{ + + return (EBUSY); +} + +static device_method_t ti_sysc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ti_sysc_probe), + DEVMETHOD(device_attach, ti_sysc_attach), + DEVMETHOD(device_detach, ti_sysc_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(ti_sysc, ti_sysc_driver, ti_sysc_methods, + sizeof(struct ti_sysc_softc), simplebus_driver); + +static devclass_t ti_sysc_devclass; + +EARLY_DRIVER_MODULE(ti_sysc, simplebus, ti_sysc_driver, +ti_sysc_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_FIRST); From owner-svn-src-all@freebsd.org Mon Jul 22 22:41: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 85CB1BE353; Mon, 22 Jul 2019 22:41:45 +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 651B68EF7A; Mon, 22 Jul 2019 22:41:45 +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 36C281C32D; Mon, 22 Jul 2019 22:41:45 +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 x6MMfipZ010233; Mon, 22 Jul 2019 22:41:44 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MMfiOk010232; Mon, 22 Jul 2019 22:41:44 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201907222241.x6MMfiOk010232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 22 Jul 2019 22:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350231 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 350231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 651B68EF7A 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: Mon, 22 Jul 2019 22:41:45 -0000 Author: ian Date: Mon Jul 22 22:41:44 2019 New Revision: 350231 URL: https://svnweb.freebsd.org/changeset/base/350231 Log: Correct spelling, partion -> partition. Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Mon Jul 22 21:55:33 2019 (r350230) +++ head/sys/dev/mmc/mmcsd.c Mon Jul 22 22:41:44 2019 (r350231) @@ -575,7 +575,7 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, con speed / 1000000, (speed / 100000) % 10, mmcsd_bus_bit_width(dev), sc->max_data); } else if (type == EXT_CSD_PART_CONFIG_ACC_RPMB) { - printf("%s: %ju%sB partion %d%s at %s\n", part->name, bytes, + printf("%s: %ju%sB partition %d%s at %s\n", part->name, bytes, unit, type, ro ? " (read-only)" : "", device_get_nameunit(dev)); } else { @@ -611,12 +611,12 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, con } } if (ext == NULL) - printf("%s%d: %ju%sB partion %d%s%s at %s\n", + printf("%s%d: %ju%sB partition %d%s%s at %s\n", part->name, cnt, bytes, unit, type, enh ? " enhanced" : "", ro ? " (read-only)" : "", device_get_nameunit(dev)); else - printf("%s%d: %ju%sB partion %d extended 0x%x " + printf("%s%d: %ju%sB partition %d extended 0x%x " "(%s)%s at %s\n", part->name, cnt, bytes, unit, type, extattr, ext, ro ? " (read-only)" : "", device_get_nameunit(dev)); From owner-svn-src-all@freebsd.org Mon Jul 22 22:59: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 B9ED2BE9CF; Mon, 22 Jul 2019 22:59:51 +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 988AF8FA88; Mon, 22 Jul 2019 22:59:51 +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 611921C558; Mon, 22 Jul 2019 22:59:51 +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 x6MMxpnH017952; Mon, 22 Jul 2019 22:59:51 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MMxpJP017951; Mon, 22 Jul 2019 22:59:51 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907222259.x6MMxpJP017951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 22 Jul 2019 22:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350232 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 350232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 988AF8FA88 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.953,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, 22 Jul 2019 22:59:51 -0000 Author: jhibbits Date: Mon Jul 22 22:59:50 2019 New Revision: 350232 URL: https://svnweb.freebsd.org/changeset/base/350232 Log: powerpc: Unbreak 64-bit pmap from 350206 oldpvo is never explicitly NULL'd by moea64_pvo_enter(), so don't check for NULL to do anything, only check error. PR: 239372 Reported by: Francis Little Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Jul 22 22:41:44 2019 (r350231) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Jul 22 22:59:50 2019 (r350232) @@ -1449,13 +1449,13 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, v KASSERT(oldpvo->pvo_pmap == pmap, ("pmap of old " "mapping does not match new mapping")); moea64_pvo_remove_from_pmap(mmu, oldpvo); - error = moea64_pvo_enter(mmu, pvo, pvo_head, NULL); + moea64_pvo_enter(mmu, pvo, pvo_head, NULL); } PV_PAGE_UNLOCK(m); PMAP_UNLOCK(pmap); /* Free any dead pages */ - if (oldpvo != NULL) { + if (error == EEXIST) { moea64_pvo_remove_from_page(mmu, oldpvo); free_pvo_entry(oldpvo); } @@ -2521,8 +2521,6 @@ moea64_pvo_enter(mmu_t mmu, struct pvo_entry *pvo, str struct pvo_entry *old_pvo; PMAP_LOCK_ASSERT(pvo->pvo_pmap, MA_OWNED); - KASSERT(moea64_pvo_find_va(pvo->pvo_pmap, PVO_VADDR(pvo)) == NULL, - ("Existing mapping for VA %#jx", (uintmax_t)PVO_VADDR(pvo))); moea64_pvo_enter_calls++; From owner-svn-src-all@freebsd.org Tue Jul 23 02: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 7CA8CC1BE6; Tue, 23 Jul 2019 02:11:15 +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 5FBF66F5C0; Tue, 23 Jul 2019 02:11:15 +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 39A5C1E809; Tue, 23 Jul 2019 02:11:15 +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 x6N2BFwK035844; Tue, 23 Jul 2019 02:11:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6N2BECT035841; Tue, 23 Jul 2019 02:11:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201907230211.x6N2BECT035841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 23 Jul 2019 02:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350233 - head/sys/cam/ata X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ata X-SVN-Commit-Revision: 350233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FBF66F5C0 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.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: Tue, 23 Jul 2019 02:11:15 -0000 Author: mav Date: Tue Jul 23 02:11:14 2019 New Revision: 350233 URL: https://svnweb.freebsd.org/changeset/base/350233 Log: Make CAM ATA stack handle disk resizes. While for ATA disks resize is even more rare situation than for SCSI, it may happen in case of HPA or AMA being used. Make ATA XPT report minor IDENTIFY DATA change to upper layers with AC_GETDEV_CHANGED, and ada(4) periph driver handle that event, recalculating all the disk properties and signalling resize to GEOM. Since ATA has no mechanism of UNIT ATTENTIONs, like SCSI, it has no way to detect that something has changed. That is why this functionality depends on explicit reprobe via XPT_REPROBE_LUN call. MFC after: 2 weeks Relnotes: yes Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Jul 22 22:59:50 2019 (r350232) +++ head/sys/cam/ata/ata_da.c Tue Jul 23 02:11:14 2019 (r350233) @@ -248,8 +248,9 @@ struct ada_softc { int periodic_read_error; int periodic_read_count; #endif - struct disk_params params; - struct disk *disk; + struct ccb_pathinq cpi; + struct disk_params params; + struct disk *disk; struct task sysctl_task; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -807,6 +808,8 @@ static void adasysctlinit(void *context, int pending) static int adagetattr(struct bio *bp); static void adasetflags(struct ada_softc *softc, struct ccb_getdev *cgd); +static void adasetgeom(struct ada_softc *softc, + struct ccb_getdev *cgd); static periph_ctor_t adaregister; static void ada_dsmtrim(struct ada_softc *softc, struct bio *bp, struct ccb_ataio *ataio); @@ -822,8 +825,6 @@ static void adadone(struct cam_periph *periph, union ccb *done_ccb); static int adaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); -static void adagetparams(struct cam_periph *periph, - struct ccb_getdev *cgd); static timeout_t adasendorderedtag; static void adashutdown(void *arg, int howto); static void adasuspend(void *arg); @@ -1307,9 +1308,11 @@ adaasync(void *callback_arg, u_int32_t code, xpt_action((union ccb *)&cgd); /* - * Set/clear support flags based on the new Identify data. + * Update our information based on the new Identify data. */ adasetflags(softc, &cgd); + adasetgeom(softc, &cgd); + disk_resize(softc->disk, M_NOWAIT); cam_periph_async(periph, code, path, arg); break; @@ -1645,7 +1648,8 @@ adasetflags(struct ada_softc *softc, struct ccb_getdev softc->flags &= ~ADA_FLAG_CAN_NCQ; if ((cgd->ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) && - (cgd->inq_flags & SID_DMA)) { + (cgd->inq_flags & SID_DMA) && + (softc->quirks & ADA_Q_NO_TRIM) == 0) { softc->flags |= ADA_FLAG_CAN_TRIM; softc->trim_max_ranges = TRIM_MAX_RANGES; if (cgd->ident_data.max_dsm_blocks != 0) { @@ -1713,13 +1717,11 @@ static cam_status adaregister(struct cam_periph *periph, void *arg) { struct ada_softc *softc; - struct ccb_pathinq cpi; struct ccb_getdev *cgd; struct disk_params *dp; struct sbuf sb; char *announce_buf; caddr_t match; - u_int maxio; int quirks; cgd = (struct ccb_getdev *)arg; @@ -1748,6 +1750,7 @@ adaregister(struct cam_periph *periph, void *arg) } periph->softc = softc; + xpt_path_inq(&softc->cpi, periph->path); /* * See if this device has any quirks. @@ -1761,8 +1764,6 @@ adaregister(struct cam_periph *periph, void *arg) else softc->quirks = ADA_Q_NONE; - xpt_path_inq(&cpi, periph->path); - TASK_INIT(&softc->sysctl_task, 0, adasysctlinit, periph); /* @@ -1788,6 +1789,8 @@ adaregister(struct cam_periph *periph, void *arg) * Set support flags based on the Identify data and quirks. */ adasetflags(softc, cgd); + if (softc->cpi.hba_misc & PIM_ATA_EXT) + softc->flags |= ADA_FLAG_PIM_ATA_EXT; /* Disable queue sorting for non-rotational media by default. */ if (cgd->ident_data.media_rotation_rate == ATA_RATE_NON_ROTATING) { @@ -1796,14 +1799,13 @@ adaregister(struct cam_periph *periph, void *arg) softc->rotating = 1; } cam_iosched_set_sort_queue(softc->cam_iosched, softc->rotating ? -1 : 0); - adagetparams(periph, cgd); softc->disk = disk_alloc(); - softc->disk->d_rotation_rate = cgd->ident_data.media_rotation_rate; + adasetgeom(softc, cgd); softc->disk->d_devstat = devstat_new_entry(periph->periph_name, periph->unit_number, softc->params.secsize, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT | - XPORT_DEVSTAT_TYPE(cpi.transport), + XPORT_DEVSTAT_TYPE(softc->cpi.transport), DEVSTAT_PRIORITY_DISK); softc->disk->d_open = adaopen; softc->disk->d_close = adaclose; @@ -1813,70 +1815,8 @@ adaregister(struct cam_periph *periph, void *arg) softc->disk->d_gone = adadiskgonecb; softc->disk->d_name = "ada"; softc->disk->d_drv1 = periph; - maxio = cpi.maxio; /* Honor max I/O size of SIM */ - if (maxio == 0) - maxio = DFLTPHYS; /* traditional default */ - else if (maxio > MAXPHYS) - maxio = MAXPHYS; /* for safety */ - if (softc->flags & ADA_FLAG_CAN_48BIT) - maxio = min(maxio, 65536 * softc->params.secsize); - else /* 28bit ATA command limit */ - maxio = min(maxio, 256 * softc->params.secsize); - if (softc->quirks & ADA_Q_128KB) - maxio = min(maxio, 128 * 1024); - softc->disk->d_maxsize = maxio; softc->disk->d_unit = periph->unit_number; - softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; - if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) - softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; - /* Device lies about TRIM capability. */ - if ((softc->quirks & ADA_Q_NO_TRIM) && - (softc->flags & ADA_FLAG_CAN_TRIM)) - softc->flags &= ~ADA_FLAG_CAN_TRIM; - if (softc->flags & ADA_FLAG_CAN_TRIM) { - softc->disk->d_flags |= DISKFLAG_CANDELETE; - softc->disk->d_delmaxsize = softc->params.secsize * - ATA_DSM_RANGE_MAX * - softc->trim_max_ranges; - } else if ((softc->flags & ADA_FLAG_CAN_CFA) && - !(softc->flags & ADA_FLAG_CAN_48BIT)) { - softc->disk->d_flags |= DISKFLAG_CANDELETE; - softc->disk->d_delmaxsize = 256 * softc->params.secsize; - } else - softc->disk->d_delmaxsize = maxio; - if ((cpi.hba_misc & PIM_UNMAPPED) != 0) { - softc->disk->d_flags |= DISKFLAG_UNMAPPED_BIO; - softc->unmappedio = 1; - } - if (cpi.hba_misc & PIM_ATA_EXT) - softc->flags |= ADA_FLAG_PIM_ATA_EXT; - strlcpy(softc->disk->d_descr, cgd->ident_data.model, - MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model))); - strlcpy(softc->disk->d_ident, cgd->ident_data.serial, - MIN(sizeof(softc->disk->d_ident), sizeof(cgd->ident_data.serial))); - softc->disk->d_hba_vendor = cpi.hba_vendor; - softc->disk->d_hba_device = cpi.hba_device; - softc->disk->d_hba_subvendor = cpi.hba_subvendor; - softc->disk->d_hba_subdevice = cpi.hba_subdevice; - softc->disk->d_sectorsize = softc->params.secsize; - softc->disk->d_mediasize = (off_t)softc->params.sectors * - softc->params.secsize; - if (ata_physical_sector_size(&cgd->ident_data) != - softc->params.secsize) { - softc->disk->d_stripesize = - ata_physical_sector_size(&cgd->ident_data); - softc->disk->d_stripeoffset = (softc->disk->d_stripesize - - ata_logical_sector_offset(&cgd->ident_data)) % - softc->disk->d_stripesize; - } else if (softc->quirks & ADA_Q_4K) { - softc->disk->d_stripesize = 4096; - softc->disk->d_stripeoffset = 0; - } - softc->disk->d_fwsectors = softc->params.secs_per_track; - softc->disk->d_fwheads = softc->params.heads; - ata_disk_firmware_geom_adjust(softc->disk); - /* * Acquire a reference to the periph before we register with GEOM. * We'll release this reference once GEOM calls us back (via @@ -3388,16 +3328,17 @@ adaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_ } static void -adagetparams(struct cam_periph *periph, struct ccb_getdev *cgd) +adasetgeom(struct ada_softc *softc, struct ccb_getdev *cgd) { - struct ada_softc *softc = (struct ada_softc *)periph->softc; struct disk_params *dp = &softc->params; u_int64_t lbasize48; u_int32_t lbasize; + u_int maxio, d_flags; dp->secsize = ata_logical_sector_size(&cgd->ident_data); if ((cgd->ident_data.atavalid & ATA_FLAG_54_58) && - cgd->ident_data.current_heads && cgd->ident_data.current_sectors) { + cgd->ident_data.current_heads != 0 && + cgd->ident_data.current_sectors != 0) { dp->heads = cgd->ident_data.current_heads; dp->secs_per_track = cgd->ident_data.current_sectors; dp->cylinders = cgd->ident_data.cylinders; @@ -3425,6 +3366,60 @@ adagetparams(struct cam_periph *periph, struct ccb_get if ((cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) && lbasize48 > ATA_MAX_28BIT_LBA) dp->sectors = lbasize48; + + maxio = softc->cpi.maxio; /* Honor max I/O size of SIM */ + if (maxio == 0) + maxio = DFLTPHYS; /* traditional default */ + else if (maxio > MAXPHYS) + maxio = MAXPHYS; /* for safety */ + if (softc->flags & ADA_FLAG_CAN_48BIT) + maxio = min(maxio, 65536 * softc->params.secsize); + else /* 28bit ATA command limit */ + maxio = min(maxio, 256 * softc->params.secsize); + if (softc->quirks & ADA_Q_128KB) + maxio = min(maxio, 128 * 1024); + softc->disk->d_maxsize = maxio; + d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; + if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) + d_flags |= DISKFLAG_CANFLUSHCACHE; + if (softc->flags & ADA_FLAG_CAN_TRIM) { + d_flags |= DISKFLAG_CANDELETE; + softc->disk->d_delmaxsize = softc->params.secsize * + ATA_DSM_RANGE_MAX * softc->trim_max_ranges; + } else if ((softc->flags & ADA_FLAG_CAN_CFA) && + !(softc->flags & ADA_FLAG_CAN_48BIT)) { + d_flags |= DISKFLAG_CANDELETE; + softc->disk->d_delmaxsize = 256 * softc->params.secsize; + } else + softc->disk->d_delmaxsize = maxio; + if ((softc->cpi.hba_misc & PIM_UNMAPPED) != 0) { + d_flags |= DISKFLAG_UNMAPPED_BIO; + softc->unmappedio = 1; + } + softc->disk->d_flags = d_flags; + strlcpy(softc->disk->d_descr, cgd->ident_data.model, + MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model))); + strlcpy(softc->disk->d_ident, cgd->ident_data.serial, + MIN(sizeof(softc->disk->d_ident), sizeof(cgd->ident_data.serial))); + + softc->disk->d_sectorsize = softc->params.secsize; + softc->disk->d_mediasize = (off_t)softc->params.sectors * + softc->params.secsize; + if (ata_physical_sector_size(&cgd->ident_data) != + softc->params.secsize) { + softc->disk->d_stripesize = + ata_physical_sector_size(&cgd->ident_data); + softc->disk->d_stripeoffset = (softc->disk->d_stripesize - + ata_logical_sector_offset(&cgd->ident_data)) % + softc->disk->d_stripesize; + } else if (softc->quirks & ADA_Q_4K) { + softc->disk->d_stripesize = 4096; + softc->disk->d_stripeoffset = 0; + } + softc->disk->d_fwsectors = softc->params.secs_per_track; + softc->disk->d_fwheads = softc->params.heads; + ata_disk_firmware_geom_adjust(softc->disk); + softc->disk->d_rotation_rate = cgd->ident_data.media_rotation_rate; } static void Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Mon Jul 22 22:59:50 2019 (r350232) +++ head/sys/cam/ata/ata_xpt.c Tue Jul 23 02:11:14 2019 (r350233) @@ -344,6 +344,7 @@ probestart(struct cam_periph *periph, union ccb *start probe_softc *softc; struct cam_path *path; struct ata_params *ident_buf; + u_int oif; CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probestart\n")); @@ -383,7 +384,7 @@ probestart(struct cam_periph *periph, union ccb *start /*data_ptr*/(u_int8_t *)&softc->ident_data, /*dxfer_len*/sizeof(softc->ident_data), 30 * 1000); - if (periph->path->device->protocol == PROTO_ATA) + if (path->device->protocol == PROTO_ATA) ata_28bit_cmd(ataio, ATA_ATA_IDENTIFY, 0, 0, 0); else ata_28bit_cmd(ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0); @@ -419,7 +420,7 @@ probestart(struct cam_periph *periph, union ccb *start if (cts.xport_specific.sata.valid & CTS_SATA_VALID_MODE) mode = cts.xport_specific.sata.mode; } - if (periph->path->device->protocol == PROTO_ATA) { + if (path->device->protocol == PROTO_ATA) { if (ata_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX)) mode = ATA_PIO_MAX; } else { @@ -459,11 +460,13 @@ negotiate: if (mode != wantmode) goto negotiate; /* Remember what transport thinks about DMA. */ + oif = path->device->inq_flags; if (mode < ATA_DMA) path->device->inq_flags &= ~SID_DMA; else path->device->inq_flags |= SID_DMA; - xpt_async(AC_GETDEV_CHANGED, path, NULL); + if (path->device->inq_flags != oif) + xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, probedone, @@ -516,11 +519,13 @@ negotiate: break; case PROBE_SETAN: /* Remember what transport thinks about AEN. */ + oif = path->device->inq_flags; if (softc->caps & CTS_SATA_CAPS_H_AN) path->device->inq_flags |= SID_AEN; else path->device->inq_flags &= ~SID_AEN; - xpt_async(AC_GETDEV_CHANGED, path, NULL); + if (path->device->inq_flags != oif) + xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, probedone, @@ -639,7 +644,7 @@ negotiate: { u_int inquiry_len; struct scsi_inquiry_data *inq_buf = - &periph->path->device->inq_data; + &path->device->inq_data; if (softc->action == PROBE_INQUIRY) inquiry_len = SHORT_INQUIRY_LENGTH; @@ -744,8 +749,8 @@ probedone(struct cam_periph *periph, union ccb *done_c struct cam_path *path; cam_status status; u_int32_t priority; - u_int caps; - int changed = 1, found = 1; + u_int caps, oif; + int changed, found = 1; static const uint8_t fake_device_id_hdr[8] = {0, SVPD_DEVICE_ID, 0, 12, SVPD_ID_CODESET_BINARY, SVPD_ID_TYPE_NAA, 0, 8}; @@ -922,23 +927,32 @@ noerror: goto out; } ident_buf = &path->device->ident_data; + + /* Check that it is the same device as we know. */ if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { - /* Check that it is the same device. */ if (bcmp(softc->ident_data.model, ident_buf->model, sizeof(ident_buf->model)) || - bcmp(softc->ident_data.revision, ident_buf->revision, - sizeof(ident_buf->revision)) || bcmp(softc->ident_data.serial, ident_buf->serial, sizeof(ident_buf->serial))) { - /* Device changed. */ + /* The device was replaced. */ + changed = 2; xpt_async(AC_LOST_DEVICE, path, NULL); + } else if (bcmp(&softc->ident_data, ident_buf, + sizeof(*ident_buf))) { + /* The device is the same, but has changed. */ + changed = 1; } else { - bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); + /* Nothing has changed. */ changed = 0; } + } else { + /* This is a new device. */ + changed = 2; } - if (changed) { + + if (changed != 0) bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); + if (changed == 2) { /* Clean up from previous instance of this device */ if (path->device->serial_num != NULL) { free(path->device->serial_num, M_CAMXPT); @@ -975,10 +989,10 @@ noerror: ata_bswap(path->device->device_id + 8, 8); } } - path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; - xpt_async(AC_GETDEV_CHANGED, path, NULL); } + if (changed == 1) + xpt_async(AC_GETDEV_CHANGED, path, NULL); if (ident_buf->satacapabilities & ATA_SUPPORT_NCQ) { path->device->mintags = 2; path->device->maxtags = @@ -1002,7 +1016,7 @@ noerror: } } ata_device_transport(path); - if (changed) + if (changed == 2) proberequestdefaultnegotiation(periph); PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); @@ -1058,6 +1072,7 @@ noerror: * capability information is not provided or transport is * SATA, we take support for granted. */ + oif = path->device->inq_flags; if (!(path->device->inq_flags & SID_DMA) || (path->device->transport == XPORT_ATA && (cts.xport_specific.ata.valid & CTS_ATA_VALID_CAPS) && @@ -1065,6 +1080,8 @@ noerror: path->device->inq_flags &= ~SID_DMA48; else path->device->inq_flags |= SID_DMA48; + if (path->device->inq_flags != oif) + xpt_async(AC_GETDEV_CHANGED, path, NULL); /* Store result to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1235,6 +1252,7 @@ notsata: else caps = 0; /* Remember what transport thinks about AEN. */ + oif = path->device->inq_flags; if ((caps & CTS_SATA_CAPS_H_AN) && path->device->protocol != PROTO_ATA) path->device->inq_flags |= SID_AEN; else @@ -1248,7 +1266,6 @@ notsata: cts.xport_specific.sata.valid = CTS_SATA_VALID_CAPS; xpt_action((union ccb *)&cts); softc->caps = caps; - xpt_async(AC_GETDEV_CHANGED, path, NULL); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; xpt_acquire_device(path->device); @@ -1256,6 +1273,8 @@ notsata: xpt_action(done_ccb); xpt_async(AC_FOUND_DEVICE, path, done_ccb); } else { + if (path->device->inq_flags != oif) + xpt_async(AC_GETDEV_CHANGED, path, NULL); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); xpt_async(AC_SCSI_AEN, path, done_ccb); @@ -1268,12 +1287,14 @@ notsata: /* Check that it is the same device. */ if (bcmp(&softc->ident_data, ident_buf, 53)) { /* Device changed. */ + changed = 2; xpt_async(AC_LOST_DEVICE, path, NULL); } else { bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); changed = 0; } - } + } else + changed = 2; if (changed) { bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); /* Clean up from previous instance of this device */ From owner-svn-src-all@freebsd.org Tue Jul 23 02:30: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 B4C17C23F1; Tue, 23 Jul 2019 02:30:25 +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 9804B6FFC7; Tue, 23 Jul 2019 02:30:25 +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 70EE61EB73; Tue, 23 Jul 2019 02:30:25 +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 x6N2UPQ7043674; Tue, 23 Jul 2019 02:30:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6N2UPJB043673; Tue, 23 Jul 2019 02:30:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907230230.x6N2UPJB043673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 23 Jul 2019 02:30:25 +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: r350234 - 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: 350234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9804B6FFC7 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: Tue, 23 Jul 2019 02:30:25 -0000 Author: cy Date: Tue Jul 23 02:30:24 2019 New Revision: 350234 URL: https://svnweb.freebsd.org/changeset/base/350234 Log: MFC r350063: 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. 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 Tue Jul 23 02:11:14 2019 (r350233) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Tue Jul 23 02:30:24 2019 (r350234) @@ -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 23 02:30: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 2B8A5C23F5; Tue, 23 Jul 2019 02:30:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 0CA566FFC9; Tue, 23 Jul 2019 02:30:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA49A1EB74; Tue, 23 Jul 2019 02:30:25 +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 x6N2UP5I043680; Tue, 23 Jul 2019 02:30:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6N2UPVQ043679; Tue, 23 Jul 2019 02:30:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907230230.x6N2UPVQ043679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 23 Jul 2019 02:30: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: r350234 - 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: 350234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CA566FFC9 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]; 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, 23 Jul 2019 02:30:26 -0000 Author: cy Date: Tue Jul 23 02:30:24 2019 New Revision: 350234 URL: https://svnweb.freebsd.org/changeset/base/350234 Log: MFC r350063: 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. 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 Tue Jul 23 02:11:14 2019 (r350233) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Tue Jul 23 02:30:24 2019 (r350234) @@ -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 23 07:56: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 9B069A264D; Tue, 23 Jul 2019 07:56:43 +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 7359284993; Tue, 23 Jul 2019 07:56:43 +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 4D44522866; Tue, 23 Jul 2019 07:56:43 +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 x6N7uhhO041320; Tue, 23 Jul 2019 07:56:43 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6N7uhW8041319; Tue, 23 Jul 2019 07:56:43 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907230756.x6N7uhW8041319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 23 Jul 2019 07:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350235 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 350235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7359284993 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: Tue, 23 Jul 2019 07:56:43 -0000 Author: lwhsu Date: Tue Jul 23 07:56:42 2019 New Revision: 350235 URL: https://svnweb.freebsd.org/changeset/base/350235 Log: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__PT_KILL_competing_stop PR: 220841 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Tue Jul 23 02:30:24 2019 (r350234) +++ head/tests/sys/kern/ptrace_test.c Tue Jul 23 07:56:42 2019 (r350235) @@ -2078,6 +2078,8 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc) struct ptrace_lwpinfo pl; struct sched_param sched_param; + atf_tc_skip("https://bugs.freebsd.org/220841"); + ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { trace_me(); From owner-svn-src-all@freebsd.org Tue Jul 23 08:18: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 85E9EA3125; Tue, 23 Jul 2019 08:18:09 +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 67E9C85682; Tue, 23 Jul 2019 08:18:09 +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 419C422C37; Tue, 23 Jul 2019 08:18:09 +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 x6N8I92b053809; Tue, 23 Jul 2019 08:18:09 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6N8I9nC053808; Tue, 23 Jul 2019 08:18:09 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907230818.x6N8I9nC053808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 23 Jul 2019 08:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350236 - stable/12/contrib/netbsd-tests/lib/libc/regex X-SVN-Group: stable-12 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/12/contrib/netbsd-tests/lib/libc/regex X-SVN-Commit-Revision: 350236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67E9C85682 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.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: Tue, 23 Jul 2019 08:18:09 -0000 Author: lwhsu Date: Tue Jul 23 08:18:08 2019 New Revision: 350236 URL: https://svnweb.freebsd.org/changeset/base/350236 Log: MFC r350219 Temporarily skip lib.libc.regex.exhaust_test.regcomp_too_big and lib.libregex.exhaust_test.regcomp_too_big on i386 as they are flakey on it PR: 237450 Sponsored by: The FreeBSD Foundation Modified: stable/12/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Tue Jul 23 07:56:42 2019 (r350235) +++ stable/12/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c Tue Jul 23 08:18:08 2019 (r350236) @@ -186,6 +186,10 @@ ATF_TC_BODY(regcomp_too_big, tc) int e; struct rlimit limit; +#if defined(__i386__) + atf_tc_skip("https://bugs.freebsd.org/237450"); +#endif + limit.rlim_cur = limit.rlim_max = 256 * 1024 * 1024; ATF_REQUIRE(setrlimit(RLIMIT_VMEM, &limit) != -1); From owner-svn-src-all@freebsd.org Tue Jul 23 08:20: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 D157BA3261; Tue, 23 Jul 2019 08:20:53 +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 88008858D2; Tue, 23 Jul 2019 08:20:53 +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 61C8022C5E; Tue, 23 Jul 2019 08:20:53 +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 x6N8KrLR054735; Tue, 23 Jul 2019 08:20:53 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6N8KrOX054734; Tue, 23 Jul 2019 08:20:53 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907230820.x6N8KrOX054734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 23 Jul 2019 08:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350237 - stable/12/tests/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/12/tests/sys/netpfil/pf X-SVN-Commit-Revision: 350237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88008858D2 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.93)[-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: Tue, 23 Jul 2019 08:20:53 -0000 Author: lwhsu Date: Tue Jul 23 08:20:52 2019 New Revision: 350237 URL: https://svnweb.freebsd.org/changeset/base/350237 Log: MFC r350221 Temporarily skip sys.netpfil.pf.forward.{v4,v6} and sys.netpfil.pf.set_tos.v4 on i386 as they are flakey on it PR: 239380 Sponsored by: The FreeBSD Foundation Modified: stable/12/tests/sys/netpfil/pf/forward.sh stable/12/tests/sys/netpfil/pf/set_tos.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/netpfil/pf/forward.sh ============================================================================== --- stable/12/tests/sys/netpfil/pf/forward.sh Tue Jul 23 08:18:08 2019 (r350236) +++ stable/12/tests/sys/netpfil/pf/forward.sh Tue Jul 23 08:20:52 2019 (r350237) @@ -14,6 +14,10 @@ v4_head() v4_body() { + if [ `uname -p` = "i386" ]; then + atf_skip "https://bugs.freebsd.org/239380" + fi + pft_init epair_send=$(vnet_mkepair) @@ -73,6 +77,10 @@ v6_head() v6_body() { + if [ `uname -p` = "i386" ]; then + atf_skip "https://bugs.freebsd.org/239380" + fi + pft_init epair_send=$(vnet_mkepair) Modified: stable/12/tests/sys/netpfil/pf/set_tos.sh ============================================================================== --- stable/12/tests/sys/netpfil/pf/set_tos.sh Tue Jul 23 08:18:08 2019 (r350236) +++ stable/12/tests/sys/netpfil/pf/set_tos.sh Tue Jul 23 08:20:52 2019 (r350237) @@ -14,6 +14,10 @@ v4_head() v4_body() { + if [ `uname -p` = "i386" ]; then + atf_skip "https://bugs.freebsd.org/239380" + fi + pft_init epair_send=$(vnet_mkepair) From owner-svn-src-all@freebsd.org Tue Jul 23 09:19: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 19951A4AA3; Tue, 23 Jul 2019 09:19:59 +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 EF58F8830B; Tue, 23 Jul 2019 09:19:58 +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 C78E223710; Tue, 23 Jul 2019 09:19:58 +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 x6N9JwNn089936; Tue, 23 Jul 2019 09:19:58 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6N9Jwt2089935; Tue, 23 Jul 2019 09:19:58 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907230919.x6N9Jwt2089935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 23 Jul 2019 09:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350238 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 350238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF58F8830B 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.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: Tue, 23 Jul 2019 09:19:59 -0000 Author: lwhsu Date: Tue Jul 23 09:19:58 2019 New Revision: 350238 URL: https://svnweb.freebsd.org/changeset/base/350238 Log: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__follow_fork_both_attached_unrelated_debugger PR: 239397 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Tue Jul 23 08:20:52 2019 (r350237) +++ head/tests/sys/kern/ptrace_test.c Tue Jul 23 09:19:58 2019 (r350238) @@ -799,6 +799,8 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelate pid_t children[2], fpid, wpid; int cpipe[2], status; + atf_tc_skip("https://bugs.freebsd.org/239397"); + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { From owner-svn-src-all@freebsd.org Tue Jul 23 09:39: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 0961DA502C; Tue, 23 Jul 2019 09:39:28 +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 DE92188D4B; Tue, 23 Jul 2019 09:39:27 +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 B3BAB23A8C; Tue, 23 Jul 2019 09:39:27 +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 x6N9dRbj001634; Tue, 23 Jul 2019 09:39:27 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6N9dRGM001633; Tue, 23 Jul 2019 09:39:27 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907230939.x6N9dRGM001633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 23 Jul 2019 09:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350239 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 350239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE92188D4B 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.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: Tue, 23 Jul 2019 09:39:28 -0000 Author: lwhsu Date: Tue Jul 23 09:39:27 2019 New Revision: 350239 URL: https://svnweb.freebsd.org/changeset/base/350239 Log: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__parent_sees_exit_after_child_debugger PR: 239399 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Tue Jul 23 09:19:58 2019 (r350238) +++ head/tests/sys/kern/ptrace_test.c Tue Jul 23 09:39:27 2019 (r350239) @@ -258,6 +258,8 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debug int cpipe[2], dpipe[2], status; char c; + atf_tc_skip("https://bugs.freebsd.org/239399"); + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((child = fork()) != -1); From owner-svn-src-all@freebsd.org Tue Jul 23 12:52: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 EAE36A931C; Tue, 23 Jul 2019 12:52:36 +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 CCF708F743; Tue, 23 Jul 2019 12:52:36 +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 A4DA725E48; Tue, 23 Jul 2019 12:52:36 +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 x6NCqaJv018883; Tue, 23 Jul 2019 12:52:36 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NCqaS9018882; Tue, 23 Jul 2019 12:52:36 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201907231252.x6NCqaS9018882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 23 Jul 2019 12:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350240 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 350240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCF708F743 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.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: Tue, 23 Jul 2019 12:52:37 -0000 Author: ae Date: Tue Jul 23 12:52:36 2019 New Revision: 350240 URL: https://svnweb.freebsd.org/changeset/base/350240 Log: Eliminate rmlock from ipfw's BPF code. After r343631 pfil hooks are invoked in net_epoch_preempt section, this allows to avoid extra locking. Add NET_EPOCH_ASSER() assertion to each ipfw_bpf_*tap*() call to require to be called from inside epoch section. Use NET_EPOCH_WAIT() in ipfw_clone_destroy() to wait until it becomes safe to free() ifnet. And use on-stack ifnet pointer in each ipfw_bpf_*tap*() call to avoid NULL pointer dereference in case when V_*log_if global variable will become NULL during ipfw_bpf_*tap*() call. Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_bpf.c Modified: head/sys/netpfil/ipfw/ip_fw_bpf.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_bpf.c Tue Jul 23 09:39:27 2019 (r350239) +++ head/sys/netpfil/ipfw/ip_fw_bpf.c Tue Jul 23 12:52:36 2019 (r350240) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -57,15 +56,6 @@ VNET_DEFINE_STATIC(struct if_clone *, ipfwlog_cloner); #define V_log_if VNET(log_if) #define V_pflog_if VNET(pflog_if) -static struct rmlock log_if_lock; -#define LOGIF_LOCK_INIT(x) rm_init(&log_if_lock, "ipfw log_if lock") -#define LOGIF_LOCK_DESTROY(x) rm_destroy(&log_if_lock) -#define LOGIF_RLOCK_TRACKER struct rm_priotracker _log_tracker -#define LOGIF_RLOCK(x) rm_rlock(&log_if_lock, &_log_tracker) -#define LOGIF_RUNLOCK(x) rm_runlock(&log_if_lock, &_log_tracker) -#define LOGIF_WLOCK(x) rm_wlock(&log_if_lock) -#define LOGIF_WUNLOCK(x) rm_wunlock(&log_if_lock) - static const char ipfwname[] = "ipfw"; static const char ipfwlogname[] = "ipfwlog"; @@ -90,13 +80,12 @@ static void ipfw_clone_destroy(struct ifnet *ifp) { - LOGIF_WLOCK(); if (ifp->if_hdrlen == ETHER_HDR_LEN) V_log_if = NULL; else V_pflog_if = NULL; - LOGIF_WUNLOCK(); + NET_EPOCH_WAIT(); bpfdetach(ifp); if_detach(ifp); if_free(ifp); @@ -118,16 +107,13 @@ ipfw_clone_create(struct if_clone *ifc, int unit, cadd ifp->if_hdrlen = ETHER_HDR_LEN; if_attach(ifp); bpfattach(ifp, DLT_EN10MB, ETHER_HDR_LEN); - LOGIF_WLOCK(); if (V_log_if != NULL) { - LOGIF_WUNLOCK(); bpfdetach(ifp); if_detach(ifp); if_free(ifp); return (EEXIST); } V_log_if = ifp; - LOGIF_WUNLOCK(); return (0); } @@ -147,48 +133,42 @@ ipfwlog_clone_create(struct if_clone *ifc, int unit, c ifp->if_hdrlen = PFLOG_HDRLEN; if_attach(ifp); bpfattach(ifp, DLT_PFLOG, PFLOG_HDRLEN); - LOGIF_WLOCK(); if (V_pflog_if != NULL) { - LOGIF_WUNLOCK(); bpfdetach(ifp); if_detach(ifp); if_free(ifp); return (EEXIST); } V_pflog_if = ifp; - LOGIF_WUNLOCK(); return (0); } void ipfw_bpf_tap(u_char *pkt, u_int pktlen) { - LOGIF_RLOCK_TRACKER; + struct ifnet *ifp = V_log_if; - LOGIF_RLOCK(); - if (V_log_if != NULL) - BPF_TAP(V_log_if, pkt, pktlen); - LOGIF_RUNLOCK(); + NET_EPOCH_ASSERT(); + if (ifp != NULL) + BPF_TAP(ifp, pkt, pktlen); } void ipfw_bpf_mtap(struct mbuf *m) { - LOGIF_RLOCK_TRACKER; + struct ifnet *ifp = V_log_if; - LOGIF_RLOCK(); - if (V_log_if != NULL) - BPF_MTAP(V_log_if, m); - LOGIF_RUNLOCK(); + NET_EPOCH_ASSERT(); + if (ifp != NULL) + BPF_MTAP(ifp, m); } void ipfw_bpf_mtap2(void *data, u_int dlen, struct mbuf *m) { struct ifnet *logif; - LOGIF_RLOCK_TRACKER; - LOGIF_RLOCK(); + NET_EPOCH_ASSERT(); switch (dlen) { case (ETHER_HDR_LEN): logif = V_log_if; @@ -205,19 +185,14 @@ ipfw_bpf_mtap2(void *data, u_int dlen, struct mbuf *m) if (logif != NULL) BPF_MTAP2(logif, data, dlen, m); - - LOGIF_RUNLOCK(); } void -ipfw_bpf_init(int first) +ipfw_bpf_init(int first __unused) { - if (first) { - LOGIF_LOCK_INIT(); - V_log_if = NULL; - V_pflog_if = NULL; - } + V_log_if = NULL; + V_pflog_if = NULL; V_ipfw_cloner = if_clone_simple(ipfwname, ipfw_clone_create, ipfw_clone_destroy, 0); V_ipfwlog_cloner = if_clone_simple(ipfwlogname, ipfwlog_clone_create, @@ -225,12 +200,10 @@ ipfw_bpf_init(int first) } void -ipfw_bpf_uninit(int last) +ipfw_bpf_uninit(int last __unused) { if_clone_detach(V_ipfw_cloner); if_clone_detach(V_ipfwlog_cloner); - if (last) - LOGIF_LOCK_DESTROY(); } From owner-svn-src-all@freebsd.org Tue Jul 23 13:02: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 06CF9A9683 for ; Tue, 23 Jul 2019 13:02:15 +0000 (UTC) (envelope-from maldivesholidaysdirect@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) 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 2CC1A8FDA3 for ; Tue, 23 Jul 2019 13:02:11 +0000 (UTC) (envelope-from maldivesholidaysdirect@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id x4so43055222wrt.6 for ; Tue, 23 Jul 2019 06:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=MyL+W79+E9urTYAOeaAzIBxHpv6IsRVEbJsqEnWMMt8=; b=AO2IYTNd6nS0fE9ezN+jAEkA2R8Ft8VUnm6qc4oof5bedTYDMdeGihj5k6S5IXyheW vy+V2Z3nCXr9lN2Nu3hxXUZf3u1FKbbBVD/Daab8UOIGWxwMRo2zGGaS7HptZlWtQ85s ulEaRvescU/BE9XvGZl8TpWa1y2wFSwRJ+m+Xzp2VXSnPZwp4iN9pnA3WKkANCFSSSri MtcaLFSxMhk8x9PPlv/oj5H6o8H9adUDiJ4u6sNozF6dWoIz99O7sBlREhYSr51FNsXI Jsz9cmXx72eKn8a7WmJTEeLaKEG9Ru1ZOEE4YrzccxWcQ1tJ+8ER7Fd+W2dCRb/5Khb3 je2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=MyL+W79+E9urTYAOeaAzIBxHpv6IsRVEbJsqEnWMMt8=; b=JXW2drtGDcfbF8yBu1DMsyC7iwAwltsRibedHF2U/y0PM35AT6/8qVti2OA81UKxws utq+gS7bSwGLaHxYA4DOcPMqJXXzvuV/IPKW2RPmsJSvlNgF3ztWYriYpcx6p9nSz/jY K+gpQtcpE3mMQsVbJVYixnNJ+WDOysBvdhgKgdFK8fz/RQ/iNqF+vl+cIb7lq6pSR0vf cZVIysA7p7Bmsx0fMt/d3ArksYEjxm6gN1wALetDZrA8qXOkTB1aA48RIremKIy6Wwsd pHw7n6Zb1FOuCr6QSprdr76Z2K7grKH4zXsM6nYi8mMFeOZb64LdHDJ//VwVsz0p5LcY Gazg== X-Gm-Message-State: APjAAAWjZ+iJNciv+bi4/CUBlLrv6EC5AEDFUSIVcKiIF+Jy/q46u/4/ 2w8xs8GldcxYE1IbL9rKzrd2obfYcyjRvaL2c/FZGQ== X-Google-Smtp-Source: APXvYqw0uuSlPWxDMh5scZmF9enBqb9BFGMKRXqiMGpbHAWJedgTlndkx1/I9jAdmwNudo+gE7KSP1yk6Y2A7AWxMRg= X-Received: by 2002:adf:fc52:: with SMTP id e18mr78078429wrs.14.1563886929940; Tue, 23 Jul 2019 06:02:09 -0700 (PDT) Received: from 52669349336 named unknown by gmailapi.google.com with HTTPREST; Tue, 23 Jul 2019 13:02:09 +0000 MIME-Version: 1.0 Sender: Simon Daniel From: Simon Daniel Date: Tue, 23 Jul 2019 13:02:09 +0000 X-Google-Sender-Auth: HUjFUeefhrA0O8INIJ9O-ReGjgw Message-ID: Subject: Are you making this mistake for gcu-squad.org To: Svn-Src-All X-Rspamd-Queue-Id: 2CC1A8FDA3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=AO2IYTNd; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of maldivesholidaysdirect@gmail.com designates 2a00:1450:4864:20::443 as permitted sender) smtp.mailfrom=maldivesholidaysdirect@gmail.com X-Spamd-Result: default: False [-4.22 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; 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.86)[-0.863,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-0.75)[ip: (1.70), ipnet: 2a00:1450::/32(-2.96), asn: 15169(-2.43), country: US(-0.05)]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; URL_IN_SUBJECT(0.40)[gcu-squad.org]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0] 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: Tue, 23 Jul 2019 13:02:15 -0000 Hi gcu-squad.org Being a professional digital marketing Company we can be a great asset in developing your business. Our Team can find lucrative keywords and niches with great ROI where you can make money easily. We will carry out detailed market research and competitive analysis which will help you achieve maximum traffic and close big deals for you. Our skilled Technicians will run an in-depth analysis on your competitor=E2= =80=99s website to study their straategy and accordingly provide you with complete process and implement the same to stay ahead of competition. Mutually, we can go ahead and get good reputation and maximum value to your site from our advanced Digital Marketing Campaign. *Please find below some of the major areas we majorly focus on: * - Selection of relevant keywords to attract traffic. - Creating content based links for better understanding. - Regular update on Social media site for maximum visibility. - Making website flawless to avoid huddles in promotional activities. There are many other advance practices to implement and get brand name for your website. If you are looking for any sort of web services, please contact our Marketing team professionals by replying this email or sharing your contact details. Thanks Regards, *Simon Daniel* *Digital Marketing Expert* -------------------------------------------------------------- [image: beacon] From owner-svn-src-all@freebsd.org Tue Jul 23 14:40: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 D51D6AB113; Tue, 23 Jul 2019 14:40:39 +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 BE89093DA2; Tue, 23 Jul 2019 14:40:39 +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 B3AE5270DD; Tue, 23 Jul 2019 14:40:37 +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 x6NEebhj078949; Tue, 23 Jul 2019 14:40:37 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NEebtL078948; Tue, 23 Jul 2019 14:40:37 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201907231440.x6NEebtL078948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 23 Jul 2019 14:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350241 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 350241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE89093DA2 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.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: Tue, 23 Jul 2019 14:40:39 -0000 Author: andrew Date: Tue Jul 23 14:40:37 2019 New Revision: 350241 URL: https://svnweb.freebsd.org/changeset/base/350241 Log: Ensure the arm64 ID register fields are 64 bit types. Previously only some of the ID register fields were 64 bit. To allow for a script to generate these mark them all 64 bit. To allow for their use in assembly we need to use the UINT64_C macro via a new UL macro to stop the lines from being too long. MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20977 Modified: head/sys/arm64/include/armreg.h Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Tue Jul 23 12:52:36 2019 (r350240) +++ head/sys/arm64/include/armreg.h Tue Jul 23 14:40:37 2019 (r350241) @@ -43,6 +43,8 @@ #define WRITE_SPECIALREG(reg, _val) \ __asm __volatile("msr " __STRING(reg) ", %0" : : "r"((uint64_t)_val)) +#define UL(x) UINT64_C(x) + /* CNTHCTL_EL2 - Counter-timer Hypervisor Control register */ #define CNTHCTL_EVNTI_MASK (0xf << 4) /* Bit to trigger event stream */ #define CNTHCTL_EVNTDIR (1 << 3) /* Control transition trigger bit */ @@ -176,324 +178,324 @@ /* ID_AA64DFR0_EL1 */ #define ID_AA64DFR0_MASK 0x0000000ff0f0fffful #define ID_AA64DFR0_DebugVer_SHIFT 0 -#define ID_AA64DFR0_DebugVer_MASK (0xf << ID_AA64DFR0_DebugVer_SHIFT) +#define ID_AA64DFR0_DebugVer_MASK (UL(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_DebugVer_8 (UL(0x6) << ID_AA64DFR0_DebugVer_SHIFT) +#define ID_AA64DFR0_DebugVer_8_VHE (UL(0x7) << ID_AA64DFR0_DebugVer_SHIFT) +#define ID_AA64DFR0_DebugVer_8_2 (UL(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_MASK (UL(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_TraceVer_NONE (UL(0x0) << ID_AA64DFR0_TraceVer_SHIFT) +#define ID_AA64DFR0_TraceVer_IMPL (UL(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_MASK (UL(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_PMUVer_NONE (UL(0x0) << ID_AA64DFR0_PMUVer_SHIFT) +#define ID_AA64DFR0_PMUVer_3 (UL(0x1) << ID_AA64DFR0_PMUVer_SHIFT) +#define ID_AA64DFR0_PMUVer_3_1 (UL(0x4) << ID_AA64DFR0_PMUVer_SHIFT) +#define ID_AA64DFR0_PMUVer_IMPL (UL(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_MASK (UL(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_MASK (UL(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_MASK (UL(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_MASK (UL(0xf) << 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) +#define ID_AA64DFR0_PMSVer_NONE (UL(0x0) << ID_AA64DFR0_PMSVer_SHIFT) +#define ID_AA64DFR0_PMSVer_V1 (UL(0x1) << ID_AA64DFR0_PMSVer_SHIFT) /* ID_AA64ISAR0_EL1 */ #define ID_AA64ISAR0_MASK 0x0000fffff0fffff0ul #define ID_AA64ISAR0_AES_SHIFT 4 -#define ID_AA64ISAR0_AES_MASK (0xf << ID_AA64ISAR0_AES_SHIFT) +#define ID_AA64ISAR0_AES_MASK (UL(0xf) << ID_AA64ISAR0_AES_SHIFT) #define ID_AA64ISAR0_AES(x) ((x) & ID_AA64ISAR0_AES_MASK) -#define ID_AA64ISAR0_AES_NONE (0x0 << ID_AA64ISAR0_AES_SHIFT) -#define ID_AA64ISAR0_AES_BASE (0x1 << ID_AA64ISAR0_AES_SHIFT) -#define ID_AA64ISAR0_AES_PMULL (0x2 << ID_AA64ISAR0_AES_SHIFT) +#define ID_AA64ISAR0_AES_NONE (UL(0x0) << ID_AA64ISAR0_AES_SHIFT) +#define ID_AA64ISAR0_AES_BASE (UL(0x1) << ID_AA64ISAR0_AES_SHIFT) +#define ID_AA64ISAR0_AES_PMULL (UL(0x2) << ID_AA64ISAR0_AES_SHIFT) #define ID_AA64ISAR0_SHA1_SHIFT 8 -#define ID_AA64ISAR0_SHA1_MASK (0xf << ID_AA64ISAR0_SHA1_SHIFT) +#define ID_AA64ISAR0_SHA1_MASK (UL(0xf) << ID_AA64ISAR0_SHA1_SHIFT) #define ID_AA64ISAR0_SHA1(x) ((x) & ID_AA64ISAR0_SHA1_MASK) -#define ID_AA64ISAR0_SHA1_NONE (0x0 << ID_AA64ISAR0_SHA1_SHIFT) -#define ID_AA64ISAR0_SHA1_BASE (0x1 << ID_AA64ISAR0_SHA1_SHIFT) +#define ID_AA64ISAR0_SHA1_NONE (UL(0x0) << ID_AA64ISAR0_SHA1_SHIFT) +#define ID_AA64ISAR0_SHA1_BASE (UL(0x1) << ID_AA64ISAR0_SHA1_SHIFT) #define ID_AA64ISAR0_SHA2_SHIFT 12 -#define ID_AA64ISAR0_SHA2_MASK (0xf << ID_AA64ISAR0_SHA2_SHIFT) +#define ID_AA64ISAR0_SHA2_MASK (UL(0xf) << ID_AA64ISAR0_SHA2_SHIFT) #define ID_AA64ISAR0_SHA2(x) ((x) & ID_AA64ISAR0_SHA2_MASK) -#define ID_AA64ISAR0_SHA2_NONE (0x0 << ID_AA64ISAR0_SHA2_SHIFT) -#define ID_AA64ISAR0_SHA2_BASE (0x1 << ID_AA64ISAR0_SHA2_SHIFT) -#define ID_AA64ISAR0_SHA2_512 (0x2 << ID_AA64ISAR0_SHA2_SHIFT) +#define ID_AA64ISAR0_SHA2_NONE (UL(0x0) << ID_AA64ISAR0_SHA2_SHIFT) +#define ID_AA64ISAR0_SHA2_BASE (UL(0x1) << ID_AA64ISAR0_SHA2_SHIFT) +#define ID_AA64ISAR0_SHA2_512 (UL(0x2) << ID_AA64ISAR0_SHA2_SHIFT) #define ID_AA64ISAR0_CRC32_SHIFT 16 -#define ID_AA64ISAR0_CRC32_MASK (0xf << ID_AA64ISAR0_CRC32_SHIFT) +#define ID_AA64ISAR0_CRC32_MASK (UL(0xf) << ID_AA64ISAR0_CRC32_SHIFT) #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_CRC32_NONE (UL(0x0) << ID_AA64ISAR0_CRC32_SHIFT) +#define ID_AA64ISAR0_CRC32_BASE (UL(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_MASK (UL(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_NONE (UL(0x0) << ID_AA64ISAR0_Atomic_SHIFT) +#define ID_AA64ISAR0_Atomic_IMPL (UL(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_MASK (UL(0xf) << ID_AA64ISAR0_RDM_SHIFT) #define ID_AA64ISAR0_RDM(x) ((x) & ID_AA64ISAR0_RDM_MASK) -#define ID_AA64ISAR0_RDM_NONE (0x0 << ID_AA64ISAR0_RDM_SHIFT) -#define ID_AA64ISAR0_RDM_IMPL (0x1 << ID_AA64ISAR0_RDM_SHIFT) +#define ID_AA64ISAR0_RDM_NONE (UL(0x0) << ID_AA64ISAR0_RDM_SHIFT) +#define ID_AA64ISAR0_RDM_IMPL (UL(0x1) << ID_AA64ISAR0_RDM_SHIFT) #define ID_AA64ISAR0_SHA3_SHIFT 32 -#define ID_AA64ISAR0_SHA3_MASK (0xful << ID_AA64ISAR0_SHA3_SHIFT) +#define ID_AA64ISAR0_SHA3_MASK (UL(0xf) << ID_AA64ISAR0_SHA3_SHIFT) #define ID_AA64ISAR0_SHA3(x) ((x) & ID_AA64ISAR0_SHA3_MASK) -#define ID_AA64ISAR0_SHA3_NONE (0x0ul << ID_AA64ISAR0_SHA3_SHIFT) -#define ID_AA64ISAR0_SHA3_IMPL (0x1ul << ID_AA64ISAR0_SHA3_SHIFT) +#define ID_AA64ISAR0_SHA3_NONE (UL(0x0) << ID_AA64ISAR0_SHA3_SHIFT) +#define ID_AA64ISAR0_SHA3_IMPL (UL(0x1) << ID_AA64ISAR0_SHA3_SHIFT) #define ID_AA64ISAR0_SM3_SHIFT 36 -#define ID_AA64ISAR0_SM3_MASK (0xful << ID_AA64ISAR0_SM3_SHIFT) +#define ID_AA64ISAR0_SM3_MASK (UL(0xf) << ID_AA64ISAR0_SM3_SHIFT) #define ID_AA64ISAR0_SM3(x) ((x) & ID_AA64ISAR0_SM3_MASK) -#define ID_AA64ISAR0_SM3_NONE (0x0ul << ID_AA64ISAR0_SM3_SHIFT) -#define ID_AA64ISAR0_SM3_IMPL (0x1ul << ID_AA64ISAR0_SM3_SHIFT) +#define ID_AA64ISAR0_SM3_NONE (UL(0x0) << ID_AA64ISAR0_SM3_SHIFT) +#define ID_AA64ISAR0_SM3_IMPL (UL(0x1) << ID_AA64ISAR0_SM3_SHIFT) #define ID_AA64ISAR0_SM4_SHIFT 40 -#define ID_AA64ISAR0_SM4_MASK (0xful << ID_AA64ISAR0_SM4_SHIFT) +#define ID_AA64ISAR0_SM4_MASK (UL(0xf) << ID_AA64ISAR0_SM4_SHIFT) #define ID_AA64ISAR0_SM4(x) ((x) & ID_AA64ISAR0_SM4_MASK) -#define ID_AA64ISAR0_SM4_NONE (0x0ul << ID_AA64ISAR0_SM4_SHIFT) -#define ID_AA64ISAR0_SM4_IMPL (0x1ul << ID_AA64ISAR0_SM4_SHIFT) +#define ID_AA64ISAR0_SM4_NONE (UL(0x0) << ID_AA64ISAR0_SM4_SHIFT) +#define ID_AA64ISAR0_SM4_IMPL (UL(0x1) << ID_AA64ISAR0_SM4_SHIFT) #define ID_AA64ISAR0_DP_SHIFT 44 -#define ID_AA64ISAR0_DP_MASK (0xful << ID_AA64ISAR0_DP_SHIFT) +#define ID_AA64ISAR0_DP_MASK (UL(0xf) << ID_AA64ISAR0_DP_SHIFT) #define ID_AA64ISAR0_DP(x) ((x) & ID_AA64ISAR0_DP_MASK) -#define ID_AA64ISAR0_DP_NONE (0x0ul << ID_AA64ISAR0_DP_SHIFT) -#define ID_AA64ISAR0_DP_IMPL (0x1ul << ID_AA64ISAR0_DP_SHIFT) +#define ID_AA64ISAR0_DP_NONE (UL(0x0) << ID_AA64ISAR0_DP_SHIFT) +#define ID_AA64ISAR0_DP_IMPL (UL(0x1) << ID_AA64ISAR0_DP_SHIFT) /* ID_AA64ISAR1_EL1 */ #define ID_AA64ISAR1_MASK 0xffffffff #define ID_AA64ISAR1_DPB_SHIFT 0 -#define ID_AA64ISAR1_DPB_MASK (0xf << ID_AA64ISAR1_DPB_SHIFT) +#define ID_AA64ISAR1_DPB_MASK (UL(0xf) << ID_AA64ISAR1_DPB_SHIFT) #define ID_AA64ISAR1_DPB(x) ((x) & ID_AA64ISAR1_DPB_MASK) -#define ID_AA64ISAR1_DPB_NONE (0x0 << ID_AA64ISAR1_DPB_SHIFT) -#define ID_AA64ISAR1_DPB_IMPL (0x1 << ID_AA64ISAR1_DPB_SHIFT) +#define ID_AA64ISAR1_DPB_NONE (UL(0x0) << ID_AA64ISAR1_DPB_SHIFT) +#define ID_AA64ISAR1_DPB_IMPL (UL(0x1) << ID_AA64ISAR1_DPB_SHIFT) #define ID_AA64ISAR1_APA_SHIFT 4 -#define ID_AA64ISAR1_APA_MASK (0xf << ID_AA64ISAR1_APA_SHIFT) +#define ID_AA64ISAR1_APA_MASK (UL(0xf) << ID_AA64ISAR1_APA_SHIFT) #define ID_AA64ISAR1_APA(x) ((x) & ID_AA64ISAR1_APA_MASK) -#define ID_AA64ISAR1_APA_NONE (0x0 << ID_AA64ISAR1_APA_SHIFT) -#define ID_AA64ISAR1_APA_IMPL (0x1 << ID_AA64ISAR1_APA_SHIFT) +#define ID_AA64ISAR1_APA_NONE (UL(0x0) << ID_AA64ISAR1_APA_SHIFT) +#define ID_AA64ISAR1_APA_IMPL (UL(0x1) << ID_AA64ISAR1_APA_SHIFT) #define ID_AA64ISAR1_API_SHIFT 8 -#define ID_AA64ISAR1_API_MASK (0xf << ID_AA64ISAR1_API_SHIFT) +#define ID_AA64ISAR1_API_MASK (UL(0xf) << ID_AA64ISAR1_API_SHIFT) #define ID_AA64ISAR1_API(x) ((x) & ID_AA64ISAR1_API_MASK) -#define ID_AA64ISAR1_API_NONE (0x0 << ID_AA64ISAR1_API_SHIFT) -#define ID_AA64ISAR1_API_IMPL (0x1 << ID_AA64ISAR1_API_SHIFT) +#define ID_AA64ISAR1_API_NONE (UL(0x0) << ID_AA64ISAR1_API_SHIFT) +#define ID_AA64ISAR1_API_IMPL (UL(0x1) << ID_AA64ISAR1_API_SHIFT) #define ID_AA64ISAR1_JSCVT_SHIFT 12 -#define ID_AA64ISAR1_JSCVT_MASK (0xf << ID_AA64ISAR1_JSCVT_SHIFT) +#define ID_AA64ISAR1_JSCVT_MASK (UL(0xf) << ID_AA64ISAR1_JSCVT_SHIFT) #define ID_AA64ISAR1_JSCVT(x) ((x) & ID_AA64ISAR1_JSCVT_MASK) -#define ID_AA64ISAR1_JSCVT_NONE (0x0 << ID_AA64ISAR1_JSCVT_SHIFT) -#define ID_AA64ISAR1_JSCVT_IMPL (0x1 << ID_AA64ISAR1_JSCVT_SHIFT) +#define ID_AA64ISAR1_JSCVT_NONE (UL(0x0) << ID_AA64ISAR1_JSCVT_SHIFT) +#define ID_AA64ISAR1_JSCVT_IMPL (UL(0x1) << ID_AA64ISAR1_JSCVT_SHIFT) #define ID_AA64ISAR1_FCMA_SHIFT 16 -#define ID_AA64ISAR1_FCMA_MASK (0xf << ID_AA64ISAR1_FCMA_SHIFT) +#define ID_AA64ISAR1_FCMA_MASK (UL(0xf) << ID_AA64ISAR1_FCMA_SHIFT) #define ID_AA64ISAR1_FCMA(x) ((x) & ID_AA64ISAR1_FCMA_MASK) -#define ID_AA64ISAR1_FCMA_NONE (0x0 << ID_AA64ISAR1_FCMA_SHIFT) -#define ID_AA64ISAR1_FCMA_IMPL (0x1 << ID_AA64ISAR1_FCMA_SHIFT) +#define ID_AA64ISAR1_FCMA_NONE (UL(0x0) << ID_AA64ISAR1_FCMA_SHIFT) +#define ID_AA64ISAR1_FCMA_IMPL (UL(0x1) << ID_AA64ISAR1_FCMA_SHIFT) #define ID_AA64ISAR1_LRCPC_SHIFT 20 -#define ID_AA64ISAR1_LRCPC_MASK (0xf << ID_AA64ISAR1_LRCPC_SHIFT) +#define ID_AA64ISAR1_LRCPC_MASK (UL(0xf) << ID_AA64ISAR1_LRCPC_SHIFT) #define ID_AA64ISAR1_LRCPC(x) ((x) & ID_AA64ISAR1_LRCPC_MASK) -#define ID_AA64ISAR1_LRCPC_NONE (0x0 << ID_AA64ISAR1_LRCPC_SHIFT) -#define ID_AA64ISAR1_LRCPC_IMPL (0x1 << ID_AA64ISAR1_LRCPC_SHIFT) +#define ID_AA64ISAR1_LRCPC_NONE (UL(0x0) << ID_AA64ISAR1_LRCPC_SHIFT) +#define ID_AA64ISAR1_LRCPC_IMPL (UL(0x1) << ID_AA64ISAR1_LRCPC_SHIFT) #define ID_AA64ISAR1_GPA_SHIFT 24 -#define ID_AA64ISAR1_GPA_MASK (0xf << ID_AA64ISAR1_GPA_SHIFT) +#define ID_AA64ISAR1_GPA_MASK (UL(0xf) << ID_AA64ISAR1_GPA_SHIFT) #define ID_AA64ISAR1_GPA(x) ((x) & ID_AA64ISAR1_GPA_MASK) -#define ID_AA64ISAR1_GPA_NONE (0x0 << ID_AA64ISAR1_GPA_SHIFT) -#define ID_AA64ISAR1_GPA_IMPL (0x1 << ID_AA64ISAR1_GPA_SHIFT) +#define ID_AA64ISAR1_GPA_NONE (UL(0x0) << ID_AA64ISAR1_GPA_SHIFT) +#define ID_AA64ISAR1_GPA_IMPL (UL(0x1) << ID_AA64ISAR1_GPA_SHIFT) #define ID_AA64ISAR1_GPI_SHIFT 28 -#define ID_AA64ISAR1_GPI_MASK (0xf << ID_AA64ISAR1_GPI_SHIFT) +#define ID_AA64ISAR1_GPI_MASK (UL(0xf) << ID_AA64ISAR1_GPI_SHIFT) #define ID_AA64ISAR1_GPI(x) ((x) & ID_AA64ISAR1_GPI_MASK) -#define ID_AA64ISAR1_GPI_NONE (0x0 << ID_AA64ISAR1_GPI_SHIFT) -#define ID_AA64ISAR1_GPI_IMPL (0x1 << ID_AA64ISAR1_GPI_SHIFT) +#define ID_AA64ISAR1_GPI_NONE (UL(0x0) << ID_AA64ISAR1_GPI_SHIFT) +#define ID_AA64ISAR1_GPI_IMPL (UL(0x1) << ID_AA64ISAR1_GPI_SHIFT) /* ID_AA64MMFR0_EL1 */ #define ID_AA64MMFR0_MASK 0xffffffff #define ID_AA64MMFR0_PARange_SHIFT 0 -#define ID_AA64MMFR0_PARange_MASK (0xf << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_MASK (UL(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_PARange_4G (UL(0x0) << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_64G (UL(0x1) << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_1T (UL(0x2) << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_4T (UL(0x3) << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_16T (UL(0x4) << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_256T (UL(0x5) << ID_AA64MMFR0_PARange_SHIFT) +#define ID_AA64MMFR0_PARange_4P (UL(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_MASK (UL(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_ASIDBits_8 (UL(0x0) << ID_AA64MMFR0_ASIDBits_SHIFT) +#define ID_AA64MMFR0_ASIDBits_16 (UL(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_MASK (UL(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_BigEnd_FIXED (UL(0x0) << ID_AA64MMFR0_BigEnd_SHIFT) +#define ID_AA64MMFR0_BigEnd_MIXED (UL(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_MASK (UL(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_SNSMem_NONE (UL(0x0) << ID_AA64MMFR0_SNSMem_SHIFT) +#define ID_AA64MMFR0_SNSMem_DISTINCT (UL(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_MASK (UL(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_BigEndEL0_FIXED (UL(0x0) << ID_AA64MMFR0_BigEndEL0_SHIFT) +#define ID_AA64MMFR0_BigEndEL0_MIXED (UL(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_MASK (UL(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_TGran16_NONE (UL(0x0) << ID_AA64MMFR0_TGran16_SHIFT) +#define ID_AA64MMFR0_TGran16_IMPL (UL(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_MASK (UL(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_TGran64_IMPL (UL(0x0) << ID_AA64MMFR0_TGran64_SHIFT) +#define ID_AA64MMFR0_TGran64_NONE (UL(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_MASK (UL(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_TGran4_IMPL (UL(0x0) << ID_AA64MMFR0_TGran4_SHIFT) +#define ID_AA64MMFR0_TGran4_NONE (UL(0xf) << ID_AA64MMFR0_TGran4_SHIFT) /* ID_AA64MMFR1_EL1 */ #define ID_AA64MMFR1_MASK 0xffffffff #define ID_AA64MMFR1_HAFDBS_SHIFT 0 -#define ID_AA64MMFR1_HAFDBS_MASK (0xf << ID_AA64MMFR1_HAFDBS_SHIFT) +#define ID_AA64MMFR1_HAFDBS_MASK (UL(0xf) << ID_AA64MMFR1_HAFDBS_SHIFT) #define ID_AA64MMFR1_HAFDBS(x) ((x) & ID_AA64MMFR1_HAFDBS_MASK) -#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_HAFDBS_NONE (UL(0x0) << ID_AA64MMFR1_HAFDBS_SHIFT) +#define ID_AA64MMFR1_HAFDBS_AF (UL(0x1) << ID_AA64MMFR1_HAFDBS_SHIFT) +#define ID_AA64MMFR1_HAFDBS_AF_DBS (UL(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_MASK (UL(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_8 (UL(0x0) << ID_AA64MMFR1_VMIDBits_SHIFT) +#define ID_AA64MMFR1_VMIDBits_16 (UL(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_MASK (UL(0xf) << ID_AA64MMFR1_VH_SHIFT) #define ID_AA64MMFR1_VH(x) ((x) & ID_AA64MMFR1_VH_MASK) -#define ID_AA64MMFR1_VH_NONE (0x0 << ID_AA64MMFR1_VH_SHIFT) -#define ID_AA64MMFR1_VH_IMPL (0x1 << ID_AA64MMFR1_VH_SHIFT) +#define ID_AA64MMFR1_VH_NONE (UL(0x0) << ID_AA64MMFR1_VH_SHIFT) +#define ID_AA64MMFR1_VH_IMPL (UL(0x1) << ID_AA64MMFR1_VH_SHIFT) #define ID_AA64MMFR1_HPDS_SHIFT 12 -#define ID_AA64MMFR1_HPDS_MASK (0xf << ID_AA64MMFR1_HPDS_SHIFT) +#define ID_AA64MMFR1_HPDS_MASK (UL(0xf) << ID_AA64MMFR1_HPDS_SHIFT) #define ID_AA64MMFR1_HPDS(x) ((x) & ID_AA64MMFR1_HPDS_MASK) -#define ID_AA64MMFR1_HPDS_NONE (0x0 << ID_AA64MMFR1_HPDS_SHIFT) -#define ID_AA64MMFR1_HPDS_HPD (0x1 << ID_AA64MMFR1_HPDS_SHIFT) -#define ID_AA64MMFR1_HPDS_TTPBHA (0x2 << ID_AA64MMFR1_HPDS_SHIFT) +#define ID_AA64MMFR1_HPDS_NONE (UL(0x0) << ID_AA64MMFR1_HPDS_SHIFT) +#define ID_AA64MMFR1_HPDS_HPD (UL(0x1) << ID_AA64MMFR1_HPDS_SHIFT) +#define ID_AA64MMFR1_HPDS_TTPBHA (UL(0x2) << ID_AA64MMFR1_HPDS_SHIFT) #define ID_AA64MMFR1_LO_SHIFT 16 -#define ID_AA64MMFR1_LO_MASK (0xf << ID_AA64MMFR1_LO_SHIFT) +#define ID_AA64MMFR1_LO_MASK (UL(0xf) << ID_AA64MMFR1_LO_SHIFT) #define ID_AA64MMFR1_LO(x) ((x) & ID_AA64MMFR1_LO_MASK) -#define ID_AA64MMFR1_LO_NONE (0x0 << ID_AA64MMFR1_LO_SHIFT) -#define ID_AA64MMFR1_LO_IMPL (0x1 << ID_AA64MMFR1_LO_SHIFT) +#define ID_AA64MMFR1_LO_NONE (UL(0x0) << ID_AA64MMFR1_LO_SHIFT) +#define ID_AA64MMFR1_LO_IMPL (UL(0x1) << ID_AA64MMFR1_LO_SHIFT) #define ID_AA64MMFR1_PAN_SHIFT 20 -#define ID_AA64MMFR1_PAN_MASK (0xf << ID_AA64MMFR1_PAN_SHIFT) +#define ID_AA64MMFR1_PAN_MASK (UL(0xf) << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_PAN(x) ((x) & ID_AA64MMFR1_PAN_MASK) -#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_PAN_NONE (UL(0x0) << ID_AA64MMFR1_PAN_SHIFT) +#define ID_AA64MMFR1_PAN_IMPL (UL(0x1) << ID_AA64MMFR1_PAN_SHIFT) +#define ID_AA64MMFR1_PAN_ATS1E1 (UL(0x2) << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_SpecSEI_SHIFT 24 -#define ID_AA64MMFR1_SpecSEI_MASK (0xf << ID_AA64MMFR1_SpecSEI_SHIFT) +#define ID_AA64MMFR1_SpecSEI_MASK (UL(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_SpecSEI_NONE (UL(0x0) << ID_AA64MMFR1_SpecSEI_SHIFT) +#define ID_AA64MMFR1_SpecSEI_IMPL (UL(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_MASK (UL(0xf) << ID_AA64MMFR1_XNX_SHIFT) #define ID_AA64MMFR1_XNX(x) ((x) & ID_AA64MMFR1_XNX_MASK) -#define ID_AA64MMFR1_XNX_NONE (0x0 << ID_AA64MMFR1_XNX_SHIFT) -#define ID_AA64MMFR1_XNX_IMPL (0x1 << ID_AA64MMFR1_XNX_SHIFT) +#define ID_AA64MMFR1_XNX_NONE (UL(0x0) << ID_AA64MMFR1_XNX_SHIFT) +#define ID_AA64MMFR1_XNX_IMPL (UL(0x1) << ID_AA64MMFR1_XNX_SHIFT) /* 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_MASK (UL(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_NONE (UL(0x0) << ID_AA64MMFR2_CnP_SHIFT) +#define ID_AA64MMFR2_CnP_IMPL (UL(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_MASK (UL(0xf) << ID_AA64MMFR2_UAO_SHIFT) #define ID_AA64MMFR2_UAO(x) ((x) & ID_AA64MMFR2_UAO_MASK) -#define ID_AA64MMFR2_UAO_NONE (0x0 << ID_AA64MMFR2_UAO_SHIFT) -#define ID_AA64MMFR2_UAO_IMPL (0x1 << ID_AA64MMFR2_UAO_SHIFT) +#define ID_AA64MMFR2_UAO_NONE (UL(0x0) << ID_AA64MMFR2_UAO_SHIFT) +#define ID_AA64MMFR2_UAO_IMPL (UL(0x1) << ID_AA64MMFR2_UAO_SHIFT) #define ID_AA64MMFR2_LSM_SHIFT 8 -#define ID_AA64MMFR2_LSM_MASK (0xf << ID_AA64MMFR2_LSM_SHIFT) +#define ID_AA64MMFR2_LSM_MASK (UL(0xf) << ID_AA64MMFR2_LSM_SHIFT) #define ID_AA64MMFR2_LSM(x) ((x) & ID_AA64MMFR2_LSM_MASK) -#define ID_AA64MMFR2_LSM_NONE (0x0 << ID_AA64MMFR2_LSM_SHIFT) -#define ID_AA64MMFR2_LSM_IMPL (0x1 << ID_AA64MMFR2_LSM_SHIFT) +#define ID_AA64MMFR2_LSM_NONE (UL(0x0) << ID_AA64MMFR2_LSM_SHIFT) +#define ID_AA64MMFR2_LSM_IMPL (UL(0x1) << ID_AA64MMFR2_LSM_SHIFT) #define ID_AA64MMFR2_IESB_SHIFT 12 -#define ID_AA64MMFR2_IESB_MASK (0xf << ID_AA64MMFR2_IESB_SHIFT) +#define ID_AA64MMFR2_IESB_MASK (UL(0xf) << ID_AA64MMFR2_IESB_SHIFT) #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_IESB_NONE (UL(0x0) << ID_AA64MMFR2_IESB_SHIFT) +#define ID_AA64MMFR2_IESB_IMPL (UL(0x1) << ID_AA64MMFR2_IESB_SHIFT) #define ID_AA64MMFR2_VARange_SHIFT 16 -#define ID_AA64MMFR2_VARange_MASK (0xf << ID_AA64MMFR2_VARange_SHIFT) +#define ID_AA64MMFR2_VARange_MASK (UL(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_VARange_48 (UL(0x0) << ID_AA64MMFR2_VARange_SHIFT) +#define ID_AA64MMFR2_VARange_52 (UL(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_MASK (UL(0xf) << ID_AA64MMFR2_CCIDX_SHIFT) #define ID_AA64MMFR2_CCIDX(x) ((x) & ID_AA64MMFR2_CCIDX_MASK) -#define ID_AA64MMFR2_CCIDX_32 (0x0 << ID_AA64MMFR2_CCIDX_SHIFT) -#define ID_AA64MMFR2_CCIDX_64 (0x1 << ID_AA64MMFR2_CCIDX_SHIFT) +#define ID_AA64MMFR2_CCIDX_32 (UL(0x0) << ID_AA64MMFR2_CCIDX_SHIFT) +#define ID_AA64MMFR2_CCIDX_64 (UL(0x1) << ID_AA64MMFR2_CCIDX_SHIFT) #define ID_AA64MMFR2_NV_SHIFT 24 -#define ID_AA64MMFR2_NV_MASK (0xf << ID_AA64MMFR2_NV_SHIFT) +#define ID_AA64MMFR2_NV_MASK (UL(0xf) << ID_AA64MMFR2_NV_SHIFT) #define ID_AA64MMFR2_NV(x) ((x) & ID_AA64MMFR2_NV_MASK) -#define ID_AA64MMFR2_NV_NONE (0x0 << ID_AA64MMFR2_NV_SHIFT) -#define ID_AA64MMFR2_NV_IMPL (0x1 << ID_AA64MMFR2_NV_SHIFT) +#define ID_AA64MMFR2_NV_NONE (UL(0x0) << ID_AA64MMFR2_NV_SHIFT) +#define ID_AA64MMFR2_NV_IMPL (UL(0x1) << ID_AA64MMFR2_NV_SHIFT) /* ID_AA64PFR0_EL1 */ #define ID_AA64PFR0_MASK 0x0000000ffffffffful #define ID_AA64PFR0_EL0_SHIFT 0 -#define ID_AA64PFR0_EL0_MASK (0xf << ID_AA64PFR0_EL0_SHIFT) +#define ID_AA64PFR0_EL0_MASK (UL(0xf) << ID_AA64PFR0_EL0_SHIFT) #define ID_AA64PFR0_EL0(x) ((x) & ID_AA64PFR0_EL0_MASK) -#define ID_AA64PFR0_EL0_64 (1 << ID_AA64PFR0_EL0_SHIFT) -#define ID_AA64PFR0_EL0_64_32 (2 << ID_AA64PFR0_EL0_SHIFT) +#define ID_AA64PFR0_EL0_64 (UL(0x1) << ID_AA64PFR0_EL0_SHIFT) +#define ID_AA64PFR0_EL0_64_32 (UL(0x2) << ID_AA64PFR0_EL0_SHIFT) #define ID_AA64PFR0_EL1_SHIFT 4 -#define ID_AA64PFR0_EL1_MASK (0xf << ID_AA64PFR0_EL1_SHIFT) +#define ID_AA64PFR0_EL1_MASK (UL(0xf) << ID_AA64PFR0_EL1_SHIFT) #define ID_AA64PFR0_EL1(x) ((x) & ID_AA64PFR0_EL1_MASK) -#define ID_AA64PFR0_EL1_64 (1 << ID_AA64PFR0_EL1_SHIFT) -#define ID_AA64PFR0_EL1_64_32 (2 << ID_AA64PFR0_EL1_SHIFT) +#define ID_AA64PFR0_EL1_64 (UL(0x1) << ID_AA64PFR0_EL1_SHIFT) +#define ID_AA64PFR0_EL1_64_32 (UL(0x2) << ID_AA64PFR0_EL1_SHIFT) #define ID_AA64PFR0_EL2_SHIFT 8 -#define ID_AA64PFR0_EL2_MASK (0xf << ID_AA64PFR0_EL2_SHIFT) +#define ID_AA64PFR0_EL2_MASK (UL(0xf) << ID_AA64PFR0_EL2_SHIFT) #define ID_AA64PFR0_EL2(x) ((x) & ID_AA64PFR0_EL2_MASK) -#define ID_AA64PFR0_EL2_NONE (0 << ID_AA64PFR0_EL2_SHIFT) -#define ID_AA64PFR0_EL2_64 (1 << ID_AA64PFR0_EL2_SHIFT) -#define ID_AA64PFR0_EL2_64_32 (2 << ID_AA64PFR0_EL2_SHIFT) +#define ID_AA64PFR0_EL2_NONE (UL(0x0) << ID_AA64PFR0_EL2_SHIFT) +#define ID_AA64PFR0_EL2_64 (UL(0x1) << ID_AA64PFR0_EL2_SHIFT) +#define ID_AA64PFR0_EL2_64_32 (UL(0x2) << ID_AA64PFR0_EL2_SHIFT) #define ID_AA64PFR0_EL3_SHIFT 12 -#define ID_AA64PFR0_EL3_MASK (0xf << ID_AA64PFR0_EL3_SHIFT) +#define ID_AA64PFR0_EL3_MASK (UL(0xf) << ID_AA64PFR0_EL3_SHIFT) #define ID_AA64PFR0_EL3(x) ((x) & ID_AA64PFR0_EL3_MASK) -#define ID_AA64PFR0_EL3_NONE (0 << ID_AA64PFR0_EL3_SHIFT) -#define ID_AA64PFR0_EL3_64 (1 << ID_AA64PFR0_EL3_SHIFT) -#define ID_AA64PFR0_EL3_64_32 (2 << ID_AA64PFR0_EL3_SHIFT) +#define ID_AA64PFR0_EL3_NONE (UL(0x0) << ID_AA64PFR0_EL3_SHIFT) +#define ID_AA64PFR0_EL3_64 (UL(0x1) << ID_AA64PFR0_EL3_SHIFT) +#define ID_AA64PFR0_EL3_64_32 (UL(0x2) << ID_AA64PFR0_EL3_SHIFT) #define ID_AA64PFR0_FP_SHIFT 16 -#define ID_AA64PFR0_FP_MASK (0xf << ID_AA64PFR0_FP_SHIFT) +#define ID_AA64PFR0_FP_MASK (UL(0xf) << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_FP(x) ((x) & ID_AA64PFR0_FP_MASK) -#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_FP_IMPL (UL(0x0) << ID_AA64PFR0_FP_SHIFT) +#define ID_AA64PFR0_FP_HP (UL(0x1) << ID_AA64PFR0_FP_SHIFT) +#define ID_AA64PFR0_FP_NONE (UL(0xf) << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_AdvSIMD_SHIFT 20 -#define ID_AA64PFR0_AdvSIMD_MASK (0xf << ID_AA64PFR0_AdvSIMD_SHIFT) +#define ID_AA64PFR0_AdvSIMD_MASK (UL(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_AdvSIMD_IMPL (UL(0x0) << ID_AA64PFR0_AdvSIMD_SHIFT) +#define ID_AA64PFR0_AdvSIMD_HP (UL(0x1) << ID_AA64PFR0_AdvSIMD_SHIFT) +#define ID_AA64PFR0_AdvSIMD_NONE (UL(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) +#define ID_AA64PFR0_GIC_MASK (UL(0xf) << ID_AA64PFR0_GIC_SHIFT) #define ID_AA64PFR0_GIC(x) ((x) & ID_AA64PFR0_GIC_MASK) -#define ID_AA64PFR0_GIC_CPUIF_NONE (0x0 << ID_AA64PFR0_GIC_SHIFT) -#define ID_AA64PFR0_GIC_CPUIF_EN (0x1 << ID_AA64PFR0_GIC_SHIFT) +#define ID_AA64PFR0_GIC_CPUIF_NONE (UL(0x0) << ID_AA64PFR0_GIC_SHIFT) +#define ID_AA64PFR0_GIC_CPUIF_EN (UL(0x1) << ID_AA64PFR0_GIC_SHIFT) #define ID_AA64PFR0_RAS_SHIFT 28 -#define ID_AA64PFR0_RAS_MASK (0xf << ID_AA64PFR0_RAS_SHIFT) +#define ID_AA64PFR0_RAS_MASK (UL(0xf) << ID_AA64PFR0_RAS_SHIFT) #define ID_AA64PFR0_RAS(x) ((x) & ID_AA64PFR0_RAS_MASK) -#define ID_AA64PFR0_RAS_NONE (0x0 << ID_AA64PFR0_RAS_SHIFT) -#define ID_AA64PFR0_RAS_V1 (0x1 << ID_AA64PFR0_RAS_SHIFT) +#define ID_AA64PFR0_RAS_NONE (UL(0x0) << ID_AA64PFR0_RAS_SHIFT) +#define ID_AA64PFR0_RAS_V1 (UL(0x1) << ID_AA64PFR0_RAS_SHIFT) #define ID_AA64PFR0_SVE_SHIFT 32 -#define ID_AA64PFR0_SVE_MASK (0xful << ID_AA64PFR0_SVE_SHIFT) +#define ID_AA64PFR0_SVE_MASK (UL(0xf) << ID_AA64PFR0_SVE_SHIFT) #define ID_AA64PFR0_SVE(x) ((x) & ID_AA64PFR0_SVE_MASK) -#define ID_AA64PFR0_SVE_NONE (0x0ul << ID_AA64PFR0_SVE_SHIFT) -#define ID_AA64PFR0_SVE_IMPL (0x1ul << ID_AA64PFR0_SVE_SHIFT) +#define ID_AA64PFR0_SVE_NONE (UL(0x0) << ID_AA64PFR0_SVE_SHIFT) +#define ID_AA64PFR0_SVE_IMPL (UL(0x1) << ID_AA64PFR0_SVE_SHIFT) /* MAIR_EL1 - Memory Attribute Indirection Register */ #define MAIR_ATTR_MASK(idx) (0xff << ((n)* 8)) From owner-svn-src-all@freebsd.org Tue Jul 23 14:52: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 62BEAAB7EC; Tue, 23 Jul 2019 14:52:47 +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 45C00949D8; Tue, 23 Jul 2019 14:52:47 +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 05899274BF; Tue, 23 Jul 2019 14:52:47 +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 x6NEqkbj091014; Tue, 23 Jul 2019 14:52:46 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NEqkWK091013; Tue, 23 Jul 2019 14:52:46 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201907231452.x6NEqkWK091013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 23 Jul 2019 14:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350242 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 350242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45C00949D8 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.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: Tue, 23 Jul 2019 14:52:47 -0000 Author: andrew Date: Tue Jul 23 14:52:46 2019 New Revision: 350242 URL: https://svnweb.freebsd.org/changeset/base/350242 Log: As with r350241 use the new UL macro on the main register mask. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/arm64/include/armreg.h Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Tue Jul 23 14:40:37 2019 (r350241) +++ head/sys/arm64/include/armreg.h Tue Jul 23 14:52:46 2019 (r350242) @@ -176,7 +176,7 @@ #define ICC_SRE_EL2_EN (1U << 3) /* ID_AA64DFR0_EL1 */ -#define ID_AA64DFR0_MASK 0x0000000ff0f0fffful +#define ID_AA64DFR0_MASK UL(0x0000000ff0f0ffff) #define ID_AA64DFR0_DebugVer_SHIFT 0 #define ID_AA64DFR0_DebugVer_MASK (UL(0xf) << ID_AA64DFR0_DebugVer_SHIFT) #define ID_AA64DFR0_DebugVer(x) ((x) & ID_AA64DFR0_DebugVer_MASK) @@ -214,7 +214,7 @@ #define ID_AA64DFR0_PMSVer_V1 (UL(0x1) << ID_AA64DFR0_PMSVer_SHIFT) /* ID_AA64ISAR0_EL1 */ -#define ID_AA64ISAR0_MASK 0x0000fffff0fffff0ul +#define ID_AA64ISAR0_MASK UL(0x0000fffff0fffff0) #define ID_AA64ISAR0_AES_SHIFT 4 #define ID_AA64ISAR0_AES_MASK (UL(0xf) << ID_AA64ISAR0_AES_SHIFT) #define ID_AA64ISAR0_AES(x) ((x) & ID_AA64ISAR0_AES_MASK) @@ -269,7 +269,7 @@ #define ID_AA64ISAR0_DP_IMPL (UL(0x1) << ID_AA64ISAR0_DP_SHIFT) /* ID_AA64ISAR1_EL1 */ -#define ID_AA64ISAR1_MASK 0xffffffff +#define ID_AA64ISAR1_MASK UL(0x00000000ffffffff) #define ID_AA64ISAR1_DPB_SHIFT 0 #define ID_AA64ISAR1_DPB_MASK (UL(0xf) << ID_AA64ISAR1_DPB_SHIFT) #define ID_AA64ISAR1_DPB(x) ((x) & ID_AA64ISAR1_DPB_MASK) @@ -312,7 +312,7 @@ #define ID_AA64ISAR1_GPI_IMPL (UL(0x1) << ID_AA64ISAR1_GPI_SHIFT) /* ID_AA64MMFR0_EL1 */ -#define ID_AA64MMFR0_MASK 0xffffffff +#define ID_AA64MMFR0_MASK UL(0x00000000ffffffff) #define ID_AA64MMFR0_PARange_SHIFT 0 #define ID_AA64MMFR0_PARange_MASK (UL(0xf) << ID_AA64MMFR0_PARange_SHIFT) #define ID_AA64MMFR0_PARange(x) ((x) & ID_AA64MMFR0_PARange_MASK) @@ -360,7 +360,7 @@ #define ID_AA64MMFR0_TGran4_NONE (UL(0xf) << ID_AA64MMFR0_TGran4_SHIFT) /* ID_AA64MMFR1_EL1 */ -#define ID_AA64MMFR1_MASK 0xffffffff +#define ID_AA64MMFR1_MASK UL(0x00000000ffffffff) #define ID_AA64MMFR1_HAFDBS_SHIFT 0 #define ID_AA64MMFR1_HAFDBS_MASK (UL(0xf) << ID_AA64MMFR1_HAFDBS_SHIFT) #define ID_AA64MMFR1_HAFDBS(x) ((x) & ID_AA64MMFR1_HAFDBS_MASK) @@ -407,7 +407,7 @@ /* ID_AA64MMFR2_EL1 */ #define ID_AA64MMFR2_EL1 S3_0_C0_C7_2 -#define ID_AA64MMFR2_MASK 0x0fffffff +#define ID_AA64MMFR2_MASK UL(0x000000000fffffff) #define ID_AA64MMFR2_CnP_SHIFT 0 #define ID_AA64MMFR2_CnP_MASK (UL(0xf) << ID_AA64MMFR2_CnP_SHIFT) #define ID_AA64MMFR2_CnP(x) ((x) & ID_AA64MMFR2_CnP_MASK) @@ -445,7 +445,7 @@ #define ID_AA64MMFR2_NV_IMPL (UL(0x1) << ID_AA64MMFR2_NV_SHIFT) /* ID_AA64PFR0_EL1 */ -#define ID_AA64PFR0_MASK 0x0000000ffffffffful +#define ID_AA64PFR0_MASK UL(0x0000000fffffffff) #define ID_AA64PFR0_EL0_SHIFT 0 #define ID_AA64PFR0_EL0_MASK (UL(0xf) << ID_AA64PFR0_EL0_SHIFT) #define ID_AA64PFR0_EL0(x) ((x) & ID_AA64PFR0_EL0_MASK) From owner-svn-src-all@freebsd.org Tue Jul 23 16:11: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 5F0B8AD3A6; Tue, 23 Jul 2019 16:11:39 +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 3FACF977E4; Tue, 23 Jul 2019 16:11:39 +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 14A723D0; Tue, 23 Jul 2019 16:11: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 x6NGBc9J034131; Tue, 23 Jul 2019 16:11:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NGBcqU034130; Tue, 23 Jul 2019 16:11:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907231611.x6NGBcqU034130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 23 Jul 2019 16:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350243 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 350243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3FACF977E4 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.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, 23 Jul 2019 16:11:39 -0000 Author: kib Date: Tue Jul 23 16:11:38 2019 New Revision: 350243 URL: https://svnweb.freebsd.org/changeset/base/350243 Log: Update refcount(9). Describe missed functions. Give some hint about refcount_release(9) memory ordering guarantees. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21020 Modified: head/share/man/man9/refcount.9 Modified: head/share/man/man9/refcount.9 ============================================================================== --- head/share/man/man9/refcount.9 Tue Jul 23 14:52:46 2019 (r350242) +++ head/share/man/man9/refcount.9 Tue Jul 23 16:11:38 2019 (r350243) @@ -3,6 +3,12 @@ .\" Written by: John H. Baldwin .\" All rights reserved. .\" +.\" Copyright (c) 2019 The FreeBSD Foundation, Inc. +.\" +.\" Parts of this documentation was written by +.\" Konstantin Belousov 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: @@ -26,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2019 +.Dd July 23, 2019 .Dt REFCOUNT 9 .Os .Sh NAME @@ -43,7 +49,13 @@ .Ft void .Fn refcount_acquire "volatile u_int *count" .Ft bool +.Fn refcount_acquire_checked "volatile u_int *count" +.Ft bool +.Fn refcount_acquire_if_not_zero "volatile u_int *count" +.Ft bool .Fn refcount_release "volatile u_int *count" +.Ft bool +.Fn refcount_release_if_not_last "volatile u_int *count" .Sh DESCRIPTION The .Nm @@ -54,6 +66,8 @@ A pointer to this integer is passed via Usually the counter is used to manage the lifetime of an object and is stored as a member of the object. .Pp +Currently all functions are implemented as static inline. +.Pp The .Fn refcount_init function is used to set the initial value of the counter to @@ -71,21 +85,75 @@ object, then holding a lock that protects the list pro protection for acquiring a new reference. .Pp The +.Fn refcount_acquire_checked +variant performs the same operation as +.Fn refcount_acquire , +but additionally checks that the +.Fa count +value does not overflow as result of the operation. +It returns +.Dv true +if the reference was sucessfully obtained, and +.Dv false +if it was not, due to the overflow. +.Pp +The +.Fn refcount_acquire_if_not_zero +function is yet another variant of +.Fn refcount_acquire , +which only obtains the reference when some reference already exists. +In other words, +.Fa *count +must be already greater than zero for the function to succeed, in which +case the return value is +.Dv true , +otherwise +.Dv false +is returned. +.Pp +The .Fn refcount_release function is used to release an existing reference. The function returns true if the reference being released was the last reference; otherwise, it returns false. .Pp -Note that these routines do not provide any inter-CPU synchronization, -data protection, -or memory ordering guarantees except for managing the counter. +The +.Fn refcount_release_if_not_last +is a variant of +.Fn refcount_release +which only drops the reference when it is not the last reference. +In other words, the function returns +.Dv true +when +.Fa *count +is greater than one, in which case +.Fa *count is decremented. +Otherwise, if +.Fa *count +is equal to one, the reference is not released and the function returns +.Dv false . +.Pp +Note that these routines do not provide any inter-CPU synchronization or +data protection for managing the counter. The caller is responsible for any additional synchronization needed by consumers of any containing objects. In addition, the caller is also responsible for managing the life cycle of any containing objects including explicitly releasing any resources when the last reference is released. +.Pp +The +.Fn refcount_release +unconditionally executes a release fence (see +.Xr atomic 9 ) before releasing the reference, which +synchronizes with an acquire fence executed right before +returning the +.Dv true +value. +This ensures that the destructor, supposedly executed by the caller after +the last reference was dropped, sees all updates done during the lifetime +of the object. .Sh RETURN VALUES The .Nm refcount_release From owner-svn-src-all@freebsd.org Tue Jul 23 16:27: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 56F17ADB5C; Tue, 23 Jul 2019 16:27:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 381A06A1D9; Tue, 23 Jul 2019 16:27:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13342628; Tue, 23 Jul 2019 16:27:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NGRa55046543; Tue, 23 Jul 2019 16:27:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NGRa1C046542; Tue, 23 Jul 2019 16:27:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907231627.x6NGRa1C046542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Jul 2019 16:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350244 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 350244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 381A06A1D9 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.973,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, 23 Jul 2019 16:27:37 -0000 Author: emaste Date: Tue Jul 23 16:27:36 2019 New Revision: 350244 URL: https://svnweb.freebsd.org/changeset/base/350244 Log: bhyve: correct out-of-bounds read in XHCI device emulation Add appropriate bounds checks on the epid and streamid fields in the device doorbell registers. admbugs: 919 Submitted by: jhb Reported by: Reno Robert Reviewed by: markj Approved by: so Security: out-of-bounds read Modified: head/usr.sbin/bhyve/pci_xhci.c Modified: head/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- head/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 16:11:38 2019 (r350243) +++ head/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 16:27:36 2019 (r350244) @@ -1900,6 +1900,11 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui return; } + if (epid == 0 || epid >= XHCI_MAX_ENDPOINTS) { + DPRINTF(("pci_xhci: invalid endpoint %u\r\n", epid)); + return; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); @@ -1925,6 +1930,23 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui /* get next trb work item */ if (XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0) != 0) { + struct xhci_stream_ctx *sctx; + + /* + * Stream IDs of 0, 65535 (any stream), and 65534 + * (prime) are invalid. + */ + if (streamid == 0 || streamid == 65534 || streamid == 65535) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } + + sctx = NULL; + pci_xhci_find_stream(sc, ep_ctx, streamid, &sctx); + if (sctx == NULL) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } sctx_tr = &devep->ep_sctx_trbs[streamid]; ringaddr = sctx_tr->ringaddr; ccs = sctx_tr->ccs; @@ -1933,6 +1955,10 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui streamid, ep_ctx->qwEpCtx2 & XHCI_TRB_3_CYCLE_BIT, trb->dwTrb3 & XHCI_TRB_3_CYCLE_BIT)); } else { + if (streamid != 0) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } ringaddr = devep->ep_ringaddr; ccs = devep->ep_ccs; trb = devep->ep_tr; From owner-svn-src-all@freebsd.org Tue Jul 23 16:28: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 021CFADBB8; Tue, 23 Jul 2019 16:28:18 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 A68776A34B; Tue, 23 Jul 2019 16:28:17 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81C0462F; Tue, 23 Jul 2019 16:28:17 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NGSHmO046621; Tue, 23 Jul 2019 16:28:17 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NGSHvc046620; Tue, 23 Jul 2019 16:28:17 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201907231628.x6NGSHvc046620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Tue, 23 Jul 2019 16:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350245 - head/usr.sbin/pciconf X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/usr.sbin/pciconf X-SVN-Commit-Revision: 350245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A68776A34B 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.973,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, 23 Jul 2019 16:28:18 -0000 Author: gallatin Date: Tue Jul 23 16:28:17 2019 New Revision: 350245 URL: https://svnweb.freebsd.org/changeset/base/350245 Log: pciconf: report PCI Gen4 speeds PCIe gen4 runs at 16GT/s. Report this as the speed of Gen4 links. Reviewed by: imp MFC after: 7 days Sponsored by: Netflix Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Tue Jul 23 16:27:36 2019 (r350244) +++ head/usr.sbin/pciconf/cap.c Tue Jul 23 16:28:17 2019 (r350245) @@ -389,6 +389,8 @@ link_speed_string(uint8_t speed) return ("5.0"); case 3: return ("8.0"); + case 4: + return ("16.0"); default: return ("undef"); } From owner-svn-src-all@freebsd.org Tue Jul 23 17:48: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 E2926AEFCE; Tue, 23 Jul 2019 17:48:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 C249C6CE92; Tue, 23 Jul 2019 17:48:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 905511498; Tue, 23 Jul 2019 17:48:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NHmb1I094202; Tue, 23 Jul 2019 17:48:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NHmbCL094201; Tue, 23 Jul 2019 17:48:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907231748.x6NHmbCL094201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Jul 2019 17:48:37 +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: r350246 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 350246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C249C6CE92 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.971,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, 23 Jul 2019 17:48:38 -0000 Author: emaste Date: Tue Jul 23 17:48:37 2019 New Revision: 350246 URL: https://svnweb.freebsd.org/changeset/base/350246 Log: MFC r350244: bhyve: correct out-of-bounds read in XHCI device emulation Add appropriate bounds checks on the epid and streamid fields in the device doorbell registers. admbugs: 919 Submitted by: jhb Reported by: Reno Robert Reviewed by: markj Approved by: so Security: out-of-bounds read Modified: stable/12/usr.sbin/bhyve/pci_xhci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 16:28:17 2019 (r350245) +++ stable/12/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 17:48:37 2019 (r350246) @@ -1900,6 +1900,11 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui return; } + if (epid == 0 || epid >= XHCI_MAX_ENDPOINTS) { + DPRINTF(("pci_xhci: invalid endpoint %u\r\n", epid)); + return; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); @@ -1925,6 +1930,23 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui /* get next trb work item */ if (XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0) != 0) { + struct xhci_stream_ctx *sctx; + + /* + * Stream IDs of 0, 65535 (any stream), and 65534 + * (prime) are invalid. + */ + if (streamid == 0 || streamid == 65534 || streamid == 65535) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } + + sctx = NULL; + pci_xhci_find_stream(sc, ep_ctx, streamid, &sctx); + if (sctx == NULL) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } sctx_tr = &devep->ep_sctx_trbs[streamid]; ringaddr = sctx_tr->ringaddr; ccs = sctx_tr->ccs; @@ -1933,6 +1955,10 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui streamid, ep_ctx->qwEpCtx2 & XHCI_TRB_3_CYCLE_BIT, trb->dwTrb3 & XHCI_TRB_3_CYCLE_BIT)); } else { + if (streamid != 0) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } ringaddr = devep->ep_ringaddr; ccs = devep->ep_ccs; trb = devep->ep_tr; From owner-svn-src-all@freebsd.org Tue Jul 23 17:48: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 13F4CAEFD2; Tue, 23 Jul 2019 17:48:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 EA3426CE93; Tue, 23 Jul 2019 17:48:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6D8E1499; Tue, 23 Jul 2019 17:48:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NHmbob094212; Tue, 23 Jul 2019 17:48:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NHmbLt094211; Tue, 23 Jul 2019 17:48:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907231748.x6NHmbLt094211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Jul 2019 17:48:37 +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: r350247 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 350247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA3426CE93 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.971,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, 23 Jul 2019 17:48:38 -0000 Author: emaste Date: Tue Jul 23 17:48:37 2019 New Revision: 350247 URL: https://svnweb.freebsd.org/changeset/base/350247 Log: MFC r350244: bhyve: correct out-of-bounds read in XHCI device emulation Add appropriate bounds checks on the epid and streamid fields in the device doorbell registers. admbugs: 919 Submitted by: jhb Reported by: Reno Robert Reviewed by: markj Approved by: so Security: out-of-bounds read Modified: stable/11/usr.sbin/bhyve/pci_xhci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 17:48:37 2019 (r350246) +++ stable/11/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 17:48:37 2019 (r350247) @@ -1900,6 +1900,11 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui return; } + if (epid == 0 || epid >= XHCI_MAX_ENDPOINTS) { + DPRINTF(("pci_xhci: invalid endpoint %u\r\n", epid)); + return; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); @@ -1925,6 +1930,23 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui /* get next trb work item */ if (XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0) != 0) { + struct xhci_stream_ctx *sctx; + + /* + * Stream IDs of 0, 65535 (any stream), and 65534 + * (prime) are invalid. + */ + if (streamid == 0 || streamid == 65534 || streamid == 65535) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } + + sctx = NULL; + pci_xhci_find_stream(sc, ep_ctx, streamid, &sctx); + if (sctx == NULL) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } sctx_tr = &devep->ep_sctx_trbs[streamid]; ringaddr = sctx_tr->ringaddr; ccs = sctx_tr->ccs; @@ -1933,6 +1955,10 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui streamid, ep_ctx->qwEpCtx2 & XHCI_TRB_3_CYCLE_BIT, trb->dwTrb3 & XHCI_TRB_3_CYCLE_BIT)); } else { + if (streamid != 0) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } ringaddr = devep->ep_ringaddr; ccs = devep->ep_ccs; trb = devep->ep_tr; From owner-svn-src-all@freebsd.org Tue Jul 23 18:07: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 587C7AF594; Tue, 23 Jul 2019 18:07:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 3AD616DD17; Tue, 23 Jul 2019 18:07:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BE4B1849; Tue, 23 Jul 2019 18:07:37 +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 x6NI7aoR006768; Tue, 23 Jul 2019 18:07:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NI7aP9006767; Tue, 23 Jul 2019 18:07:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907231807.x6NI7aP9006767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 23 Jul 2019 18:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350248 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 350248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3AD616DD17 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.951,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, 23 Jul 2019 18:07:37 -0000 Author: tuexen Date: Tue Jul 23 18:07:36 2019 New Revision: 350248 URL: https://svnweb.freebsd.org/changeset/base/350248 Log: Fix a LOR in SCTP which was found by running syzkaller. Submitted by: rrs@ Reported by: markj@ MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue Jul 23 17:48:37 2019 (r350247) +++ head/sys/netinet/sctp_usrreq.c Tue Jul 23 18:07:36 2019 (r350248) @@ -965,9 +965,9 @@ sctp_shutdown(struct socket *so) abort_anyway: op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6; + SCTP_INP_RUNLOCK(inp); sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_LOCKED); - SCTP_INP_RUNLOCK(inp); return (0); } } From owner-svn-src-all@freebsd.org Tue Jul 23 18: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 7B152AF5BC; Tue, 23 Jul 2019 18:07:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 53CBF6DDD4; Tue, 23 Jul 2019 18:07:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABF4F184A; Tue, 23 Jul 2019 18:07:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NI7iG8006826; Tue, 23 Jul 2019 18:07:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NI7iwr006824; Tue, 23 Jul 2019 18:07:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907231807.x6NI7iwr006824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Jul 2019 18:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350249 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 350249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 53CBF6DDD4 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.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: Tue, 23 Jul 2019 18:07:56 -0000 Author: emaste Date: Tue Jul 23 18:07:44 2019 New Revision: 350249 URL: https://svnweb.freebsd.org/changeset/base/350249 Log: MFC r349915 (seanc): usr.sbin/bhyve: initialize return value ... ... in xhci device interrupt handler Coverity CID: 1357340 Modified: stable/12/usr.sbin/bhyve/pci_xhci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 18:07:36 2019 (r350248) +++ stable/12/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 18:07:44 2019 (r350249) @@ -2570,7 +2570,7 @@ pci_xhci_dev_intr(struct usb_hci *hci, int epctx) struct pci_xhci_softc *sc; struct pci_xhci_portregs *p; struct xhci_endp_ctx *ep_ctx; - int error; + int error = 0; int dir_in; int epid; From owner-svn-src-all@freebsd.org Tue Jul 23 18:08: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 A108AAF637; Tue, 23 Jul 2019 18:08:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 799376DF8C; Tue, 23 Jul 2019 18:08:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 511D5184B; Tue, 23 Jul 2019 18:08:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NI8NhK006915; Tue, 23 Jul 2019 18:08:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NI8N3t006914; Tue, 23 Jul 2019 18:08:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907231808.x6NI8N3t006914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Jul 2019 18:08: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: r350250 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 350250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 799376DF8C 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.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: Tue, 23 Jul 2019 18:08:34 -0000 Author: emaste Date: Tue Jul 23 18:08:22 2019 New Revision: 350250 URL: https://svnweb.freebsd.org/changeset/base/350250 Log: MFC r349915 (seanc): usr.sbin/bhyve: initialize return value ... ... in xhci device interrupt handler Coverity CID: 1357340 Modified: stable/11/usr.sbin/bhyve/pci_xhci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 18:07:44 2019 (r350249) +++ stable/11/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 18:08:22 2019 (r350250) @@ -2570,7 +2570,7 @@ pci_xhci_dev_intr(struct usb_hci *hci, int epctx) struct pci_xhci_softc *sc; struct pci_xhci_portregs *p; struct xhci_endp_ctx *ep_ctx; - int error; + int error = 0; int dir_in; int epid; From owner-svn-src-all@freebsd.org Tue Jul 23 18:11: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 65F5FAF8AA; Tue, 23 Jul 2019 18:11:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 4809C6E39C; Tue, 23 Jul 2019 18:11:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAE6918B2; Tue, 23 Jul 2019 18:11:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NIBgQx010953; Tue, 23 Jul 2019 18:11:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NIBgrH010952; Tue, 23 Jul 2019 18:11:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907231811.x6NIBgrH010952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Jul 2019 18:11: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: r350251 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 350251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4809C6E39C 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.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: Tue, 23 Jul 2019 18:11:43 -0000 Author: emaste Date: Tue Jul 23 18:11:42 2019 New Revision: 350251 URL: https://svnweb.freebsd.org/changeset/base/350251 Log: bhyve: Fix resource leak when using strdup MFC r340044 (araujo): Fix resource leak when using strdup(3). MFC r344160 (rgrimes): In r340044 an attempt to quiet coverity warning cid 1357336 was incorrectly implemented leading to a possible double free. It is possible for both the conditional free, and the unconditional free added in r340044 to be done, fix that by initializing uopt to NULL, removing the conditional free, and only using the unconditional free at the end. CID: 1357336 Reported by: Coverity Modified: stable/12/usr.sbin/bhyve/pci_xhci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 18:08:22 2019 (r350250) +++ stable/12/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 18:11:42 2019 (r350251) @@ -2652,6 +2652,7 @@ pci_xhci_parse_opts(struct pci_xhci_softc *sc, char *o char *uopt, *xopts, *config; int usb3_port, usb2_port, i; + uopt = NULL; usb3_port = sc->usb3_port_start - 1; usb2_port = sc->usb2_port_start - 1; devices = NULL; @@ -2755,6 +2756,7 @@ done: free(devices); } } + free(uopt); return (sc->ndevices); } From owner-svn-src-all@freebsd.org Tue Jul 23 18:12: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 AC6F1AFA6F; Tue, 23 Jul 2019 18:12:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 658386E572; Tue, 23 Jul 2019 18:12:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3ECB71A04; Tue, 23 Jul 2019 18:12:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NICj6i012409; Tue, 23 Jul 2019 18:12:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NICjmE012408; Tue, 23 Jul 2019 18:12:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907231812.x6NICjmE012408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Jul 2019 18:12:45 +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: r350252 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 350252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 658386E572 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.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, 23 Jul 2019 18:12:45 -0000 Author: emaste Date: Tue Jul 23 18:12:44 2019 New Revision: 350252 URL: https://svnweb.freebsd.org/changeset/base/350252 Log: bhyve: Fix resource leak when using strdup MFC r340044 (araujo): Fix resource leak when using strdup(3). MFC r344160 (rgrimes): In r340044 an attempt to quiet coverity warning cid 1357336 was incorrectly implemented leading to a possible double free. It is possible for both the conditional free, and the unconditional free added in r340044 to be done, fix that by initializing uopt to NULL, removing the conditional free, and only using the unconditional free at the end. CID: 1357336 Reported by: Coverity Modified: stable/11/usr.sbin/bhyve/pci_xhci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 18:11:42 2019 (r350251) +++ stable/11/usr.sbin/bhyve/pci_xhci.c Tue Jul 23 18:12:44 2019 (r350252) @@ -2652,6 +2652,7 @@ pci_xhci_parse_opts(struct pci_xhci_softc *sc, char *o char *uopt, *xopts, *config; int usb3_port, usb2_port, i; + uopt = NULL; usb3_port = sc->usb3_port_start - 1; usb2_port = sc->usb2_port_start - 1; devices = NULL; @@ -2755,6 +2756,7 @@ done: free(devices); } } + free(uopt); return (sc->ndevices); } From owner-svn-src-all@freebsd.org Tue Jul 23 18:14: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 C27CAAFAFA; Tue, 23 Jul 2019 18:14:33 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 A30F86E705; Tue, 23 Jul 2019 18:14:33 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C00C1A16; Tue, 23 Jul 2019 18:14:33 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NIEX20012541; Tue, 23 Jul 2019 18:14:33 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NIEWLG012538; Tue, 23 Jul 2019 18:14:32 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201907231814.x6NIEWLG012538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 23 Jul 2019 18:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350253 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 350253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A30F86E705 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]; 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, 23 Jul 2019 18:14:33 -0000 Author: erj Date: Tue Jul 23 18:14:32 2019 New Revision: 350253 URL: https://svnweb.freebsd.org/changeset/base/350253 Log: ixgbe(4): Fix enabling/disabling and reconfiguration of queues - Wrong order of casting and bit shift caused that enabling and disabling queues didn't work properly for queues number larger than 32. Use literals with right suffix instead. - TX ring tail address was not updated during reinitiailzation of TX structures. It could block sending traffic. - Also remove unused variables 'eims' and 'active_queues'. Submitted by: Krzysztof Galazka Reviewed by: erj@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D20826 Modified: head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Tue Jul 23 18:12:44 2019 (r350252) +++ head/sys/dev/ixgbe/if_ix.c Tue Jul 23 18:14:32 2019 (r350253) @@ -425,7 +425,6 @@ ixgbe_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs i); txr->adapter = que->adapter = adapter; - adapter->active_queues |= (u64)1 << txr->me; /* Allocate report status array */ txr->tx_rsq = (qidx_t *)malloc(sizeof(qidx_t) * scctx->isc_ntxd[0], M_IXGBE, M_NOWAIT | M_ZERO); @@ -796,6 +795,8 @@ ixgbe_initialize_transmit_units(if_ctx_t ctx) IXGBE_WRITE_REG(hw, IXGBE_TDT(j), 0); /* Cache the tail address */ + txr->tail = IXGBE_TDT(txr->me); + txr->tx_rs_cidx = txr->tx_rs_pidx; txr->tx_cidx_processed = scctx->isc_ntxd[0] - 1; for (int k = 0; k < scctx->isc_ntxd[0]; k++) @@ -2002,7 +2003,6 @@ ixgbe_if_msix_intr_assign(if_ctx_t ctx, int msix) } rx_que->msix = vector; - adapter->active_queues |= (u64)(1 << rx_que->msix); if (adapter->feat_en & IXGBE_FEATURE_RSS) { /* * The queue ID is used as the RSS layer bucket ID. @@ -3687,7 +3687,7 @@ ixgbe_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t r struct adapter *adapter = iflib_get_softc(ctx); struct ix_rx_queue *que = &adapter->rx_queues[rxqid]; - ixgbe_enable_queue(adapter, que->rxr.me); + ixgbe_enable_queue(adapter, que->msix); return (0); } /* ixgbe_if_rx_queue_intr_enable */ @@ -3699,7 +3699,7 @@ static void ixgbe_enable_queue(struct adapter *adapter, u32 vector) { struct ixgbe_hw *hw = &adapter->hw; - u64 queue = (u64)(1 << vector); + u64 queue = 1ULL << vector; u32 mask; if (hw->mac.type == ixgbe_mac_82598EB) { @@ -3722,7 +3722,7 @@ static void ixgbe_disable_queue(struct adapter *adapter, u32 vector) { struct ixgbe_hw *hw = &adapter->hw; - u64 queue = (u64)(1 << vector); + u64 queue = 1ULL << vector; u32 mask; if (hw->mac.type == ixgbe_mac_82598EB) { Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Tue Jul 23 18:12:44 2019 (r350252) +++ head/sys/dev/ixgbe/if_ixv.c Tue Jul 23 18:14:32 2019 (r350253) @@ -268,7 +268,6 @@ ixv_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, txr->me = i; txr->adapter = que->adapter = adapter; - adapter->active_queues |= (u64)1 << txr->me; /* Allocate report status array */ if (!(txr->tx_rsq = (qidx_t *)malloc(sizeof(qidx_t) * scctx->isc_ntxd[0], M_DEVBUF, M_NOWAIT | M_ZERO))) { @@ -1038,8 +1037,6 @@ ixv_if_msix_intr_assign(if_ctx_t ctx, int msix) } rx_que->msix = vector; - adapter->active_queues |= (u64)(1 << rx_que->msix); - } for (int i = 0; i < adapter->num_tx_queues; i++) { Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Tue Jul 23 18:12:44 2019 (r350252) +++ head/sys/dev/ixgbe/ixgbe.h Tue Jul 23 18:14:32 2019 (r350253) @@ -339,7 +339,6 @@ struct rx_ring { struct ix_rx_queue { struct adapter *adapter; u32 msix; /* This queue's MSIX vector */ - u32 eims; /* This queue's EIMS bit */ u32 eitr_setting; struct resource *res; void *tag; @@ -442,7 +441,6 @@ struct adapter { */ struct ix_tx_queue *tx_queues; struct ix_rx_queue *rx_queues; - u64 active_queues; /* Multicast array memory */ struct ixgbe_mc_addr *mta; From owner-svn-src-all@freebsd.org Tue Jul 23 18:31: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 73D99AFF77; Tue, 23 Jul 2019 18:31:08 +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 4BCB46F120; Tue, 23 Jul 2019 18:31:08 +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 269FF1C21; Tue, 23 Jul 2019 18:31:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NIV82j018589; Tue, 23 Jul 2019 18:31:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NIV8bu018588; Tue, 23 Jul 2019 18:31:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907231831.x6NIV8bu018588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 23 Jul 2019 18:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350254 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 350254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4BCB46F120 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]; 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, 23 Jul 2019 18:31:08 -0000 Author: tuexen Date: Tue Jul 23 18:31:07 2019 New Revision: 350254 URL: https://svnweb.freebsd.org/changeset/base/350254 Log: Don't hold a mutex while calling sbwait. This was found by syzkaller. Submitted by: rrs@ Reported by: markj@ MFC after: 1 week Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Jul 23 18:14:32 2019 (r350253) +++ head/sys/netinet/sctp_output.c Tue Jul 23 18:31:07 2019 (r350254) @@ -13409,10 +13409,10 @@ skip_preblock: stcb, SCTP_OUTPUT_FROM_USR_SEND, SCTP_SO_LOCKED); } - if (hold_tcblock == 1) { - SCTP_TCB_UNLOCK(stcb); - hold_tcblock = 0; - } + } + if (hold_tcblock == 1) { + SCTP_TCB_UNLOCK(stcb); + hold_tcblock = 0; } SOCKBUF_LOCK(&so->so_snd); /*- From owner-svn-src-all@freebsd.org Tue Jul 23 18:40: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 1A706B0270; Tue, 23 Jul 2019 18:40:08 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 EC46E6F5C2; Tue, 23 Jul 2019 18:40:07 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE8A61DCA; Tue, 23 Jul 2019 18:40:07 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NIe7jD024814; Tue, 23 Jul 2019 18:40:07 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NIe77a024813; Tue, 23 Jul 2019 18:40:07 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201907231840.x6NIe77a024813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 23 Jul 2019 18:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350255 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 350255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC46E6F5C2 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.951,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, 23 Jul 2019 18:40:08 -0000 Author: scottl Date: Tue Jul 23 18:40:07 2019 New Revision: 350255 URL: https://svnweb.freebsd.org/changeset/base/350255 Log: Fix the register layout for the Buffer Descript List Entry. It got jumbled around during some other cleanups and was causing audio failures on some guests. PR: 239341 Reported by: shamaz.mazum@gmail.com Modified: head/usr.sbin/bhyve/pci_hda.c Modified: head/usr.sbin/bhyve/pci_hda.c ============================================================================== --- head/usr.sbin/bhyve/pci_hda.c Tue Jul 23 18:31:07 2019 (r350254) +++ head/usr.sbin/bhyve/pci_hda.c Tue Jul 23 18:40:07 2019 (r350255) @@ -80,10 +80,10 @@ typedef void (*hda_set_reg_handler)(struct hda_softc * uint32_t old); struct hda_bdle { - uint32_t addrh; uint32_t addrl; - uint32_t ioc; + uint32_t addrh; uint32_t len; + uint32_t ioc; } __packed; struct hda_bdle_desc { From owner-svn-src-all@freebsd.org Tue Jul 23 18:40: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 4251CB02E4; Tue, 23 Jul 2019 18:40:51 +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 00FC36F76A; Tue, 23 Jul 2019 18:40:36 +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 C63411DD4; Tue, 23 Jul 2019 18:40:35 +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 x6NIeZfn024910; Tue, 23 Jul 2019 18:40:35 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NIeWeq024894; Tue, 23 Jul 2019 18:40:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907231840.x6NIeWeq024894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 23 Jul 2019 18:40: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: r350256 - in stable/12: . contrib/compiler-rt/lib/sanitizer_common contrib/libunwind/src contrib/llvm/lib/DebugInfo/DWARF contrib/llvm/lib/MC contrib/llvm/lib/Object contrib/llvm/lib/Ta... X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/12: . contrib/compiler-rt/lib/sanitizer_common contrib/libunwind/src contrib/llvm/lib/DebugInfo/DWARF contrib/llvm/lib/MC contrib/llvm/lib/Object contrib/llvm/lib/Target/AArch64 contrib/llvm... X-SVN-Commit-Revision: 350256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 00FC36F76A 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.952,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, 23 Jul 2019 18:40:51 -0000 Author: dim Date: Tue Jul 23 18:40:32 2019 New Revision: 350256 URL: https://svnweb.freebsd.org/changeset/base/350256 Log: MFC r348504 (by kevans): llvm-symbolizer: Move out of CLANG_EXTRAS, into CLANG ASAN reports become a lot more useful with llvm-symbolizer in $PATH, and the build is not much more time-consuming. The added benefit is that the resulting reports will actually include symbol information; without, thread trace information includes a bunch of addresses that immediately resolve to an inline function in ^/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h and take a little more effort to examine. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D20484 MFC r349004: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp to the upstream release_80 branch r363030 (effectively, 8.0.1 rc2). The 8.0.1 release should follow this within a week or so. MFC r349351 (by jhibbits, partially): powerpc: Transition to Secure-PLT, like most other OSs (Toolchain part) Summary: Toolchain follow-up to r349350. LLVM patches will be submitted upstream for 9.0 as well. The bsd.cpu.mk change is required because GNU ld assumes BSS-PLT if it cannot determine for certain that it needs Secure-PLT, and some binaries do not compile in such a way to make it know to use Secure-PLT. Reviewed By: nwhitehorn, bdragon, pfg Differential Revision: https://reviews.freebsd.org/D20598 MFC r349793: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp to the upstream release_80 branch r364487 (effectively, 8.0.1 rc3). The 8.0.1 release will most likely have no further changes. MFC r350177: 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 Modified: stable/12/ObsoleteFiles.inc stable/12/UPDATING stable/12/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc stable/12/contrib/libunwind/src/DwarfInstructions.hpp stable/12/contrib/libunwind/src/UnwindRegistersRestore.S stable/12/contrib/libunwind/src/UnwindRegistersSave.S stable/12/contrib/libunwind/src/assembly.h stable/12/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp stable/12/contrib/llvm/lib/MC/ELFObjectWriter.cpp stable/12/contrib/llvm/lib/MC/MCWin64EH.cpp stable/12/contrib/llvm/lib/MC/WasmObjectWriter.cpp stable/12/contrib/llvm/lib/Object/COFFImportFile.cpp stable/12/contrib/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td stable/12/contrib/llvm/lib/Target/AArch64/AArch64SchedPredExynos.td stable/12/contrib/llvm/lib/Target/AArch64/AArch64SchedPredicates.td stable/12/contrib/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp stable/12/contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td stable/12/contrib/llvm/lib/Target/AVR/AVRISelLowering.cpp stable/12/contrib/llvm/lib/Target/AVR/AVRISelLowering.h stable/12/contrib/llvm/lib/Target/AVR/AVRSubtarget.cpp stable/12/contrib/llvm/lib/Target/AVR/AVRSubtarget.h stable/12/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp stable/12/contrib/llvm/lib/Target/Mips/MicroMips32r6InstrInfo.td stable/12/contrib/llvm/lib/Target/Mips/MicroMipsInstrFPU.td stable/12/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp stable/12/contrib/llvm/lib/Target/Mips/MipsDSPInstrInfo.td stable/12/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp stable/12/contrib/llvm/lib/Target/Mips/MipsFastISel.cpp stable/12/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp stable/12/contrib/llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp stable/12/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp stable/12/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp stable/12/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp stable/12/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td stable/12/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp stable/12/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp stable/12/contrib/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp stable/12/contrib/llvm/lib/Target/X86/X86FastISel.cpp stable/12/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp stable/12/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp stable/12/contrib/llvm/tools/clang/lib/Basic/Version.cpp stable/12/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp stable/12/contrib/llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp stable/12/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp stable/12/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.cpp stable/12/contrib/llvm/tools/clang/lib/Driver/ToolChains/Linux.cpp stable/12/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp stable/12/contrib/llvm/tools/lld/COFF/Writer.cpp stable/12/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp stable/12/contrib/llvm/tools/lld/ELF/InputSection.cpp stable/12/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp stable/12/contrib/llvm/tools/lld/ELF/Writer.cpp stable/12/contrib/llvm/tools/llvm-objdump/llvm-objdump.cpp stable/12/contrib/openmp/runtime/src/kmp_atomic.h stable/12/contrib/openmp/runtime/src/kmp_csupport.cpp stable/12/contrib/openmp/runtime/src/ompt-specific.cpp stable/12/etc/mtree/BSD.debug.dist stable/12/etc/mtree/BSD.usr.dist stable/12/lib/clang/freebsd_cc_version.h stable/12/lib/clang/headers/Makefile stable/12/lib/clang/include/clang/Basic/Version.inc stable/12/lib/clang/include/clang/Config/config.h stable/12/lib/clang/include/lld/Common/Version.inc stable/12/lib/clang/include/llvm/Config/config.h stable/12/lib/clang/include/llvm/Config/llvm-config.h stable/12/lib/clang/include/llvm/Support/VCSRevision.h stable/12/lib/clang/libllvm/Makefile stable/12/lib/libclang_rt/Makefile.inc stable/12/tools/build/mk/OptionalObsoleteFiles.inc stable/12/usr.bin/clang/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/ObsoleteFiles.inc Tue Jul 23 18:40:32 2019 (r350256) @@ -38,6 +38,156 @@ # xargs -n1 | sort | uniq -d; # done +# 20190723: new clang import which bumps version from 8.0.0 to 8.0.1. +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/esan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/tsan_interface_atomic.h +OLD_DIRS+=usr/lib/clang/8.0.0/include/sanitizer +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/8.0.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/altivec.h +OLD_FILES+=usr/lib/clang/8.0.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/arm64intr.h +OLD_FILES+=usr/lib/clang/8.0.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/8.0.0/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/8.0.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/8.0.0/include/armintr.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/cetintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/8.0.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/8.0.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/8.0.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/8.0.0/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/msa.h +OLD_FILES+=usr/lib/clang/8.0.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/8.0.0/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/8.0.0/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/8.0.0/include +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_DIRS+=usr/lib/clang/8.0.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/8.0.0/lib +OLD_DIRS+=usr/lib/clang/8.0.0 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. OLD_FILES+=usr/tests/sys/opencrypto/dpkt.py OLD_FILES+=usr/tests/sys/opencrypto/dpkt.pyc Modified: stable/12/UPDATING ============================================================================== --- stable/12/UPDATING Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/UPDATING Tue Jul 23 18:40:32 2019 (r350256) @@ -16,6 +16,12 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 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. +20190723: + Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have + been upgraded to 8.0.1. Please see the 20141231 entry below for + information about prerequisites and upgrading, if you are not already + using clang 3.5.0 or higher. + 20190413: Now Clang 8 has been merged (see the 20190412 entry below), the ifunc functionality needed for the RETPOLINE option should work properly Modified: stable/12/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc ============================================================================== --- stable/12/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc Tue Jul 23 18:40:32 2019 (r350256) @@ -124,7 +124,9 @@ #include #include #include +#if 0 #include +#endif #include #include #include Modified: stable/12/contrib/libunwind/src/DwarfInstructions.hpp ============================================================================== --- stable/12/contrib/libunwind/src/DwarfInstructions.hpp Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/libunwind/src/DwarfInstructions.hpp Tue Jul 23 18:40:32 2019 (r350256) @@ -234,6 +234,31 @@ int DwarfInstructions::stepWithDwarf(A &addressS } #endif +#if defined(_LIBUNWIND_TARGET_PPC64) +#define PPC64_ELFV1_R2_LOAD_INST_ENCODING 0xe8410028u // ld r2,40(r1) +#define PPC64_ELFV1_R2_OFFSET 40 +#define PPC64_ELFV2_R2_LOAD_INST_ENCODING 0xe8410018u // ld r2,24(r1) +#define PPC64_ELFV2_R2_OFFSET 24 + // If the instruction at return address is a TOC (r2) restore, + // then r2 was saved and needs to be restored. + // ELFv2 ABI specifies that the TOC Pointer must be saved at SP + 24, + // while in ELFv1 ABI it is saved at SP + 40. + if (R::getArch() == REGISTERS_PPC64 && returnAddress != 0) { + pint_t sp = newRegisters.getRegister(UNW_REG_SP); + pint_t r2 = 0; + switch (addressSpace.get32(returnAddress)) { + case PPC64_ELFV1_R2_LOAD_INST_ENCODING: + r2 = addressSpace.get64(sp + PPC64_ELFV1_R2_OFFSET); + break; + case PPC64_ELFV2_R2_LOAD_INST_ENCODING: + r2 = addressSpace.get64(sp + PPC64_ELFV2_R2_OFFSET); + break; + } + if (r2) + newRegisters.setRegister(UNW_PPC64_R2, r2); + } +#endif + // Return address is address after call site instruction, so setting IP to // that does simualates a return. newRegisters.setIP(returnAddress); Modified: stable/12/contrib/libunwind/src/UnwindRegistersRestore.S ============================================================================== --- stable/12/contrib/libunwind/src/UnwindRegistersRestore.S Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/libunwind/src/UnwindRegistersRestore.S Tue Jul 23 18:40:32 2019 (r350256) @@ -396,119 +396,119 @@ Lnovec: #elif defined(__ppc__) DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv) -; -; void libunwind::Registers_ppc::jumpto() -; -; On entry: -; thread_state pointer is in r3 -; +// +// void libunwind::Registers_ppc::jumpto() +// +// On entry: +// thread_state pointer is in r3 +// - ; restore integral registerrs - ; skip r0 for now - ; skip r1 for now - lwz r2, 16(r3) - ; skip r3 for now - ; skip r4 for now - ; skip r5 for now - lwz r6, 32(r3) - lwz r7, 36(r3) - lwz r8, 40(r3) - lwz r9, 44(r3) - lwz r10, 48(r3) - lwz r11, 52(r3) - lwz r12, 56(r3) - lwz r13, 60(r3) - lwz r14, 64(r3) - lwz r15, 68(r3) - lwz r16, 72(r3) - lwz r17, 76(r3) - lwz r18, 80(r3) - lwz r19, 84(r3) - lwz r20, 88(r3) - lwz r21, 92(r3) - lwz r22, 96(r3) - lwz r23,100(r3) - lwz r24,104(r3) - lwz r25,108(r3) - lwz r26,112(r3) - lwz r27,116(r3) - lwz r28,120(r3) - lwz r29,124(r3) - lwz r30,128(r3) - lwz r31,132(r3) + // restore integral registerrs + // skip r0 for now + // skip r1 for now + lwz %r2, 16(%r3) + // skip r3 for now + // skip r4 for now + // skip r5 for now + lwz %r6, 32(%r3) + lwz %r7, 36(%r3) + lwz %r8, 40(%r3) + lwz %r9, 44(%r3) + lwz %r10, 48(%r3) + lwz %r11, 52(%r3) + lwz %r12, 56(%r3) + lwz %r13, 60(%r3) + lwz %r14, 64(%r3) + lwz %r15, 68(%r3) + lwz %r16, 72(%r3) + lwz %r17, 76(%r3) + lwz %r18, 80(%r3) + lwz %r19, 84(%r3) + lwz %r20, 88(%r3) + lwz %r21, 92(%r3) + lwz %r22, 96(%r3) + lwz %r23,100(%r3) + lwz %r24,104(%r3) + lwz %r25,108(%r3) + lwz %r26,112(%r3) + lwz %r27,116(%r3) + lwz %r28,120(%r3) + lwz %r29,124(%r3) + lwz %r30,128(%r3) + lwz %r31,132(%r3) - ; restore float registers - lfd f0, 160(r3) - lfd f1, 168(r3) - lfd f2, 176(r3) - lfd f3, 184(r3) - lfd f4, 192(r3) - lfd f5, 200(r3) - lfd f6, 208(r3) - lfd f7, 216(r3) - lfd f8, 224(r3) - lfd f9, 232(r3) - lfd f10,240(r3) - lfd f11,248(r3) - lfd f12,256(r3) - lfd f13,264(r3) - lfd f14,272(r3) - lfd f15,280(r3) - lfd f16,288(r3) - lfd f17,296(r3) - lfd f18,304(r3) - lfd f19,312(r3) - lfd f20,320(r3) - lfd f21,328(r3) - lfd f22,336(r3) - lfd f23,344(r3) - lfd f24,352(r3) - lfd f25,360(r3) - lfd f26,368(r3) - lfd f27,376(r3) - lfd f28,384(r3) - lfd f29,392(r3) - lfd f30,400(r3) - lfd f31,408(r3) + // restore float registers + lfd %f0, 160(%r3) + lfd %f1, 168(%r3) + lfd %f2, 176(%r3) + lfd %f3, 184(%r3) + lfd %f4, 192(%r3) + lfd %f5, 200(%r3) + lfd %f6, 208(%r3) + lfd %f7, 216(%r3) + lfd %f8, 224(%r3) + lfd %f9, 232(%r3) + lfd %f10,240(%r3) + lfd %f11,248(%r3) + lfd %f12,256(%r3) + lfd %f13,264(%r3) + lfd %f14,272(%r3) + lfd %f15,280(%r3) + lfd %f16,288(%r3) + lfd %f17,296(%r3) + lfd %f18,304(%r3) + lfd %f19,312(%r3) + lfd %f20,320(%r3) + lfd %f21,328(%r3) + lfd %f22,336(%r3) + lfd %f23,344(%r3) + lfd %f24,352(%r3) + lfd %f25,360(%r3) + lfd %f26,368(%r3) + lfd %f27,376(%r3) + lfd %f28,384(%r3) + lfd %f29,392(%r3) + lfd %f30,400(%r3) + lfd %f31,408(%r3) - ; restore vector registers if any are in use - lwz r5,156(r3) ; test VRsave - cmpwi r5,0 - beq Lnovec + // restore vector registers if any are in use + lwz %r5, 156(%r3) // test VRsave + cmpwi %r5, 0 + beq Lnovec - subi r4,r1,16 - rlwinm r4,r4,0,0,27 ; mask low 4-bits - ; r4 is now a 16-byte aligned pointer into the red zone - ; the _vectorRegisters may not be 16-byte aligned so copy via red zone temp buffer + subi %r4, %r1, 16 + rlwinm %r4, %r4, 0, 0, 27 // mask low 4-bits + // r4 is now a 16-byte aligned pointer into the red zone + // the _vectorRegisters may not be 16-byte aligned so copy via red zone temp buffer + - #define LOAD_VECTOR_UNALIGNEDl(_index) \ - andis. r0,r5,(1<<(15-_index)) @\ - beq Ldone ## _index @\ - lwz r0, 424+_index*16(r3) @\ - stw r0, 0(r4) @\ - lwz r0, 424+_index*16+4(r3) @\ - stw r0, 4(r4) @\ - lwz r0, 424+_index*16+8(r3) @\ - stw r0, 8(r4) @\ - lwz r0, 424+_index*16+12(r3)@\ - stw r0, 12(r4) @\ - lvx v ## _index,0,r4 @\ -Ldone ## _index: + andis. %r0, %r5, (1<<(15-_index)) SEPARATOR \ + beq Ldone ## _index SEPARATOR \ + lwz %r0, 424+_index*16(%r3) SEPARATOR \ + stw %r0, 0(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+4(%r3) SEPARATOR \ + stw %r0, 4(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+8(%r3) SEPARATOR \ + stw %r0, 8(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+12(%r3) SEPARATOR \ + stw %r0, 12(%r4) SEPARATOR \ + lvx %v ## _index, 0, %r4 SEPARATOR \ + Ldone ## _index: #define LOAD_VECTOR_UNALIGNEDh(_index) \ - andi. r0,r5,(1<<(31-_index)) @\ - beq Ldone ## _index @\ - lwz r0, 424+_index*16(r3) @\ - stw r0, 0(r4) @\ - lwz r0, 424+_index*16+4(r3) @\ - stw r0, 4(r4) @\ - lwz r0, 424+_index*16+8(r3) @\ - stw r0, 8(r4) @\ - lwz r0, 424+_index*16+12(r3)@\ - stw r0, 12(r4) @\ - lvx v ## _index,0,r4 @\ - Ldone ## _index: + andi. %r0, %r5, (1<<(31-_index)) SEPARATOR \ + beq Ldone ## _index SEPARATOR \ + lwz %r0, 424+_index*16(%r3) SEPARATOR \ + stw %r0, 0(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+4(%r3) SEPARATOR \ + stw %r0, 4(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+8(%r3) SEPARATOR \ + stw %r0, 8(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+12(%r3) SEPARATOR \ + stw %r0, 12(%r4) SEPARATOR \ + lvx %v ## _index, 0, %r4 SEPARATOR \ + Ldone ## _index: LOAD_VECTOR_UNALIGNEDl(0) @@ -545,17 +545,17 @@ Ldone ## _index: LOAD_VECTOR_UNALIGNEDh(31) Lnovec: - lwz r0, 136(r3) ; __cr - mtocrf 255,r0 - lwz r0, 148(r3) ; __ctr - mtctr r0 - lwz r0, 0(r3) ; __ssr0 - mtctr r0 - lwz r0, 8(r3) ; do r0 now - lwz r5,28(r3) ; do r5 now - lwz r4,24(r3) ; do r4 now - lwz r1,12(r3) ; do sp now - lwz r3,20(r3) ; do r3 last + lwz %r0, 136(%r3) // __cr + mtcr %r0 + lwz %r0, 148(%r3) // __ctr + mtctr %r0 + lwz %r0, 0(%r3) // __ssr0 + mtctr %r0 + lwz %r0, 8(%r3) // do r0 now + lwz %r5, 28(%r3) // do r5 now + lwz %r4, 24(%r3) // do r4 now + lwz %r1, 12(%r3) // do sp now + lwz %r3, 20(%r3) // do r3 last bctr #elif defined(__arm64__) || defined(__aarch64__) Modified: stable/12/contrib/libunwind/src/UnwindRegistersSave.S ============================================================================== --- stable/12/contrib/libunwind/src/UnwindRegistersSave.S Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/libunwind/src/UnwindRegistersSave.S Tue Jul 23 18:40:32 2019 (r350256) @@ -557,144 +557,144 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) #elif defined(__ppc__) -; -; extern int unw_getcontext(unw_context_t* thread_state) -; -; On entry: -; thread_state pointer is in r3 -; +// +// extern int unw_getcontext(unw_context_t* thread_state) +// +// On entry: +// thread_state pointer is in r3 +// DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) - stw r0, 8(r3) - mflr r0 - stw r0, 0(r3) ; store lr as ssr0 - stw r1, 12(r3) - stw r2, 16(r3) - stw r3, 20(r3) - stw r4, 24(r3) - stw r5, 28(r3) - stw r6, 32(r3) - stw r7, 36(r3) - stw r8, 40(r3) - stw r9, 44(r3) - stw r10, 48(r3) - stw r11, 52(r3) - stw r12, 56(r3) - stw r13, 60(r3) - stw r14, 64(r3) - stw r15, 68(r3) - stw r16, 72(r3) - stw r17, 76(r3) - stw r18, 80(r3) - stw r19, 84(r3) - stw r20, 88(r3) - stw r21, 92(r3) - stw r22, 96(r3) - stw r23,100(r3) - stw r24,104(r3) - stw r25,108(r3) - stw r26,112(r3) - stw r27,116(r3) - stw r28,120(r3) - stw r29,124(r3) - stw r30,128(r3) - stw r31,132(r3) + stw %r0, 8(%r3) + mflr %r0 + stw %r0, 0(%r3) // store lr as ssr0 + stw %r1, 12(%r3) + stw %r2, 16(%r3) + stw %r3, 20(%r3) + stw %r4, 24(%r3) + stw %r5, 28(%r3) + stw %r6, 32(%r3) + stw %r7, 36(%r3) + stw %r8, 40(%r3) + stw %r9, 44(%r3) + stw %r10, 48(%r3) + stw %r11, 52(%r3) + stw %r12, 56(%r3) + stw %r13, 60(%r3) + stw %r14, 64(%r3) + stw %r15, 68(%r3) + stw %r16, 72(%r3) + stw %r17, 76(%r3) + stw %r18, 80(%r3) + stw %r19, 84(%r3) + stw %r20, 88(%r3) + stw %r21, 92(%r3) + stw %r22, 96(%r3) + stw %r23,100(%r3) + stw %r24,104(%r3) + stw %r25,108(%r3) + stw %r26,112(%r3) + stw %r27,116(%r3) + stw %r28,120(%r3) + stw %r29,124(%r3) + stw %r30,128(%r3) + stw %r31,132(%r3) - ; save VRSave register - mfspr r0,256 - stw r0,156(r3) - ; save CR registers - mfcr r0 - stw r0,136(r3) - ; save CTR register - mfctr r0 - stw r0,148(r3) + // save VRSave register + mfspr %r0, 256 + stw %r0, 156(%r3) + // save CR registers + mfcr %r0 + stw %r0, 136(%r3) + // save CTR register + mfctr %r0 + stw %r0, 148(%r3) - ; save float registers - stfd f0, 160(r3) - stfd f1, 168(r3) - stfd f2, 176(r3) - stfd f3, 184(r3) - stfd f4, 192(r3) - stfd f5, 200(r3) - stfd f6, 208(r3) - stfd f7, 216(r3) - stfd f8, 224(r3) - stfd f9, 232(r3) - stfd f10,240(r3) - stfd f11,248(r3) - stfd f12,256(r3) - stfd f13,264(r3) - stfd f14,272(r3) - stfd f15,280(r3) - stfd f16,288(r3) - stfd f17,296(r3) - stfd f18,304(r3) - stfd f19,312(r3) - stfd f20,320(r3) - stfd f21,328(r3) - stfd f22,336(r3) - stfd f23,344(r3) - stfd f24,352(r3) - stfd f25,360(r3) - stfd f26,368(r3) - stfd f27,376(r3) - stfd f28,384(r3) - stfd f29,392(r3) - stfd f30,400(r3) - stfd f31,408(r3) + // save float registers + stfd %f0, 160(%r3) + stfd %f1, 168(%r3) + stfd %f2, 176(%r3) + stfd %f3, 184(%r3) + stfd %f4, 192(%r3) + stfd %f5, 200(%r3) + stfd %f6, 208(%r3) + stfd %f7, 216(%r3) + stfd %f8, 224(%r3) + stfd %f9, 232(%r3) + stfd %f10,240(%r3) + stfd %f11,248(%r3) + stfd %f12,256(%r3) + stfd %f13,264(%r3) + stfd %f14,272(%r3) + stfd %f15,280(%r3) + stfd %f16,288(%r3) + stfd %f17,296(%r3) + stfd %f18,304(%r3) + stfd %f19,312(%r3) + stfd %f20,320(%r3) + stfd %f21,328(%r3) + stfd %f22,336(%r3) + stfd %f23,344(%r3) + stfd %f24,352(%r3) + stfd %f25,360(%r3) + stfd %f26,368(%r3) + stfd %f27,376(%r3) + stfd %f28,384(%r3) + stfd %f29,392(%r3) + stfd %f30,400(%r3) + stfd %f31,408(%r3) - ; save vector registers + // save vector registers - subi r4,r1,16 - rlwinm r4,r4,0,0,27 ; mask low 4-bits - ; r4 is now a 16-byte aligned pointer into the red zone + subi %r4, %r1, 16 + rlwinm %r4, %r4, 0, 0, 27 // mask low 4-bits + // r4 is now a 16-byte aligned pointer into the red zone #define SAVE_VECTOR_UNALIGNED(_vec, _offset) \ - stvx _vec,0,r4 @\ - lwz r5, 0(r4) @\ - stw r5, _offset(r3) @\ - lwz r5, 4(r4) @\ - stw r5, _offset+4(r3) @\ - lwz r5, 8(r4) @\ - stw r5, _offset+8(r3) @\ - lwz r5, 12(r4) @\ - stw r5, _offset+12(r3) + stvx _vec, 0, %r4 SEPARATOR \ + lwz %r5, 0(%r4) SEPARATOR \ + stw %r5, _offset(%r3) SEPARATOR \ + lwz %r5, 4(%r4) SEPARATOR \ + stw %r5, _offset+4(%r3) SEPARATOR \ + lwz %r5, 8(%r4) SEPARATOR \ + stw %r5, _offset+8(%r3) SEPARATOR \ + lwz %r5, 12(%r4) SEPARATOR \ + stw %r5, _offset+12(%r3) - SAVE_VECTOR_UNALIGNED( v0, 424+0x000) - SAVE_VECTOR_UNALIGNED( v1, 424+0x010) - SAVE_VECTOR_UNALIGNED( v2, 424+0x020) - SAVE_VECTOR_UNALIGNED( v3, 424+0x030) - SAVE_VECTOR_UNALIGNED( v4, 424+0x040) - SAVE_VECTOR_UNALIGNED( v5, 424+0x050) - SAVE_VECTOR_UNALIGNED( v6, 424+0x060) - SAVE_VECTOR_UNALIGNED( v7, 424+0x070) - SAVE_VECTOR_UNALIGNED( v8, 424+0x080) - SAVE_VECTOR_UNALIGNED( v9, 424+0x090) - SAVE_VECTOR_UNALIGNED(v10, 424+0x0A0) - SAVE_VECTOR_UNALIGNED(v11, 424+0x0B0) - SAVE_VECTOR_UNALIGNED(v12, 424+0x0C0) - SAVE_VECTOR_UNALIGNED(v13, 424+0x0D0) - SAVE_VECTOR_UNALIGNED(v14, 424+0x0E0) - SAVE_VECTOR_UNALIGNED(v15, 424+0x0F0) - SAVE_VECTOR_UNALIGNED(v16, 424+0x100) - SAVE_VECTOR_UNALIGNED(v17, 424+0x110) - SAVE_VECTOR_UNALIGNED(v18, 424+0x120) - SAVE_VECTOR_UNALIGNED(v19, 424+0x130) - SAVE_VECTOR_UNALIGNED(v20, 424+0x140) - SAVE_VECTOR_UNALIGNED(v21, 424+0x150) - SAVE_VECTOR_UNALIGNED(v22, 424+0x160) - SAVE_VECTOR_UNALIGNED(v23, 424+0x170) - SAVE_VECTOR_UNALIGNED(v24, 424+0x180) - SAVE_VECTOR_UNALIGNED(v25, 424+0x190) - SAVE_VECTOR_UNALIGNED(v26, 424+0x1A0) - SAVE_VECTOR_UNALIGNED(v27, 424+0x1B0) - SAVE_VECTOR_UNALIGNED(v28, 424+0x1C0) - SAVE_VECTOR_UNALIGNED(v29, 424+0x1D0) - SAVE_VECTOR_UNALIGNED(v30, 424+0x1E0) - SAVE_VECTOR_UNALIGNED(v31, 424+0x1F0) + SAVE_VECTOR_UNALIGNED( %v0, 424+0x000) + SAVE_VECTOR_UNALIGNED( %v1, 424+0x010) + SAVE_VECTOR_UNALIGNED( %v2, 424+0x020) + SAVE_VECTOR_UNALIGNED( %v3, 424+0x030) + SAVE_VECTOR_UNALIGNED( %v4, 424+0x040) + SAVE_VECTOR_UNALIGNED( %v5, 424+0x050) + SAVE_VECTOR_UNALIGNED( %v6, 424+0x060) + SAVE_VECTOR_UNALIGNED( %v7, 424+0x070) + SAVE_VECTOR_UNALIGNED( %v8, 424+0x080) + SAVE_VECTOR_UNALIGNED( %v9, 424+0x090) + SAVE_VECTOR_UNALIGNED(%v10, 424+0x0A0) + SAVE_VECTOR_UNALIGNED(%v11, 424+0x0B0) + SAVE_VECTOR_UNALIGNED(%v12, 424+0x0C0) + SAVE_VECTOR_UNALIGNED(%v13, 424+0x0D0) + SAVE_VECTOR_UNALIGNED(%v14, 424+0x0E0) + SAVE_VECTOR_UNALIGNED(%v15, 424+0x0F0) + SAVE_VECTOR_UNALIGNED(%v16, 424+0x100) + SAVE_VECTOR_UNALIGNED(%v17, 424+0x110) + SAVE_VECTOR_UNALIGNED(%v18, 424+0x120) + SAVE_VECTOR_UNALIGNED(%v19, 424+0x130) + SAVE_VECTOR_UNALIGNED(%v20, 424+0x140) + SAVE_VECTOR_UNALIGNED(%v21, 424+0x150) + SAVE_VECTOR_UNALIGNED(%v22, 424+0x160) + SAVE_VECTOR_UNALIGNED(%v23, 424+0x170) + SAVE_VECTOR_UNALIGNED(%v24, 424+0x180) + SAVE_VECTOR_UNALIGNED(%v25, 424+0x190) + SAVE_VECTOR_UNALIGNED(%v26, 424+0x1A0) + SAVE_VECTOR_UNALIGNED(%v27, 424+0x1B0) + SAVE_VECTOR_UNALIGNED(%v28, 424+0x1C0) + SAVE_VECTOR_UNALIGNED(%v29, 424+0x1D0) + SAVE_VECTOR_UNALIGNED(%v30, 424+0x1E0) + SAVE_VECTOR_UNALIGNED(%v31, 424+0x1F0) - li r3, 0 ; return UNW_ESUCCESS + li %r3, 0 // return UNW_ESUCCESS blr Modified: stable/12/contrib/libunwind/src/assembly.h ============================================================================== --- stable/12/contrib/libunwind/src/assembly.h Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/libunwind/src/assembly.h Tue Jul 23 18:40:32 2019 (r350256) @@ -29,14 +29,26 @@ #ifdef _ARCH_PWR8 #define PPC64_HAS_VMX #endif -#elif defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__) -#define SEPARATOR @ #elif defined(__arm64__) #define SEPARATOR %% #else #define SEPARATOR ; #endif +#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) +#define PPC64_OPD1 .section .opd,"aw",@progbits SEPARATOR +#define PPC64_OPD2 SEPARATOR \ + .p2align 3 SEPARATOR \ + .quad .Lfunc_begin0 SEPARATOR \ + .quad .TOC.@tocbase SEPARATOR \ + .quad 0 SEPARATOR \ + .text SEPARATOR \ +.Lfunc_begin0: +#else +#define PPC64_OPD1 +#define PPC64_OPD2 +#endif + #define GLUE2(a, b) a ## b #define GLUE(a, b) GLUE2(a, b) #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name) @@ -97,13 +109,17 @@ .globl SYMBOL_NAME(name) SEPARATOR \ EXPORT_SYMBOL(name) SEPARATOR \ SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \ - SYMBOL_NAME(name): + PPC64_OPD1 \ + SYMBOL_NAME(name): \ + PPC64_OPD2 #define DEFINE_LIBUNWIND_PRIVATE_FUNCTION(name) \ .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: stable/12/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp ============================================================================== --- stable/12/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp Tue Jul 23 18:40:32 2019 (r350256) @@ -301,7 +301,7 @@ void CIE::dump(raw_ostream &OS, const MCRegisterInfo * OS << format(" Data alignment factor: %d\n", (int32_t)DataAlignmentFactor); OS << format(" Return address column: %d\n", (int32_t)ReturnAddressRegister); if (Personality) - OS << format(" Personality Address: %08x\n", *Personality); + OS << format(" Personality Address: %016" PRIx64 "\n", *Personality); if (!AugmentationData.empty()) { OS << " Augmentation data: "; for (uint8_t Byte : AugmentationData) @@ -320,7 +320,7 @@ void FDE::dump(raw_ostream &OS, const MCRegisterInfo * (uint32_t)InitialLocation, (uint32_t)InitialLocation + (uint32_t)AddressRange); if (LSDAAddress) - OS << format(" LSDA Address: %08x\n", *LSDAAddress); + OS << format(" LSDA Address: %016" PRIx64 "\n", *LSDAAddress); CFIs.dump(OS, MRI, IsEH); OS << "\n"; } Modified: stable/12/contrib/llvm/lib/MC/ELFObjectWriter.cpp ============================================================================== --- stable/12/contrib/llvm/lib/MC/ELFObjectWriter.cpp Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/llvm/lib/MC/ELFObjectWriter.cpp Tue Jul 23 18:40:32 2019 (r350256) @@ -1271,6 +1271,7 @@ void ELFObjectWriter::executePostLayoutBinding(MCAssem // This is the first place we are able to copy this information. Alias->setExternal(Symbol.isExternal()); Alias->setBinding(Symbol.getBinding()); + Alias->setOther(Symbol.getOther()); if (!Symbol.isUndefined() && !Rest.startswith("@@@")) continue; Modified: stable/12/contrib/llvm/lib/MC/MCWin64EH.cpp ============================================================================== --- stable/12/contrib/llvm/lib/MC/MCWin64EH.cpp Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/llvm/lib/MC/MCWin64EH.cpp Tue Jul 23 18:40:32 2019 (r350256) @@ -522,7 +522,7 @@ static void ARM64EmitUnwindInfo(MCStreamer &streamer, if (MatchingEpilog) { assert(EpilogInfo.find(MatchingEpilog) != EpilogInfo.end() && "Duplicate epilog not found"); - EpilogInfo[EpilogStart] = EpilogInfo[MatchingEpilog]; + EpilogInfo[EpilogStart] = EpilogInfo.lookup(MatchingEpilog); // Clear the unwind codes in the EpilogMap, so that they don't get output // in the logic below. EpilogInstrs.clear(); Modified: stable/12/contrib/llvm/lib/MC/WasmObjectWriter.cpp ============================================================================== --- stable/12/contrib/llvm/lib/MC/WasmObjectWriter.cpp Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/llvm/lib/MC/WasmObjectWriter.cpp Tue Jul 23 18:40:32 2019 (r350256) @@ -368,7 +368,13 @@ void WasmObjectWriter::startCustomSection(SectionBookk // Now that the section is complete and we know how big it is, patch up the // section size field at the start of the section. void WasmObjectWriter::endSection(SectionBookkeeping &Section) { - uint64_t Size = W.OS.tell() - Section.PayloadOffset; + uint64_t Size = W.OS.tell(); + // /dev/null doesn't support seek/tell and can report offset of 0. + // Simply skip this patching in that case. + if (!Size) + return; + + Size -= Section.PayloadOffset; if (uint32_t(Size) != Size) report_fatal_error("section size does not fit in a uint32_t"); Modified: stable/12/contrib/llvm/lib/Object/COFFImportFile.cpp ============================================================================== --- stable/12/contrib/llvm/lib/Object/COFFImportFile.cpp Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/llvm/lib/Object/COFFImportFile.cpp Tue Jul 23 18:40:32 2019 (r350256) @@ -496,7 +496,7 @@ NewArchiveMember ObjectFactory::createWeakExternal(Str // COFF Header coff_file_header Header{ - u16(0), + u16(Machine), u16(NumberOfSections), u32(0), u32(sizeof(Header) + (NumberOfSections * sizeof(coff_section))), Modified: stable/12/contrib/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td ============================================================================== --- stable/12/contrib/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td Tue Jul 23 18:40:32 2019 (r350256) @@ -239,7 +239,6 @@ def M4WriteNEONK : SchedWriteRes<[M4UnitNSHF, M4UnitS0]> { let Latency = 5; let NumMicroOps = 2; } def M4WriteNEONL : SchedWriteRes<[M4UnitNMUL]> { let Latency = 3; } -def M4WriteNEONM : SchedWriteRes<[M4UnitNMUL]> { let Latency = 3; } def M4WriteNEONN : SchedWriteRes<[M4UnitNMSC, M4UnitNMSC]> { let Latency = 5; let NumMicroOps = 2; } @@ -480,8 +479,6 @@ def M4WriteCOPY : SchedWriteVariant<[SchedVar]>; def M4WriteMOVI : SchedWriteVariant<[SchedVar, SchedVar]>; -def M4WriteMULL : SchedWriteVariant<[SchedVar, - SchedVar]>; // Fast forwarding. def M4ReadAESM1 : SchedReadAdvance<+1, [M4WriteNCRY1]>; @@ -489,8 +486,9 @@ def M4ReadFMACM1 : SchedReadAdvance<+1, [M4WriteFMAC M4WriteFMAC4H, M4WriteFMAC5]>; def M4ReadNMULM1 : SchedReadAdvance<+1, [M4WriteNMUL3]>; -def M4ReadMULLP2 : SchedReadAdvance<-2, [M4WriteNEONM]>; +def M4ReadNMULP2 : SchedReadAdvance<-2, [M4WriteNMUL3]>; + //===----------------------------------------------------------------------===// // Coarse scheduling model. @@ -662,10 +660,8 @@ def : InstRW<[M4WriteNEONK], (instregex "^FMOVDXHighr def : InstRW<[M4WriteFCVT3H], (instregex "^F(RECP|RSQRT)Ev1f16")>; def : InstRW<[M4WriteFCVT3], (instregex "^F(RECP|RSQRT)Ev1i(32|64)")>; def : InstRW<[M4WriteNMSC1], (instregex "^FRECPXv1")>; -def : InstRW<[M4WriteFMAC4H, - M4ReadFMACM1], (instregex "^F(RECP|RSQRT)S16")>; -def : InstRW<[M4WriteFMAC4, - M4ReadFMACM1], (instregex "^F(RECP|RSQRT)S(32|64)")>; +def : InstRW<[M4WriteFMAC4H], (instregex "^F(RECP|RSQRT)S16")>; +def : InstRW<[M4WriteFMAC4], (instregex "^F(RECP|RSQRT)S(32|64)")>; // FP load instructions. def : InstRW<[WriteVLD], (instregex "^LDR[SDQ]l")>; @@ -736,14 +732,20 @@ def : InstRW<[M4WriteNALU1], (instregex "^(AND|BIC|EO def : InstRW<[M4WriteNMSC1], (instregex "^[SU](MIN|MAX)v")>; def : InstRW<[M4WriteNMSC2], (instregex "^[SU](MIN|MAX)Pv")>; def : InstRW<[M4WriteNHAD3], (instregex "^[SU](MIN|MAX)Vv")>; -def : InstRW<[M4WriteNMUL3], (instregex "^(SQR?D)?MULH?v")>; def : InstRW<[M4WriteNMUL3, M4ReadNMULM1], (instregex "^ML[AS]v")>; -def : InstRW<[M4WriteNMUL3], (instregex "^SQRDML[AS]H")>; -def : InstRW<[M4WriteMULL, - M4ReadMULLP2], (instregex "^(S|U|SQD)ML[AS]Lv")>; -def : InstRW<[M4WriteMULL, - M4ReadMULLP2], (instregex "^(S|U|SQD)MULLv")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULM1], (instregex "^(SQR?D)?MULH?v")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULM1], (instregex "^SQRDML[AS]H")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULM1], (instregex "^(S|U|SQD)ML[AS]L(v1(i32|i64)|v2i32|v4i16|v8i8)")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULP2], (instregex "^(S|U|SQD)ML[AS]L(v4i32|v8i16|v16i8)")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULM1], (instregex "^(S|U|SQD)MULL(v1(i32|i64)|v2i32|v4i16|v8i8)")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULP2], (instregex "^(S|U|SQD)MULL(v4i32|v8i16|v16i8)")>; def : InstRW<[M4WriteNMUL3], (instregex "^[SU]DOT(lane)?v")>; def : InstRW<[M4WriteNHAD3], (instregex "^[SU]ADALPv")>; def : InstRW<[M4WriteNSHT4A], (instregex "^[SU]R?SRA[dv]")>; @@ -808,10 +810,8 @@ def : InstRW<[M4WriteNALU1], (instregex "^FMOVv.f(32| def : InstRW<[M4WriteFCVT3H], (instregex "^F(RECP|RSQRT)Ev[248]f16")>; def : InstRW<[M4WriteFCVT3], (instregex "^F(RECP|RSQRT)Ev[248]f(32|64)")>; def : InstRW<[M4WriteFCVT3], (instregex "^U(RECP|RSQRT)Ev[24]i32")>; -def : InstRW<[M4WriteFMAC4H, - M4ReadFMACM1], (instregex "^F(RECP|RSQRT)Sv.f16")>; -def : InstRW<[M4WriteFMAC4, - M4ReadFMACM1], (instregex "^F(RECP|RSQRT)Sv.f(32|64)")>; +def : InstRW<[M4WriteFMAC4H], (instregex "^F(RECP|RSQRT)Sv.f16")>; +def : InstRW<[M4WriteFMAC4], (instregex "^F(RECP|RSQRT)Sv.f(32|64)")>; def : InstRW<[M4WriteNSHF1], (instregex "^REV(16|32|64)v")>; def : InstRW<[M4WriteNSHFA], (instregex "^TB[LX]v(8|16)i8One")>; def : InstRW<[M4WriteNSHFB], (instregex "^TB[LX]v(8|16)i8Two")>; Modified: stable/12/contrib/llvm/lib/Target/AArch64/AArch64SchedPredExynos.td ============================================================================== --- stable/12/contrib/llvm/lib/Target/AArch64/AArch64SchedPredExynos.td Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/llvm/lib/Target/AArch64/AArch64SchedPredExynos.td Tue Jul 23 18:40:32 2019 (r350256) @@ -103,17 +103,6 @@ def ExynosScaledIdxPred : MCSchedPredicate>; -// Identify whether an instruction whose result is a long vector -// operates on the upper half of the input registers. -def ExynosLongVectorUpperFn : TIIPredicate< - "isExynosLongVectorUpper", - MCOpcodeSwitchStatement< - [MCOpcodeSwitchCase< - IsLongVectorUpperOp.ValidOpcodes, - MCReturnStatement>], - MCReturnStatement>>; -def ExynosLongVectorUpperPred : MCSchedPredicate; - // Identify 128-bit NEON instructions. def ExynosQFormPred : MCSchedPredicate; Modified: stable/12/contrib/llvm/lib/Target/AArch64/AArch64SchedPredicates.td ============================================================================== --- stable/12/contrib/llvm/lib/Target/AArch64/AArch64SchedPredicates.td Tue Jul 23 18:40:07 2019 (r350255) +++ stable/12/contrib/llvm/lib/Target/AArch64/AArch64SchedPredicates.td Tue Jul 23 18:40:32 2019 (r350256) @@ -268,59 +268,6 @@ def IsStoreRegOffsetOp : CheckOpcode<[STRBBroW, ST def IsLoadStoreRegOffsetOp : CheckOpcode; -// Identify whether an instruction whose result is a long vector -// operates on the upper half of the input registers. -def IsLongVectorUpperOp : CheckOpcode<[FCVTLv8i16, FCVTLv4i32, - FCVTNv8i16, FCVTNv4i32, - FCVTXNv4f32, - PMULLv16i8, PMULLv2i64, - RADDHNv8i16_v16i8, RADDHNv4i32_v8i16, RADDHNv2i64_v4i32, - RSHRNv16i8_shift, RSHRNv8i16_shift, RSHRNv4i32_shift, - RSUBHNv8i16_v16i8, RSUBHNv4i32_v8i16, RSUBHNv2i64_v4i32, - SABALv16i8_v8i16, SABALv8i16_v4i32, SABALv4i32_v2i64, - SABDLv16i8_v8i16, SABDLv8i16_v4i32, SABDLv4i32_v2i64, - SADDLv16i8_v8i16, SADDLv8i16_v4i32, SADDLv4i32_v2i64, - SADDWv16i8_v8i16, SADDWv8i16_v4i32, SADDWv4i32_v2i64, - SHLLv16i8, SHLLv8i16, SHLLv4i32, - SHRNv16i8_shift, SHRNv8i16_shift, SHRNv4i32_shift, - SMLALv16i8_v8i16, SMLALv8i16_v4i32, SMLALv4i32_v2i64, - SMLALv8i16_indexed, SMLALv4i32_indexed, - SMLSLv16i8_v8i16, SMLSLv8i16_v4i32, SMLSLv4i32_v2i64, - SMLSLv8i16_indexed, SMLSLv4i32_indexed, - SMULLv16i8_v8i16, SMULLv8i16_v4i32, SMULLv4i32_v2i64, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jul 23 18:54: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 3255DB08BD; Tue, 23 Jul 2019 18:54:06 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 0D39F7018C; Tue, 23 Jul 2019 18:54:06 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id AFE0B1BDDD; Tue, 23 Jul 2019 18:54:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-wr1-f52.google.com with SMTP id c2so41078273wrm.8; Tue, 23 Jul 2019 11:54:05 -0700 (PDT) X-Gm-Message-State: APjAAAXMJOMVXpwZicUMHT3XA1jiY3LPN7hIG2o7MKc5hSLkfZZt5Xxb MF68ztpjdQNCdA+xsN05AiFbIyfnn3LGMSI5ELY= X-Google-Smtp-Source: APXvYqyNEaLvACczSR1eyUYtuqyyc+UwrINlRxpIdnr4q+CK6BWYbZ/2tHfIOWcpvgNd1NxkekQHUDSG5Mstn98XsQY= X-Received: by 2002:adf:ce88:: with SMTP id r8mr8315445wrn.42.1563908044649; Tue, 23 Jul 2019 11:54:04 -0700 (PDT) MIME-Version: 1.0 References: <201907231840.x6NIeWeq024894@repo.freebsd.org> In-Reply-To: <201907231840.x6NIeWeq024894@repo.freebsd.org> From: Kyle Evans Date: Tue, 23 Jul 2019 13:53:35 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r350256 - in stable/12: . contrib/compiler-rt/lib/sanitizer_common contrib/libunwind/src contrib/llvm/lib/DebugInfo/DWARF contrib/llvm/lib/MC contrib/llvm/lib/Object contrib/llvm/lib/Ta... To: Dimitry Andric Cc: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 0D39F7018C 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.969,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, 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, 23 Jul 2019 18:54:06 -0000 On Tue, Jul 23, 2019 at 1:41 PM Dimitry Andric wrote: > > Author: dim > Date: Tue Jul 23 18:40:32 2019 > New Revision: 350256 > URL: https://svnweb.freebsd.org/changeset/base/350256 > > Log: > MFC r348504 (by kevans): > > llvm-symbolizer: Move out of CLANG_EXTRAS, into CLANG > > ASAN reports become a lot more useful with llvm-symbolizer in $PATH, and the > build is not much more time-consuming. The added benefit is that the > resulting reports will actually include symbol information; without, thread > trace information includes a bunch of addresses that immediately resolve to > an inline function in > ^/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h and take a > little more effort to examine. > > Reviewed by: emaste > Differential Revision: https://reviews.freebsd.org/D20484 > Ahh, r348689 also needs to be shipped back to stable along with this one -- I had missed moving the man page out into the CLANG knob. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Tue Jul 23 19:42: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 858B8B152B; Tue, 23 Jul 2019 19:42:04 +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 635BF71BDF; Tue, 23 Jul 2019 19:42:04 +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 458072A3E; Tue, 23 Jul 2019 19:42:04 +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 x6NJg4Zs064966; Tue, 23 Jul 2019 19:42:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NJg4NK064965; Tue, 23 Jul 2019 19:42:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201907231942.x6NJg4NK064965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 23 Jul 2019 19:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350257 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 350257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 635BF71BDF 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.969,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, 23 Jul 2019 19:42:04 -0000 Author: mav Date: Tue Jul 23 19:42:03 2019 New Revision: 350257 URL: https://svnweb.freebsd.org/changeset/base/350257 Log: Make `camcontrol hpa` and `camcontrol ama` trigger reprobe. This makes OS automatically see the disk's new disk size. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue Jul 23 18:40:32 2019 (r350256) +++ head/sbin/camcontrol/camcontrol.c Tue Jul 23 19:42:03 2019 (r350257) @@ -301,6 +301,7 @@ static int scsiserial(struct cam_device *device, int t int retry_count, int timeout); static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, cam_argmask *arglst); +static int reprobe(struct cam_device *device); static int dorescan_or_reset(int argc, char **argv, int rescan); static int rescan_or_reset_bus(path_id_t bus, int rescan); static int scanlun_or_reset_dev(path_id_t bus, target_id_t target, @@ -371,7 +372,6 @@ static int scsiprintopcodes(struct cam_device *device, static int scsiopcodes(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout, int verbose); -static int scsireprobe(struct cam_device *device); #ifndef min #define min(a,b) (((a)<(b))?(a):(b)) @@ -3094,6 +3094,8 @@ atahpa(struct cam_device *device, int retry_count, int timeout, ccb, &ident_buf); atahpa_print(ident_buf, hpasize, 1); + /* Hint CAM to reprobe the device. */ + reprobe(device); } } break; @@ -3236,6 +3238,8 @@ ataama(struct cam_device *device, int retry_count, int error = ata_do_identify(device, retry_count, timeout, ccb, &ident_buf); ataama_print(ident_buf, nativesize, 1); + /* Hint CAM to reprobe the device. */ + reprobe(device); } } break; @@ -9774,7 +9778,7 @@ bailout: static int -scsireprobe(struct cam_device *device) +reprobe(struct cam_device *device) { union ccb *ccb; int retval = 0; @@ -9786,7 +9790,7 @@ scsireprobe(struct cam_device *device) return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); + CCB_CLEAR_ALL_EXCEPT_HDR(ccb); ccb->ccb_h.func_code = XPT_REPROBE_LUN; @@ -10538,7 +10542,7 @@ main(int argc, char **argv) arglist & CAM_ARG_VERBOSE); break; case CAM_CMD_REPROBE: - error = scsireprobe(cam_dev); + error = reprobe(cam_dev); break; case CAM_CMD_ZONE: error = zone(cam_dev, argc, argv, combinedopt, From owner-svn-src-all@freebsd.org Tue Jul 23 20:28: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 50A5DB269A; Tue, 23 Jul 2019 20:28:30 +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 3254373860; Tue, 23 Jul 2019 20:28:30 +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 057EE31F1; Tue, 23 Jul 2019 20:28:30 +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 x6NKSTO4090525; Tue, 23 Jul 2019 20:28:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NKSTYs090524; Tue, 23 Jul 2019 20:28:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907232028.x6NKSTYs090524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 23 Jul 2019 20:28: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: r350258 - stable/12/tools/build/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/12/tools/build/mk X-SVN-Commit-Revision: 350258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3254373860 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.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, 23 Jul 2019 20:28:30 -0000 Author: dim Date: Tue Jul 23 20:28:29 2019 New Revision: 350258 URL: https://svnweb.freebsd.org/changeset/base/350258 Log: MFC r348689 (by emaste): Use CLANG knob to remove llvm-symbolizer man page r348504 moved llvm-symbolizer from the CLANG_EXTRAS knob to CLANG, but the man page was still in the CLANG_EXTRAS section in OptionalObsoleteFiles.inc. Reported by: jhb Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Tue Jul 23 19:42:03 2019 (r350257) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Tue Jul 23 20:28:29 2019 (r350258) @@ -1519,6 +1519,7 @@ OLD_DIRS+=usr/share/doc/llvm OLD_FILES+=usr/share/man/man1/clang.1.gz OLD_FILES+=usr/share/man/man1/clang++.1.gz OLD_FILES+=usr/share/man/man1/clang-cpp.1.gz +OLD_FILES+=usr/share/man/man1/llvm-symbolizer.1.gz OLD_FILES+=usr/share/man/man1/llvm-tblgen.1.gz .endif @@ -1562,7 +1563,6 @@ OLD_FILES+=usr/share/man/man1/llvm-extract.1.gz OLD_FILES+=usr/share/man/man1/llvm-link.1.gz OLD_FILES+=usr/share/man/man1/llvm-nm.1.gz OLD_FILES+=usr/share/man/man1/llvm-pdbutil.1.gz -OLD_FILES+=usr/share/man/man1/llvm-symbolizer.1.gz OLD_FILES+=usr/share/man/man1/opt.1.gz .endif From owner-svn-src-all@freebsd.org Tue Jul 23 20:31: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 66E95B2B54; Tue, 23 Jul 2019 20:31:58 +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 518F174291; Tue, 23 Jul 2019 20:31:58 +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 2C8223375; Tue, 23 Jul 2019 20:31:58 +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 x6NKVvlS095356; Tue, 23 Jul 2019 20:31:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NKVsph095337; Tue, 23 Jul 2019 20:31:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907232031.x6NKVsph095337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 23 Jul 2019 20:31:54 +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: r350259 - in stable/11: . contrib/compiler-rt/lib/sanitizer_common contrib/libunwind/src contrib/llvm/lib/DebugInfo/DWARF contrib/llvm/lib/MC contrib/llvm/lib/Object contrib/llvm/lib/Ta... X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11: . contrib/compiler-rt/lib/sanitizer_common contrib/libunwind/src contrib/llvm/lib/DebugInfo/DWARF contrib/llvm/lib/MC contrib/llvm/lib/Object contrib/llvm/lib/Target/AArch64 contrib/llvm... X-SVN-Commit-Revision: 350259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 518F174291 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: Tue, 23 Jul 2019 20:31:58 -0000 Author: dim Date: Tue Jul 23 20:31:54 2019 New Revision: 350259 URL: https://svnweb.freebsd.org/changeset/base/350259 Log: MFC r348504 (by kevans): llvm-symbolizer: Move out of CLANG_EXTRAS, into CLANG ASAN reports become a lot more useful with llvm-symbolizer in $PATH, and the build is not much more time-consuming. The added benefit is that the resulting reports will actually include symbol information; without, thread trace information includes a bunch of addresses that immediately resolve to an inline function in ^/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h and take a little more effort to examine. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D20484 MFC r348689 (by emaste): Use CLANG knob to remove llvm-symbolizer man page r348504 moved llvm-symbolizer from the CLANG_EXTRAS knob to CLANG, but the man page was still in the CLANG_EXTRAS section in OptionalObsoleteFiles.inc. Reported by: jhb MFC r349004: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp to the upstream release_80 branch r363030 (effectively, 8.0.1 rc2). The 8.0.1 release should follow this within a week or so. MFC r349351 (by jhibbits, partially): powerpc: Transition to Secure-PLT, like most other OSs (Toolchain part) Summary: Toolchain follow-up to r349350. LLVM patches will be submitted upstream for 9.0 as well. The bsd.cpu.mk change is required because GNU ld assumes BSS-PLT if it cannot determine for certain that it needs Secure-PLT, and some binaries do not compile in such a way to make it know to use Secure-PLT. Reviewed By: nwhitehorn, bdragon, pfg Differential Revision: https://reviews.freebsd.org/D20598 MFC r349793: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp to the upstream release_80 branch r364487 (effectively, 8.0.1 rc3). The 8.0.1 release will most likely have no further changes. MFC r350177: 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 Modified: stable/11/ObsoleteFiles.inc stable/11/UPDATING stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc stable/11/contrib/libunwind/src/DwarfInstructions.hpp stable/11/contrib/libunwind/src/UnwindRegistersRestore.S stable/11/contrib/libunwind/src/UnwindRegistersSave.S stable/11/contrib/libunwind/src/assembly.h stable/11/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp stable/11/contrib/llvm/lib/MC/ELFObjectWriter.cpp stable/11/contrib/llvm/lib/MC/MCWin64EH.cpp stable/11/contrib/llvm/lib/MC/WasmObjectWriter.cpp stable/11/contrib/llvm/lib/Object/COFFImportFile.cpp stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedPredExynos.td stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedPredicates.td stable/11/contrib/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp stable/11/contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td stable/11/contrib/llvm/lib/Target/AVR/AVRISelLowering.cpp stable/11/contrib/llvm/lib/Target/AVR/AVRISelLowering.h stable/11/contrib/llvm/lib/Target/AVR/AVRSubtarget.cpp stable/11/contrib/llvm/lib/Target/AVR/AVRSubtarget.h stable/11/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp stable/11/contrib/llvm/lib/Target/Mips/MicroMips32r6InstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MicroMipsInstrFPU.td stable/11/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsDSPInstrInfo.td stable/11/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsFastISel.cpp stable/11/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp stable/11/contrib/llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp stable/11/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp stable/11/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp stable/11/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td stable/11/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp stable/11/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp stable/11/contrib/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp stable/11/contrib/llvm/lib/Target/X86/X86FastISel.cpp stable/11/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp stable/11/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/Version.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/PPC.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.cpp stable/11/contrib/llvm/tools/clang/lib/Driver/ToolChains/Linux.cpp stable/11/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp stable/11/contrib/llvm/tools/lld/COFF/Writer.cpp stable/11/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp stable/11/contrib/llvm/tools/lld/ELF/InputSection.cpp stable/11/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp stable/11/contrib/llvm/tools/lld/ELF/Writer.cpp stable/11/contrib/llvm/tools/llvm-objdump/llvm-objdump.cpp stable/11/contrib/openmp/runtime/src/kmp_atomic.h stable/11/contrib/openmp/runtime/src/kmp_csupport.cpp stable/11/contrib/openmp/runtime/src/ompt-specific.cpp stable/11/etc/mtree/BSD.debug.dist stable/11/etc/mtree/BSD.usr.dist stable/11/lib/clang/freebsd_cc_version.h stable/11/lib/clang/headers/Makefile stable/11/lib/clang/include/clang/Basic/Version.inc stable/11/lib/clang/include/clang/Config/config.h stable/11/lib/clang/include/lld/Common/Version.inc stable/11/lib/clang/include/llvm/Config/config.h stable/11/lib/clang/include/llvm/Config/llvm-config.h stable/11/lib/clang/include/llvm/Support/VCSRevision.h stable/11/lib/clang/libllvm/Makefile stable/11/lib/libclang_rt/Makefile.inc stable/11/tools/build/mk/OptionalObsoleteFiles.inc stable/11/usr.bin/clang/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/ObsoleteFiles.inc Tue Jul 23 20:31:54 2019 (r350259) @@ -38,6 +38,156 @@ # xargs -n1 | sort | uniq -d; # done +# 20190723: new clang import which bumps version from 8.0.0 to 8.0.1. +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/esan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/tsan_interface_atomic.h +OLD_DIRS+=usr/lib/clang/8.0.0/include/sanitizer +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/8.0.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/8.0.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/altivec.h +OLD_FILES+=usr/lib/clang/8.0.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/arm64intr.h +OLD_FILES+=usr/lib/clang/8.0.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/8.0.0/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/8.0.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/8.0.0/include/armintr.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/cetintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/8.0.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/8.0.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/8.0.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/8.0.0/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/msa.h +OLD_FILES+=usr/lib/clang/8.0.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/8.0.0/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/8.0.0/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/8.0.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/8.0.0/include +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/8.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_DIRS+=usr/lib/clang/8.0.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/8.0.0/lib +OLD_DIRS+=usr/lib/clang/8.0.0 # 20190416: new libc++ import which bumps version from 7.0.1 to 8.0.0. OLD_FILES+=usr/include/c++/v1/experimental/dynarray # 20190416: new clang import which bumps version from 7.0.1 to 8.0.0. Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/UPDATING Tue Jul 23 20:31:54 2019 (r350259) @@ -16,6 +16,12 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 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. +20190723: + Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have + been upgraded to 8.0.1. Please see the 20141231 entry below for + information about prerequisites and upgrading, if you are not already + using clang 3.5.0 or higher. + 20190426: CARP now sets DSCP value CS7(Network Traffic) in the flowlabel field of packets by default instead of only setting TOS_LOWDELAY in IPv4, Modified: stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc ============================================================================== --- stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc Tue Jul 23 20:31:54 2019 (r350259) @@ -124,7 +124,9 @@ #include #include #include +#if 0 #include +#endif #include #include #include Modified: stable/11/contrib/libunwind/src/DwarfInstructions.hpp ============================================================================== --- stable/11/contrib/libunwind/src/DwarfInstructions.hpp Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/libunwind/src/DwarfInstructions.hpp Tue Jul 23 20:31:54 2019 (r350259) @@ -234,6 +234,31 @@ int DwarfInstructions::stepWithDwarf(A &addressS } #endif +#if defined(_LIBUNWIND_TARGET_PPC64) +#define PPC64_ELFV1_R2_LOAD_INST_ENCODING 0xe8410028u // ld r2,40(r1) +#define PPC64_ELFV1_R2_OFFSET 40 +#define PPC64_ELFV2_R2_LOAD_INST_ENCODING 0xe8410018u // ld r2,24(r1) +#define PPC64_ELFV2_R2_OFFSET 24 + // If the instruction at return address is a TOC (r2) restore, + // then r2 was saved and needs to be restored. + // ELFv2 ABI specifies that the TOC Pointer must be saved at SP + 24, + // while in ELFv1 ABI it is saved at SP + 40. + if (R::getArch() == REGISTERS_PPC64 && returnAddress != 0) { + pint_t sp = newRegisters.getRegister(UNW_REG_SP); + pint_t r2 = 0; + switch (addressSpace.get32(returnAddress)) { + case PPC64_ELFV1_R2_LOAD_INST_ENCODING: + r2 = addressSpace.get64(sp + PPC64_ELFV1_R2_OFFSET); + break; + case PPC64_ELFV2_R2_LOAD_INST_ENCODING: + r2 = addressSpace.get64(sp + PPC64_ELFV2_R2_OFFSET); + break; + } + if (r2) + newRegisters.setRegister(UNW_PPC64_R2, r2); + } +#endif + // Return address is address after call site instruction, so setting IP to // that does simualates a return. newRegisters.setIP(returnAddress); Modified: stable/11/contrib/libunwind/src/UnwindRegistersRestore.S ============================================================================== --- stable/11/contrib/libunwind/src/UnwindRegistersRestore.S Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/libunwind/src/UnwindRegistersRestore.S Tue Jul 23 20:31:54 2019 (r350259) @@ -396,119 +396,119 @@ Lnovec: #elif defined(__ppc__) DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv) -; -; void libunwind::Registers_ppc::jumpto() -; -; On entry: -; thread_state pointer is in r3 -; +// +// void libunwind::Registers_ppc::jumpto() +// +// On entry: +// thread_state pointer is in r3 +// - ; restore integral registerrs - ; skip r0 for now - ; skip r1 for now - lwz r2, 16(r3) - ; skip r3 for now - ; skip r4 for now - ; skip r5 for now - lwz r6, 32(r3) - lwz r7, 36(r3) - lwz r8, 40(r3) - lwz r9, 44(r3) - lwz r10, 48(r3) - lwz r11, 52(r3) - lwz r12, 56(r3) - lwz r13, 60(r3) - lwz r14, 64(r3) - lwz r15, 68(r3) - lwz r16, 72(r3) - lwz r17, 76(r3) - lwz r18, 80(r3) - lwz r19, 84(r3) - lwz r20, 88(r3) - lwz r21, 92(r3) - lwz r22, 96(r3) - lwz r23,100(r3) - lwz r24,104(r3) - lwz r25,108(r3) - lwz r26,112(r3) - lwz r27,116(r3) - lwz r28,120(r3) - lwz r29,124(r3) - lwz r30,128(r3) - lwz r31,132(r3) + // restore integral registerrs + // skip r0 for now + // skip r1 for now + lwz %r2, 16(%r3) + // skip r3 for now + // skip r4 for now + // skip r5 for now + lwz %r6, 32(%r3) + lwz %r7, 36(%r3) + lwz %r8, 40(%r3) + lwz %r9, 44(%r3) + lwz %r10, 48(%r3) + lwz %r11, 52(%r3) + lwz %r12, 56(%r3) + lwz %r13, 60(%r3) + lwz %r14, 64(%r3) + lwz %r15, 68(%r3) + lwz %r16, 72(%r3) + lwz %r17, 76(%r3) + lwz %r18, 80(%r3) + lwz %r19, 84(%r3) + lwz %r20, 88(%r3) + lwz %r21, 92(%r3) + lwz %r22, 96(%r3) + lwz %r23,100(%r3) + lwz %r24,104(%r3) + lwz %r25,108(%r3) + lwz %r26,112(%r3) + lwz %r27,116(%r3) + lwz %r28,120(%r3) + lwz %r29,124(%r3) + lwz %r30,128(%r3) + lwz %r31,132(%r3) - ; restore float registers - lfd f0, 160(r3) - lfd f1, 168(r3) - lfd f2, 176(r3) - lfd f3, 184(r3) - lfd f4, 192(r3) - lfd f5, 200(r3) - lfd f6, 208(r3) - lfd f7, 216(r3) - lfd f8, 224(r3) - lfd f9, 232(r3) - lfd f10,240(r3) - lfd f11,248(r3) - lfd f12,256(r3) - lfd f13,264(r3) - lfd f14,272(r3) - lfd f15,280(r3) - lfd f16,288(r3) - lfd f17,296(r3) - lfd f18,304(r3) - lfd f19,312(r3) - lfd f20,320(r3) - lfd f21,328(r3) - lfd f22,336(r3) - lfd f23,344(r3) - lfd f24,352(r3) - lfd f25,360(r3) - lfd f26,368(r3) - lfd f27,376(r3) - lfd f28,384(r3) - lfd f29,392(r3) - lfd f30,400(r3) - lfd f31,408(r3) + // restore float registers + lfd %f0, 160(%r3) + lfd %f1, 168(%r3) + lfd %f2, 176(%r3) + lfd %f3, 184(%r3) + lfd %f4, 192(%r3) + lfd %f5, 200(%r3) + lfd %f6, 208(%r3) + lfd %f7, 216(%r3) + lfd %f8, 224(%r3) + lfd %f9, 232(%r3) + lfd %f10,240(%r3) + lfd %f11,248(%r3) + lfd %f12,256(%r3) + lfd %f13,264(%r3) + lfd %f14,272(%r3) + lfd %f15,280(%r3) + lfd %f16,288(%r3) + lfd %f17,296(%r3) + lfd %f18,304(%r3) + lfd %f19,312(%r3) + lfd %f20,320(%r3) + lfd %f21,328(%r3) + lfd %f22,336(%r3) + lfd %f23,344(%r3) + lfd %f24,352(%r3) + lfd %f25,360(%r3) + lfd %f26,368(%r3) + lfd %f27,376(%r3) + lfd %f28,384(%r3) + lfd %f29,392(%r3) + lfd %f30,400(%r3) + lfd %f31,408(%r3) - ; restore vector registers if any are in use - lwz r5,156(r3) ; test VRsave - cmpwi r5,0 - beq Lnovec + // restore vector registers if any are in use + lwz %r5, 156(%r3) // test VRsave + cmpwi %r5, 0 + beq Lnovec - subi r4,r1,16 - rlwinm r4,r4,0,0,27 ; mask low 4-bits - ; r4 is now a 16-byte aligned pointer into the red zone - ; the _vectorRegisters may not be 16-byte aligned so copy via red zone temp buffer + subi %r4, %r1, 16 + rlwinm %r4, %r4, 0, 0, 27 // mask low 4-bits + // r4 is now a 16-byte aligned pointer into the red zone + // the _vectorRegisters may not be 16-byte aligned so copy via red zone temp buffer + - #define LOAD_VECTOR_UNALIGNEDl(_index) \ - andis. r0,r5,(1<<(15-_index)) @\ - beq Ldone ## _index @\ - lwz r0, 424+_index*16(r3) @\ - stw r0, 0(r4) @\ - lwz r0, 424+_index*16+4(r3) @\ - stw r0, 4(r4) @\ - lwz r0, 424+_index*16+8(r3) @\ - stw r0, 8(r4) @\ - lwz r0, 424+_index*16+12(r3)@\ - stw r0, 12(r4) @\ - lvx v ## _index,0,r4 @\ -Ldone ## _index: + andis. %r0, %r5, (1<<(15-_index)) SEPARATOR \ + beq Ldone ## _index SEPARATOR \ + lwz %r0, 424+_index*16(%r3) SEPARATOR \ + stw %r0, 0(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+4(%r3) SEPARATOR \ + stw %r0, 4(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+8(%r3) SEPARATOR \ + stw %r0, 8(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+12(%r3) SEPARATOR \ + stw %r0, 12(%r4) SEPARATOR \ + lvx %v ## _index, 0, %r4 SEPARATOR \ + Ldone ## _index: #define LOAD_VECTOR_UNALIGNEDh(_index) \ - andi. r0,r5,(1<<(31-_index)) @\ - beq Ldone ## _index @\ - lwz r0, 424+_index*16(r3) @\ - stw r0, 0(r4) @\ - lwz r0, 424+_index*16+4(r3) @\ - stw r0, 4(r4) @\ - lwz r0, 424+_index*16+8(r3) @\ - stw r0, 8(r4) @\ - lwz r0, 424+_index*16+12(r3)@\ - stw r0, 12(r4) @\ - lvx v ## _index,0,r4 @\ - Ldone ## _index: + andi. %r0, %r5, (1<<(31-_index)) SEPARATOR \ + beq Ldone ## _index SEPARATOR \ + lwz %r0, 424+_index*16(%r3) SEPARATOR \ + stw %r0, 0(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+4(%r3) SEPARATOR \ + stw %r0, 4(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+8(%r3) SEPARATOR \ + stw %r0, 8(%r4) SEPARATOR \ + lwz %r0, 424+_index*16+12(%r3) SEPARATOR \ + stw %r0, 12(%r4) SEPARATOR \ + lvx %v ## _index, 0, %r4 SEPARATOR \ + Ldone ## _index: LOAD_VECTOR_UNALIGNEDl(0) @@ -545,17 +545,17 @@ Ldone ## _index: LOAD_VECTOR_UNALIGNEDh(31) Lnovec: - lwz r0, 136(r3) ; __cr - mtocrf 255,r0 - lwz r0, 148(r3) ; __ctr - mtctr r0 - lwz r0, 0(r3) ; __ssr0 - mtctr r0 - lwz r0, 8(r3) ; do r0 now - lwz r5,28(r3) ; do r5 now - lwz r4,24(r3) ; do r4 now - lwz r1,12(r3) ; do sp now - lwz r3,20(r3) ; do r3 last + lwz %r0, 136(%r3) // __cr + mtcr %r0 + lwz %r0, 148(%r3) // __ctr + mtctr %r0 + lwz %r0, 0(%r3) // __ssr0 + mtctr %r0 + lwz %r0, 8(%r3) // do r0 now + lwz %r5, 28(%r3) // do r5 now + lwz %r4, 24(%r3) // do r4 now + lwz %r1, 12(%r3) // do sp now + lwz %r3, 20(%r3) // do r3 last bctr #elif defined(__arm64__) || defined(__aarch64__) Modified: stable/11/contrib/libunwind/src/UnwindRegistersSave.S ============================================================================== --- stable/11/contrib/libunwind/src/UnwindRegistersSave.S Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/libunwind/src/UnwindRegistersSave.S Tue Jul 23 20:31:54 2019 (r350259) @@ -557,144 +557,144 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) #elif defined(__ppc__) -; -; extern int unw_getcontext(unw_context_t* thread_state) -; -; On entry: -; thread_state pointer is in r3 -; +// +// extern int unw_getcontext(unw_context_t* thread_state) +// +// On entry: +// thread_state pointer is in r3 +// DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) - stw r0, 8(r3) - mflr r0 - stw r0, 0(r3) ; store lr as ssr0 - stw r1, 12(r3) - stw r2, 16(r3) - stw r3, 20(r3) - stw r4, 24(r3) - stw r5, 28(r3) - stw r6, 32(r3) - stw r7, 36(r3) - stw r8, 40(r3) - stw r9, 44(r3) - stw r10, 48(r3) - stw r11, 52(r3) - stw r12, 56(r3) - stw r13, 60(r3) - stw r14, 64(r3) - stw r15, 68(r3) - stw r16, 72(r3) - stw r17, 76(r3) - stw r18, 80(r3) - stw r19, 84(r3) - stw r20, 88(r3) - stw r21, 92(r3) - stw r22, 96(r3) - stw r23,100(r3) - stw r24,104(r3) - stw r25,108(r3) - stw r26,112(r3) - stw r27,116(r3) - stw r28,120(r3) - stw r29,124(r3) - stw r30,128(r3) - stw r31,132(r3) + stw %r0, 8(%r3) + mflr %r0 + stw %r0, 0(%r3) // store lr as ssr0 + stw %r1, 12(%r3) + stw %r2, 16(%r3) + stw %r3, 20(%r3) + stw %r4, 24(%r3) + stw %r5, 28(%r3) + stw %r6, 32(%r3) + stw %r7, 36(%r3) + stw %r8, 40(%r3) + stw %r9, 44(%r3) + stw %r10, 48(%r3) + stw %r11, 52(%r3) + stw %r12, 56(%r3) + stw %r13, 60(%r3) + stw %r14, 64(%r3) + stw %r15, 68(%r3) + stw %r16, 72(%r3) + stw %r17, 76(%r3) + stw %r18, 80(%r3) + stw %r19, 84(%r3) + stw %r20, 88(%r3) + stw %r21, 92(%r3) + stw %r22, 96(%r3) + stw %r23,100(%r3) + stw %r24,104(%r3) + stw %r25,108(%r3) + stw %r26,112(%r3) + stw %r27,116(%r3) + stw %r28,120(%r3) + stw %r29,124(%r3) + stw %r30,128(%r3) + stw %r31,132(%r3) - ; save VRSave register - mfspr r0,256 - stw r0,156(r3) - ; save CR registers - mfcr r0 - stw r0,136(r3) - ; save CTR register - mfctr r0 - stw r0,148(r3) + // save VRSave register + mfspr %r0, 256 + stw %r0, 156(%r3) + // save CR registers + mfcr %r0 + stw %r0, 136(%r3) + // save CTR register + mfctr %r0 + stw %r0, 148(%r3) - ; save float registers - stfd f0, 160(r3) - stfd f1, 168(r3) - stfd f2, 176(r3) - stfd f3, 184(r3) - stfd f4, 192(r3) - stfd f5, 200(r3) - stfd f6, 208(r3) - stfd f7, 216(r3) - stfd f8, 224(r3) - stfd f9, 232(r3) - stfd f10,240(r3) - stfd f11,248(r3) - stfd f12,256(r3) - stfd f13,264(r3) - stfd f14,272(r3) - stfd f15,280(r3) - stfd f16,288(r3) - stfd f17,296(r3) - stfd f18,304(r3) - stfd f19,312(r3) - stfd f20,320(r3) - stfd f21,328(r3) - stfd f22,336(r3) - stfd f23,344(r3) - stfd f24,352(r3) - stfd f25,360(r3) - stfd f26,368(r3) - stfd f27,376(r3) - stfd f28,384(r3) - stfd f29,392(r3) - stfd f30,400(r3) - stfd f31,408(r3) + // save float registers + stfd %f0, 160(%r3) + stfd %f1, 168(%r3) + stfd %f2, 176(%r3) + stfd %f3, 184(%r3) + stfd %f4, 192(%r3) + stfd %f5, 200(%r3) + stfd %f6, 208(%r3) + stfd %f7, 216(%r3) + stfd %f8, 224(%r3) + stfd %f9, 232(%r3) + stfd %f10,240(%r3) + stfd %f11,248(%r3) + stfd %f12,256(%r3) + stfd %f13,264(%r3) + stfd %f14,272(%r3) + stfd %f15,280(%r3) + stfd %f16,288(%r3) + stfd %f17,296(%r3) + stfd %f18,304(%r3) + stfd %f19,312(%r3) + stfd %f20,320(%r3) + stfd %f21,328(%r3) + stfd %f22,336(%r3) + stfd %f23,344(%r3) + stfd %f24,352(%r3) + stfd %f25,360(%r3) + stfd %f26,368(%r3) + stfd %f27,376(%r3) + stfd %f28,384(%r3) + stfd %f29,392(%r3) + stfd %f30,400(%r3) + stfd %f31,408(%r3) - ; save vector registers + // save vector registers - subi r4,r1,16 - rlwinm r4,r4,0,0,27 ; mask low 4-bits - ; r4 is now a 16-byte aligned pointer into the red zone + subi %r4, %r1, 16 + rlwinm %r4, %r4, 0, 0, 27 // mask low 4-bits + // r4 is now a 16-byte aligned pointer into the red zone #define SAVE_VECTOR_UNALIGNED(_vec, _offset) \ - stvx _vec,0,r4 @\ - lwz r5, 0(r4) @\ - stw r5, _offset(r3) @\ - lwz r5, 4(r4) @\ - stw r5, _offset+4(r3) @\ - lwz r5, 8(r4) @\ - stw r5, _offset+8(r3) @\ - lwz r5, 12(r4) @\ - stw r5, _offset+12(r3) + stvx _vec, 0, %r4 SEPARATOR \ + lwz %r5, 0(%r4) SEPARATOR \ + stw %r5, _offset(%r3) SEPARATOR \ + lwz %r5, 4(%r4) SEPARATOR \ + stw %r5, _offset+4(%r3) SEPARATOR \ + lwz %r5, 8(%r4) SEPARATOR \ + stw %r5, _offset+8(%r3) SEPARATOR \ + lwz %r5, 12(%r4) SEPARATOR \ + stw %r5, _offset+12(%r3) - SAVE_VECTOR_UNALIGNED( v0, 424+0x000) - SAVE_VECTOR_UNALIGNED( v1, 424+0x010) - SAVE_VECTOR_UNALIGNED( v2, 424+0x020) - SAVE_VECTOR_UNALIGNED( v3, 424+0x030) - SAVE_VECTOR_UNALIGNED( v4, 424+0x040) - SAVE_VECTOR_UNALIGNED( v5, 424+0x050) - SAVE_VECTOR_UNALIGNED( v6, 424+0x060) - SAVE_VECTOR_UNALIGNED( v7, 424+0x070) - SAVE_VECTOR_UNALIGNED( v8, 424+0x080) - SAVE_VECTOR_UNALIGNED( v9, 424+0x090) - SAVE_VECTOR_UNALIGNED(v10, 424+0x0A0) - SAVE_VECTOR_UNALIGNED(v11, 424+0x0B0) - SAVE_VECTOR_UNALIGNED(v12, 424+0x0C0) - SAVE_VECTOR_UNALIGNED(v13, 424+0x0D0) - SAVE_VECTOR_UNALIGNED(v14, 424+0x0E0) - SAVE_VECTOR_UNALIGNED(v15, 424+0x0F0) - SAVE_VECTOR_UNALIGNED(v16, 424+0x100) - SAVE_VECTOR_UNALIGNED(v17, 424+0x110) - SAVE_VECTOR_UNALIGNED(v18, 424+0x120) - SAVE_VECTOR_UNALIGNED(v19, 424+0x130) - SAVE_VECTOR_UNALIGNED(v20, 424+0x140) - SAVE_VECTOR_UNALIGNED(v21, 424+0x150) - SAVE_VECTOR_UNALIGNED(v22, 424+0x160) - SAVE_VECTOR_UNALIGNED(v23, 424+0x170) - SAVE_VECTOR_UNALIGNED(v24, 424+0x180) - SAVE_VECTOR_UNALIGNED(v25, 424+0x190) - SAVE_VECTOR_UNALIGNED(v26, 424+0x1A0) - SAVE_VECTOR_UNALIGNED(v27, 424+0x1B0) - SAVE_VECTOR_UNALIGNED(v28, 424+0x1C0) - SAVE_VECTOR_UNALIGNED(v29, 424+0x1D0) - SAVE_VECTOR_UNALIGNED(v30, 424+0x1E0) - SAVE_VECTOR_UNALIGNED(v31, 424+0x1F0) + SAVE_VECTOR_UNALIGNED( %v0, 424+0x000) + SAVE_VECTOR_UNALIGNED( %v1, 424+0x010) + SAVE_VECTOR_UNALIGNED( %v2, 424+0x020) + SAVE_VECTOR_UNALIGNED( %v3, 424+0x030) + SAVE_VECTOR_UNALIGNED( %v4, 424+0x040) + SAVE_VECTOR_UNALIGNED( %v5, 424+0x050) + SAVE_VECTOR_UNALIGNED( %v6, 424+0x060) + SAVE_VECTOR_UNALIGNED( %v7, 424+0x070) + SAVE_VECTOR_UNALIGNED( %v8, 424+0x080) + SAVE_VECTOR_UNALIGNED( %v9, 424+0x090) + SAVE_VECTOR_UNALIGNED(%v10, 424+0x0A0) + SAVE_VECTOR_UNALIGNED(%v11, 424+0x0B0) + SAVE_VECTOR_UNALIGNED(%v12, 424+0x0C0) + SAVE_VECTOR_UNALIGNED(%v13, 424+0x0D0) + SAVE_VECTOR_UNALIGNED(%v14, 424+0x0E0) + SAVE_VECTOR_UNALIGNED(%v15, 424+0x0F0) + SAVE_VECTOR_UNALIGNED(%v16, 424+0x100) + SAVE_VECTOR_UNALIGNED(%v17, 424+0x110) + SAVE_VECTOR_UNALIGNED(%v18, 424+0x120) + SAVE_VECTOR_UNALIGNED(%v19, 424+0x130) + SAVE_VECTOR_UNALIGNED(%v20, 424+0x140) + SAVE_VECTOR_UNALIGNED(%v21, 424+0x150) + SAVE_VECTOR_UNALIGNED(%v22, 424+0x160) + SAVE_VECTOR_UNALIGNED(%v23, 424+0x170) + SAVE_VECTOR_UNALIGNED(%v24, 424+0x180) + SAVE_VECTOR_UNALIGNED(%v25, 424+0x190) + SAVE_VECTOR_UNALIGNED(%v26, 424+0x1A0) + SAVE_VECTOR_UNALIGNED(%v27, 424+0x1B0) + SAVE_VECTOR_UNALIGNED(%v28, 424+0x1C0) + SAVE_VECTOR_UNALIGNED(%v29, 424+0x1D0) + SAVE_VECTOR_UNALIGNED(%v30, 424+0x1E0) + SAVE_VECTOR_UNALIGNED(%v31, 424+0x1F0) - li r3, 0 ; return UNW_ESUCCESS + li %r3, 0 // return UNW_ESUCCESS blr Modified: stable/11/contrib/libunwind/src/assembly.h ============================================================================== --- stable/11/contrib/libunwind/src/assembly.h Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/libunwind/src/assembly.h Tue Jul 23 20:31:54 2019 (r350259) @@ -29,14 +29,26 @@ #ifdef _ARCH_PWR8 #define PPC64_HAS_VMX #endif -#elif defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__) -#define SEPARATOR @ #elif defined(__arm64__) #define SEPARATOR %% #else #define SEPARATOR ; #endif +#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) +#define PPC64_OPD1 .section .opd,"aw",@progbits SEPARATOR +#define PPC64_OPD2 SEPARATOR \ + .p2align 3 SEPARATOR \ + .quad .Lfunc_begin0 SEPARATOR \ + .quad .TOC.@tocbase SEPARATOR \ + .quad 0 SEPARATOR \ + .text SEPARATOR \ +.Lfunc_begin0: +#else +#define PPC64_OPD1 +#define PPC64_OPD2 +#endif + #define GLUE2(a, b) a ## b #define GLUE(a, b) GLUE2(a, b) #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name) @@ -97,13 +109,17 @@ .globl SYMBOL_NAME(name) SEPARATOR \ EXPORT_SYMBOL(name) SEPARATOR \ SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \ - SYMBOL_NAME(name): + PPC64_OPD1 \ + SYMBOL_NAME(name): \ + PPC64_OPD2 #define DEFINE_LIBUNWIND_PRIVATE_FUNCTION(name) \ .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: stable/11/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp ============================================================================== --- stable/11/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp Tue Jul 23 20:31:54 2019 (r350259) @@ -301,7 +301,7 @@ void CIE::dump(raw_ostream &OS, const MCRegisterInfo * OS << format(" Data alignment factor: %d\n", (int32_t)DataAlignmentFactor); OS << format(" Return address column: %d\n", (int32_t)ReturnAddressRegister); if (Personality) - OS << format(" Personality Address: %08x\n", *Personality); + OS << format(" Personality Address: %016" PRIx64 "\n", *Personality); if (!AugmentationData.empty()) { OS << " Augmentation data: "; for (uint8_t Byte : AugmentationData) @@ -320,7 +320,7 @@ void FDE::dump(raw_ostream &OS, const MCRegisterInfo * (uint32_t)InitialLocation, (uint32_t)InitialLocation + (uint32_t)AddressRange); if (LSDAAddress) - OS << format(" LSDA Address: %08x\n", *LSDAAddress); + OS << format(" LSDA Address: %016" PRIx64 "\n", *LSDAAddress); CFIs.dump(OS, MRI, IsEH); OS << "\n"; } Modified: stable/11/contrib/llvm/lib/MC/ELFObjectWriter.cpp ============================================================================== --- stable/11/contrib/llvm/lib/MC/ELFObjectWriter.cpp Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/llvm/lib/MC/ELFObjectWriter.cpp Tue Jul 23 20:31:54 2019 (r350259) @@ -1271,6 +1271,7 @@ void ELFObjectWriter::executePostLayoutBinding(MCAssem // This is the first place we are able to copy this information. Alias->setExternal(Symbol.isExternal()); Alias->setBinding(Symbol.getBinding()); + Alias->setOther(Symbol.getOther()); if (!Symbol.isUndefined() && !Rest.startswith("@@@")) continue; Modified: stable/11/contrib/llvm/lib/MC/MCWin64EH.cpp ============================================================================== --- stable/11/contrib/llvm/lib/MC/MCWin64EH.cpp Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/llvm/lib/MC/MCWin64EH.cpp Tue Jul 23 20:31:54 2019 (r350259) @@ -522,7 +522,7 @@ static void ARM64EmitUnwindInfo(MCStreamer &streamer, if (MatchingEpilog) { assert(EpilogInfo.find(MatchingEpilog) != EpilogInfo.end() && "Duplicate epilog not found"); - EpilogInfo[EpilogStart] = EpilogInfo[MatchingEpilog]; + EpilogInfo[EpilogStart] = EpilogInfo.lookup(MatchingEpilog); // Clear the unwind codes in the EpilogMap, so that they don't get output // in the logic below. EpilogInstrs.clear(); Modified: stable/11/contrib/llvm/lib/MC/WasmObjectWriter.cpp ============================================================================== --- stable/11/contrib/llvm/lib/MC/WasmObjectWriter.cpp Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/llvm/lib/MC/WasmObjectWriter.cpp Tue Jul 23 20:31:54 2019 (r350259) @@ -368,7 +368,13 @@ void WasmObjectWriter::startCustomSection(SectionBookk // Now that the section is complete and we know how big it is, patch up the // section size field at the start of the section. void WasmObjectWriter::endSection(SectionBookkeeping &Section) { - uint64_t Size = W.OS.tell() - Section.PayloadOffset; + uint64_t Size = W.OS.tell(); + // /dev/null doesn't support seek/tell and can report offset of 0. + // Simply skip this patching in that case. + if (!Size) + return; + + Size -= Section.PayloadOffset; if (uint32_t(Size) != Size) report_fatal_error("section size does not fit in a uint32_t"); Modified: stable/11/contrib/llvm/lib/Object/COFFImportFile.cpp ============================================================================== --- stable/11/contrib/llvm/lib/Object/COFFImportFile.cpp Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/llvm/lib/Object/COFFImportFile.cpp Tue Jul 23 20:31:54 2019 (r350259) @@ -496,7 +496,7 @@ NewArchiveMember ObjectFactory::createWeakExternal(Str // COFF Header coff_file_header Header{ - u16(0), + u16(Machine), u16(NumberOfSections), u32(0), u32(sizeof(Header) + (NumberOfSections * sizeof(coff_section))), Modified: stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td ============================================================================== --- stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedExynosM4.td Tue Jul 23 20:31:54 2019 (r350259) @@ -239,7 +239,6 @@ def M4WriteNEONK : SchedWriteRes<[M4UnitNSHF, M4UnitS0]> { let Latency = 5; let NumMicroOps = 2; } def M4WriteNEONL : SchedWriteRes<[M4UnitNMUL]> { let Latency = 3; } -def M4WriteNEONM : SchedWriteRes<[M4UnitNMUL]> { let Latency = 3; } def M4WriteNEONN : SchedWriteRes<[M4UnitNMSC, M4UnitNMSC]> { let Latency = 5; let NumMicroOps = 2; } @@ -480,8 +479,6 @@ def M4WriteCOPY : SchedWriteVariant<[SchedVar]>; def M4WriteMOVI : SchedWriteVariant<[SchedVar, SchedVar]>; -def M4WriteMULL : SchedWriteVariant<[SchedVar, - SchedVar]>; // Fast forwarding. def M4ReadAESM1 : SchedReadAdvance<+1, [M4WriteNCRY1]>; @@ -489,8 +486,9 @@ def M4ReadFMACM1 : SchedReadAdvance<+1, [M4WriteFMAC M4WriteFMAC4H, M4WriteFMAC5]>; def M4ReadNMULM1 : SchedReadAdvance<+1, [M4WriteNMUL3]>; -def M4ReadMULLP2 : SchedReadAdvance<-2, [M4WriteNEONM]>; +def M4ReadNMULP2 : SchedReadAdvance<-2, [M4WriteNMUL3]>; + //===----------------------------------------------------------------------===// // Coarse scheduling model. @@ -662,10 +660,8 @@ def : InstRW<[M4WriteNEONK], (instregex "^FMOVDXHighr def : InstRW<[M4WriteFCVT3H], (instregex "^F(RECP|RSQRT)Ev1f16")>; def : InstRW<[M4WriteFCVT3], (instregex "^F(RECP|RSQRT)Ev1i(32|64)")>; def : InstRW<[M4WriteNMSC1], (instregex "^FRECPXv1")>; -def : InstRW<[M4WriteFMAC4H, - M4ReadFMACM1], (instregex "^F(RECP|RSQRT)S16")>; -def : InstRW<[M4WriteFMAC4, - M4ReadFMACM1], (instregex "^F(RECP|RSQRT)S(32|64)")>; +def : InstRW<[M4WriteFMAC4H], (instregex "^F(RECP|RSQRT)S16")>; +def : InstRW<[M4WriteFMAC4], (instregex "^F(RECP|RSQRT)S(32|64)")>; // FP load instructions. def : InstRW<[WriteVLD], (instregex "^LDR[SDQ]l")>; @@ -736,14 +732,20 @@ def : InstRW<[M4WriteNALU1], (instregex "^(AND|BIC|EO def : InstRW<[M4WriteNMSC1], (instregex "^[SU](MIN|MAX)v")>; def : InstRW<[M4WriteNMSC2], (instregex "^[SU](MIN|MAX)Pv")>; def : InstRW<[M4WriteNHAD3], (instregex "^[SU](MIN|MAX)Vv")>; -def : InstRW<[M4WriteNMUL3], (instregex "^(SQR?D)?MULH?v")>; def : InstRW<[M4WriteNMUL3, M4ReadNMULM1], (instregex "^ML[AS]v")>; -def : InstRW<[M4WriteNMUL3], (instregex "^SQRDML[AS]H")>; -def : InstRW<[M4WriteMULL, - M4ReadMULLP2], (instregex "^(S|U|SQD)ML[AS]Lv")>; -def : InstRW<[M4WriteMULL, - M4ReadMULLP2], (instregex "^(S|U|SQD)MULLv")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULM1], (instregex "^(SQR?D)?MULH?v")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULM1], (instregex "^SQRDML[AS]H")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULM1], (instregex "^(S|U|SQD)ML[AS]L(v1(i32|i64)|v2i32|v4i16|v8i8)")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULP2], (instregex "^(S|U|SQD)ML[AS]L(v4i32|v8i16|v16i8)")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULM1], (instregex "^(S|U|SQD)MULL(v1(i32|i64)|v2i32|v4i16|v8i8)")>; +def : InstRW<[M4WriteNMUL3, + M4ReadNMULP2], (instregex "^(S|U|SQD)MULL(v4i32|v8i16|v16i8)")>; def : InstRW<[M4WriteNMUL3], (instregex "^[SU]DOT(lane)?v")>; def : InstRW<[M4WriteNHAD3], (instregex "^[SU]ADALPv")>; def : InstRW<[M4WriteNSHT4A], (instregex "^[SU]R?SRA[dv]")>; @@ -808,10 +810,8 @@ def : InstRW<[M4WriteNALU1], (instregex "^FMOVv.f(32| def : InstRW<[M4WriteFCVT3H], (instregex "^F(RECP|RSQRT)Ev[248]f16")>; def : InstRW<[M4WriteFCVT3], (instregex "^F(RECP|RSQRT)Ev[248]f(32|64)")>; def : InstRW<[M4WriteFCVT3], (instregex "^U(RECP|RSQRT)Ev[24]i32")>; -def : InstRW<[M4WriteFMAC4H, - M4ReadFMACM1], (instregex "^F(RECP|RSQRT)Sv.f16")>; -def : InstRW<[M4WriteFMAC4, - M4ReadFMACM1], (instregex "^F(RECP|RSQRT)Sv.f(32|64)")>; +def : InstRW<[M4WriteFMAC4H], (instregex "^F(RECP|RSQRT)Sv.f16")>; +def : InstRW<[M4WriteFMAC4], (instregex "^F(RECP|RSQRT)Sv.f(32|64)")>; def : InstRW<[M4WriteNSHF1], (instregex "^REV(16|32|64)v")>; def : InstRW<[M4WriteNSHFA], (instregex "^TB[LX]v(8|16)i8One")>; def : InstRW<[M4WriteNSHFB], (instregex "^TB[LX]v(8|16)i8Two")>; Modified: stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedPredExynos.td ============================================================================== --- stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedPredExynos.td Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedPredExynos.td Tue Jul 23 20:31:54 2019 (r350259) @@ -103,17 +103,6 @@ def ExynosScaledIdxPred : MCSchedPredicate>; -// Identify whether an instruction whose result is a long vector -// operates on the upper half of the input registers. -def ExynosLongVectorUpperFn : TIIPredicate< - "isExynosLongVectorUpper", - MCOpcodeSwitchStatement< - [MCOpcodeSwitchCase< - IsLongVectorUpperOp.ValidOpcodes, - MCReturnStatement>], - MCReturnStatement>>; -def ExynosLongVectorUpperPred : MCSchedPredicate; - // Identify 128-bit NEON instructions. def ExynosQFormPred : MCSchedPredicate; Modified: stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedPredicates.td ============================================================================== --- stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedPredicates.td Tue Jul 23 20:28:29 2019 (r350258) +++ stable/11/contrib/llvm/lib/Target/AArch64/AArch64SchedPredicates.td Tue Jul 23 20:31:54 2019 (r350259) @@ -268,59 +268,6 @@ def IsStoreRegOffsetOp : CheckOpcode<[STRBBroW, ST def IsLoadStoreRegOffsetOp : CheckOpcode; -// Identify whether an instruction whose result is a long vector -// operates on the upper half of the input registers. -def IsLongVectorUpperOp : CheckOpcode<[FCVTLv8i16, FCVTLv4i32, - FCVTNv8i16, FCVTNv4i32, - FCVTXNv4f32, - PMULLv16i8, PMULLv2i64, - RADDHNv8i16_v16i8, RADDHNv4i32_v8i16, RADDHNv2i64_v4i32, - RSHRNv16i8_shift, RSHRNv8i16_shift, RSHRNv4i32_shift, - RSUBHNv8i16_v16i8, RSUBHNv4i32_v8i16, RSUBHNv2i64_v4i32, - SABALv16i8_v8i16, SABALv8i16_v4i32, SABALv4i32_v2i64, - SABDLv16i8_v8i16, SABDLv8i16_v4i32, SABDLv4i32_v2i64, - SADDLv16i8_v8i16, SADDLv8i16_v4i32, SADDLv4i32_v2i64, - SADDWv16i8_v8i16, SADDWv8i16_v4i32, SADDWv4i32_v2i64, - SHLLv16i8, SHLLv8i16, SHLLv4i32, - SHRNv16i8_shift, SHRNv8i16_shift, SHRNv4i32_shift, - SMLALv16i8_v8i16, SMLALv8i16_v4i32, SMLALv4i32_v2i64, - SMLALv8i16_indexed, SMLALv4i32_indexed, - SMLSLv16i8_v8i16, SMLSLv8i16_v4i32, SMLSLv4i32_v2i64, - SMLSLv8i16_indexed, SMLSLv4i32_indexed, - SMULLv16i8_v8i16, SMULLv8i16_v4i32, SMULLv4i32_v2i64, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jul 23 20:59: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 D8C1DB35A6; Tue, 23 Jul 2019 20:59:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 AB026752EA; Tue, 23 Jul 2019 20:59:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87C3F3957; Tue, 23 Jul 2019 20:59:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NKxbOO008327; Tue, 23 Jul 2019 20:59:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NKxb9J008326; Tue, 23 Jul 2019 20:59:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907232059.x6NKxb9J008326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Jul 2019 20:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350260 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AB026752EA 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.969,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, 23 Jul 2019 20:59:37 -0000 Author: emaste Date: Tue Jul 23 20:59:36 2019 New Revision: 350260 URL: https://svnweb.freebsd.org/changeset/base/350260 Log: mqueuefs: fix struct file leak In some error cases we previously leaked a stuct file. Submitted by: mjg, markj Modified: head/sys/kern/uipc_mqueue.c Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Tue Jul 23 20:31:54 2019 (r350259) +++ head/sys/kern/uipc_mqueue.c Tue Jul 23 20:59:36 2019 (r350260) @@ -2283,13 +2283,14 @@ sys_kmq_timedreceive(struct thread *td, struct kmq_tim if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets, sizeof(ets)); if (error != 0) - return (error); + goto out; abs_timeout = &ets; } else abs_timeout = NULL; waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } @@ -2309,13 +2310,14 @@ sys_kmq_timedsend(struct thread *td, struct kmq_timeds if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets, sizeof(ets)); if (error != 0) - return (error); + goto out; abs_timeout = &ets; } else abs_timeout = NULL; waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_send(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } @@ -2834,7 +2836,7 @@ freebsd32_kmq_timedreceive(struct thread *td, if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets32, sizeof(ets32)); if (error != 0) - return (error); + goto out; CP(ets32, ets, tv_sec); CP(ets32, ets, tv_nsec); abs_timeout = &ets; @@ -2843,6 +2845,7 @@ freebsd32_kmq_timedreceive(struct thread *td, waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } From owner-svn-src-all@freebsd.org Tue Jul 23 21:12: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 550E7B3C29; Tue, 23 Jul 2019 21:12:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 3646975CD0; Tue, 23 Jul 2019 21:12:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F5633D7C; Tue, 23 Jul 2019 21:12:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NLCW6D019857; Tue, 23 Jul 2019 21:12:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NLCWKD019856; Tue, 23 Jul 2019 21:12:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907232112.x6NLCWKD019856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Jul 2019 21:12: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: r350261 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 350261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3646975CD0 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: Tue, 23 Jul 2019 21:12:33 -0000 Author: emaste Date: Tue Jul 23 21:12:32 2019 New Revision: 350261 URL: https://svnweb.freebsd.org/changeset/base/350261 Log: MFC r350260: mqueuefs: fix struct file leak In some error cases we previously leaked a stuct file. Submitted by: mjg, markj Approved by: so (insta-MFC) Modified: stable/12/sys/kern/uipc_mqueue.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/uipc_mqueue.c ============================================================================== --- stable/12/sys/kern/uipc_mqueue.c Tue Jul 23 20:59:36 2019 (r350260) +++ stable/12/sys/kern/uipc_mqueue.c Tue Jul 23 21:12:32 2019 (r350261) @@ -2275,13 +2275,14 @@ sys_kmq_timedreceive(struct thread *td, struct kmq_tim if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets, sizeof(ets)); if (error != 0) - return (error); + goto out; abs_timeout = &ets; } else abs_timeout = NULL; waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } @@ -2301,13 +2302,14 @@ sys_kmq_timedsend(struct thread *td, struct kmq_timeds if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets, sizeof(ets)); if (error != 0) - return (error); + goto out; abs_timeout = &ets; } else abs_timeout = NULL; waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_send(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } @@ -2826,7 +2828,7 @@ freebsd32_kmq_timedreceive(struct thread *td, if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets32, sizeof(ets32)); if (error != 0) - return (error); + goto out; CP(ets32, ets, tv_sec); CP(ets32, ets, tv_nsec); abs_timeout = &ets; @@ -2835,6 +2837,7 @@ freebsd32_kmq_timedreceive(struct thread *td, waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } From owner-svn-src-all@freebsd.org Tue Jul 23 21:14: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 DB50DB3CFB; Tue, 23 Jul 2019 21:14:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 BD1F375E74; Tue, 23 Jul 2019 21:14:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98D0F3D8B; Tue, 23 Jul 2019 21:14:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NLEOhQ019988; Tue, 23 Jul 2019 21:14:24 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NLEOnT019987; Tue, 23 Jul 2019 21:14:24 GMT (envelope-from np@FreeBSD.org) Message-Id: <201907232114.x6NLEOnT019987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 23 Jul 2019 21:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350262 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 350262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BD1F375E74 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]; 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, 23 Jul 2019 21:14:24 -0000 Author: np Date: Tue Jul 23 21:14:24 2019 New Revision: 350262 URL: https://svnweb.freebsd.org/changeset/base/350262 Log: MFC r349865: cxgbe(4): Use the simplest configuration possible when falling back from the default configuration. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Tue Jul 23 21:12:32 2019 (r350261) +++ stable/12/sys/dev/cxgbe/t4_main.c Tue Jul 23 21:14:24 2019 (r350262) @@ -4012,10 +4012,8 @@ retry: rc, cfg_file); snprintf(cfg_file, sizeof(cfg_file), "%s", BUILTIN_CF); bzero(&caps_allowed, sizeof(caps_allowed)); - COPY_CAPS(nbm); - COPY_CAPS(link); COPY_CAPS(switch); - COPY_CAPS(nic); + caps_allowed.niccaps = FW_CAPS_CONFIG_NIC; fallback = false; goto retry; } From owner-svn-src-all@freebsd.org Tue Jul 23 21:15: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 572C2B3DB4; Tue, 23 Jul 2019 21:15:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 3A6FF75FE2; Tue, 23 Jul 2019 21:15:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1555E3D8F; Tue, 23 Jul 2019 21:15:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NLFSub020099; Tue, 23 Jul 2019 21:15:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NLFS1E020098; Tue, 23 Jul 2019 21:15:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907232115.x6NLFS1E020098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Jul 2019 21:15:28 +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: r350263 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 350263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A6FF75FE2 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]; 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, 23 Jul 2019 21:15:29 -0000 Author: emaste Date: Tue Jul 23 21:15:28 2019 New Revision: 350263 URL: https://svnweb.freebsd.org/changeset/base/350263 Log: MFC r350260: mqueuefs: fix struct file leak In some error cases we previously leaked a stuct file. Submitted by: mjg, markj Approved by: so (insta-MFC) Modified: stable/11/sys/kern/uipc_mqueue.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_mqueue.c ============================================================================== --- stable/11/sys/kern/uipc_mqueue.c Tue Jul 23 21:14:24 2019 (r350262) +++ stable/11/sys/kern/uipc_mqueue.c Tue Jul 23 21:15:28 2019 (r350263) @@ -2266,13 +2266,14 @@ sys_kmq_timedreceive(struct thread *td, struct kmq_tim if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets, sizeof(ets)); if (error != 0) - return (error); + goto out; abs_timeout = &ets; } else abs_timeout = NULL; waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } @@ -2291,13 +2292,14 @@ sys_kmq_timedsend(struct thread *td, struct kmq_timeds if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets, sizeof(ets)); if (error != 0) - return (error); + goto out; abs_timeout = &ets; } else abs_timeout = NULL; waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_send(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } @@ -2815,7 +2817,7 @@ freebsd32_kmq_timedreceive(struct thread *td, if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets32, sizeof(ets32)); if (error != 0) - return (error); + goto out; CP(ets32, ets, tv_sec); CP(ets32, ets, tv_nsec); abs_timeout = &ets; @@ -2824,6 +2826,7 @@ freebsd32_kmq_timedreceive(struct thread *td, waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } From owner-svn-src-all@freebsd.org Tue Jul 23 21:26:03 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 F0FAFB41FB; Tue, 23 Jul 2019 21:26:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 D4D2F767BD; Tue, 23 Jul 2019 21:26:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A76043F63; Tue, 23 Jul 2019 21:26:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NLQ3oe026103; Tue, 23 Jul 2019 21:26:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NLQ32W026102; Tue, 23 Jul 2019 21:26:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201907232126.x6NLQ32W026102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 23 Jul 2019 21:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350264 - stable/12/sys/dev/cxgbe/common X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe/common X-SVN-Commit-Revision: 350264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D4D2F767BD 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: Tue, 23 Jul 2019 21:26:04 -0000 Author: np Date: Tue Jul 23 21:26:03 2019 New Revision: 350264 URL: https://svnweb.freebsd.org/changeset/base/350264 Log: MFC r349956: cxgbe(4): Completely ignore all top level interrupts that are not enabled. The driver used to log any non-zero cause and when running with a single line interrupt it would spam the console/logs with reports of interrupts that are of no interest to anyone. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/common/t4_hw.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/12/sys/dev/cxgbe/common/t4_hw.c Tue Jul 23 21:15:28 2019 (r350263) +++ stable/12/sys/dev/cxgbe/common/t4_hw.c Tue Jul 23 21:26:03 2019 (r350264) @@ -4023,17 +4023,16 @@ t4_handle_intr(struct adapter *adap, const struct intr bool rc; const struct intr_action *action; - /* read and display cause. */ - cause = t4_read_reg(adap, ii->cause_reg); - if (verbose || cause != 0) - t4_show_intr_info(adap, ii, cause); /* - * The top level interrupt cause is a bit special and we need to ignore - * the bits that are not in the enable. Note that we did display them - * above in t4_show_intr_info but will not clear them. + * Read and display cause. Note that the top level PL_INT_CAUSE is a + * bit special and we need to completely ignore the bits that are not in + * PL_INT_ENABLE. */ + cause = t4_read_reg(adap, ii->cause_reg); if (ii->cause_reg == A_PL_INT_CAUSE) cause &= t4_read_reg(adap, ii->enable_reg); + if (verbose || cause != 0) + t4_show_intr_info(adap, ii, cause); fatal = cause & ii->fatal; if (fatal != 0 && ii->flags & NONFATAL_IF_DISABLED) fatal &= t4_read_reg(adap, ii->enable_reg); From owner-svn-src-all@freebsd.org Tue Jul 23 21: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 729CEB42A3; Tue, 23 Jul 2019 21:28: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 540B676993; Tue, 23 Jul 2019 21:28:21 +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 2E05C3F65; Tue, 23 Jul 2019 21:28:21 +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 x6NLSLlh026243; Tue, 23 Jul 2019 21:28:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NLSKuW026240; Tue, 23 Jul 2019 21:28:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201907232128.x6NLSKuW026240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 23 Jul 2019 21:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350265 - in head: share/man/man4 sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head: share/man/man4 sys/netinet X-SVN-Commit-Revision: 350265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 540B676993 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: Tue, 23 Jul 2019 21:28:21 -0000 Author: tuexen Date: Tue Jul 23 21:28:20 2019 New Revision: 350265 URL: https://svnweb.freebsd.org/changeset/base/350265 Log: Add a sysctl variable ts_offset_per_conn to change the computation of the TCP TS offset from taking the IP addresses and the TCP port numbers into account to a version just taking only the IP addresses into account. This works around broken middleboxes or endpoints. The default is to keep the behaviour, which is also the behaviour recommended in RFC 7323. Reported by: devgs@ukr.net Reviewed by: rrs@ MFC after: 2 weeks Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D20980 Modified: head/share/man/man4/tcp.4 head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Tue Jul 23 21:26:03 2019 (r350264) +++ head/share/man/man4/tcp.4 Tue Jul 23 21:28:20 2019 (r350265) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd March 23, 2019 +.Dd July 23, 2019 .Dt TCP 4 .Os .Sh NAME @@ -606,6 +606,10 @@ Default is false. .It Va insecure_syn Use criteria defined in RFC793 instead of RFC5961 for accepting SYN segments. Default is false. +.It Va ts_offset_per_conn +When initializing the TCP timestamps, use a per connection offset instead of a +per host pair offset. +Default is to use per connection offsets as recommended in RFC 7323. .El .Sh ERRORS A socket operation may fail with one of the following errors returned: Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Jul 23 21:26:03 2019 (r350264) +++ head/sys/netinet/tcp_subr.c Tue Jul 23 21:28:20 2019 (r350265) @@ -195,6 +195,11 @@ SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323, &VNET_NAME(tcp_do_rfc1323), 0, "Enable rfc1323 (high performance TCP) extensions"); +VNET_DEFINE(int, tcp_ts_offset_per_conn) = 1; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, ts_offset_per_conn, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(tcp_ts_offset_per_conn), 0, + "Initialize TCP timestamps per connection instead of per host pair"); + static int tcp_log_debug = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_debug, CTLFLAG_RW, &tcp_log_debug, 0, "Log errors caused by incoming TCP segments"); @@ -2634,7 +2639,17 @@ tcp_keyed_hash(struct in_conninfo *inc, u_char *key, u uint32_t tcp_new_ts_offset(struct in_conninfo *inc) { - return (tcp_keyed_hash(inc, V_ts_offset_secret, + struct in_conninfo inc_store, *local_inc; + + if (!V_tcp_ts_offset_per_conn) { + memcpy(&inc_store, inc, sizeof(struct in_conninfo)); + inc_store.inc_lport = 0; + inc_store.inc_fport = 0; + local_inc = &inc_store; + } else { + local_inc = inc; + } + return (tcp_keyed_hash(local_inc, V_ts_offset_secret, sizeof(V_ts_offset_secret))); } Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Jul 23 21:26:03 2019 (r350264) +++ head/sys/netinet/tcp_var.h Tue Jul 23 21:28:20 2019 (r350265) @@ -802,6 +802,7 @@ VNET_DECLARE(struct inpcbinfo, tcbinfo); #define V_tcp_do_autosndbuf VNET(tcp_do_autosndbuf) #define V_tcp_do_ecn VNET(tcp_do_ecn) #define V_tcp_do_rfc1323 VNET(tcp_do_rfc1323) +#define V_tcp_ts_offset_per_conn VNET(tcp_ts_offset_per_conn) #define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042) #define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) #define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) From owner-svn-src-all@freebsd.org Tue Jul 23 22:00: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 5D29AB5238; Tue, 23 Jul 2019 22:00:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 3E9C98030B; Tue, 23 Jul 2019 22:00:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1C6345EF; Tue, 23 Jul 2019 22:00:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NM0JHV044735; Tue, 23 Jul 2019 22:00:19 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NM0JaO044734; Tue, 23 Jul 2019 22:00:19 GMT (envelope-from np@FreeBSD.org) Message-Id: <201907232200.x6NM0JaO044734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 23 Jul 2019 22:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350266 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 350266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E9C98030B 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: Tue, 23 Jul 2019 22:00:20 -0000 Author: np Date: Tue Jul 23 22:00:19 2019 New Revision: 350266 URL: https://svnweb.freebsd.org/changeset/base/350266 Log: MFC r349870: cxgbe(4): Clear the freelist statistics in the clearstats ioctl. Move all clearstats code into its own function while here. Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Tue Jul 23 21:28:20 2019 (r350265) +++ stable/12/sys/dev/cxgbe/t4_main.c Tue Jul 23 22:00:19 2019 (r350266) @@ -694,6 +694,7 @@ static void free_offload_policy(struct t4_offload_poli static int set_offload_policy(struct adapter *, struct t4_offload_policy *); static int read_card_mem(struct adapter *, int, struct t4_mem_range *); static int read_i2c(struct adapter *, struct t4_i2c_data *); +static int clear_stats(struct adapter *, u_int); #ifdef TCP_OFFLOAD static int toe_capability(struct vi_info *, int); #endif @@ -9837,6 +9838,107 @@ read_i2c(struct adapter *sc, struct t4_i2c_data *i2cd) return (rc); } +static int +clear_stats(struct adapter *sc, u_int port_id) +{ + int i, v, bg_map; + struct port_info *pi; + struct vi_info *vi; + struct sge_rxq *rxq; + struct sge_txq *txq; + struct sge_wrq *wrq; +#ifdef TCP_OFFLOAD + struct sge_ofld_rxq *ofld_rxq; +#endif + + if (port_id >= sc->params.nports) + return (EINVAL); + pi = sc->port[port_id]; + if (pi == NULL) + return (EIO); + + /* MAC stats */ + t4_clr_port_stats(sc, pi->tx_chan); + pi->tx_parse_error = 0; + pi->tnl_cong_drops = 0; + mtx_lock(&sc->reg_lock); + for_each_vi(pi, v, vi) { + if (vi->flags & VI_INIT_DONE) + t4_clr_vi_stats(sc, vi->vin); + } + bg_map = pi->mps_bg_map; + v = 0; /* reuse */ + while (bg_map) { + i = ffs(bg_map) - 1; + t4_write_indirect(sc, A_TP_MIB_INDEX, A_TP_MIB_DATA, &v, + 1, A_TP_MIB_TNL_CNG_DROP_0 + i); + bg_map &= ~(1 << i); + } + mtx_unlock(&sc->reg_lock); + + /* + * Since this command accepts a port, clear stats for + * all VIs on this port. + */ + for_each_vi(pi, v, vi) { + if (vi->flags & VI_INIT_DONE) { + + for_each_rxq(vi, i, rxq) { +#if defined(INET) || defined(INET6) + rxq->lro.lro_queued = 0; + rxq->lro.lro_flushed = 0; +#endif + rxq->rxcsum = 0; + rxq->vlan_extraction = 0; + + rxq->fl.mbuf_allocated = 0; + rxq->fl.mbuf_inlined = 0; + rxq->fl.cl_allocated = 0; + rxq->fl.cl_recycled = 0; + rxq->fl.cl_fast_recycled = 0; + } + + for_each_txq(vi, i, txq) { + txq->txcsum = 0; + txq->tso_wrs = 0; + txq->vlan_insertion = 0; + txq->imm_wrs = 0; + txq->sgl_wrs = 0; + txq->txpkt_wrs = 0; + txq->txpkts0_wrs = 0; + txq->txpkts1_wrs = 0; + txq->txpkts0_pkts = 0; + txq->txpkts1_pkts = 0; + mp_ring_reset_stats(txq->r); + } + +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + for_each_ofld_txq(vi, i, wrq) { + wrq->tx_wrs_direct = 0; + wrq->tx_wrs_copied = 0; + } +#endif +#ifdef TCP_OFFLOAD + for_each_ofld_rxq(vi, i, ofld_rxq) { + ofld_rxq->fl.mbuf_allocated = 0; + ofld_rxq->fl.mbuf_inlined = 0; + ofld_rxq->fl.cl_allocated = 0; + ofld_rxq->fl.cl_recycled = 0; + ofld_rxq->fl.cl_fast_recycled = 0; + } +#endif + + if (IS_MAIN_VI(vi)) { + wrq = &sc->sge.ctrlq[pi->port_id]; + wrq->tx_wrs_direct = 0; + wrq->tx_wrs_copied = 0; + } + } + } + + return (0); +} + int t4_os_find_pci_capability(struct adapter *sc, int cap) { @@ -10040,88 +10142,9 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t case CHELSIO_T4_GET_I2C: rc = read_i2c(sc, (struct t4_i2c_data *)data); break; - case CHELSIO_T4_CLEAR_STATS: { - int i, v, bg_map; - u_int port_id = *(uint32_t *)data; - struct port_info *pi; - struct vi_info *vi; - - if (port_id >= sc->params.nports) - return (EINVAL); - pi = sc->port[port_id]; - if (pi == NULL) - return (EIO); - - /* MAC stats */ - t4_clr_port_stats(sc, pi->tx_chan); - pi->tx_parse_error = 0; - pi->tnl_cong_drops = 0; - mtx_lock(&sc->reg_lock); - for_each_vi(pi, v, vi) { - if (vi->flags & VI_INIT_DONE) - t4_clr_vi_stats(sc, vi->vin); - } - bg_map = pi->mps_bg_map; - v = 0; /* reuse */ - while (bg_map) { - i = ffs(bg_map) - 1; - t4_write_indirect(sc, A_TP_MIB_INDEX, A_TP_MIB_DATA, &v, - 1, A_TP_MIB_TNL_CNG_DROP_0 + i); - bg_map &= ~(1 << i); - } - mtx_unlock(&sc->reg_lock); - - /* - * Since this command accepts a port, clear stats for - * all VIs on this port. - */ - for_each_vi(pi, v, vi) { - if (vi->flags & VI_INIT_DONE) { - struct sge_rxq *rxq; - struct sge_txq *txq; - struct sge_wrq *wrq; - - for_each_rxq(vi, i, rxq) { -#if defined(INET) || defined(INET6) - rxq->lro.lro_queued = 0; - rxq->lro.lro_flushed = 0; -#endif - rxq->rxcsum = 0; - rxq->vlan_extraction = 0; - } - - for_each_txq(vi, i, txq) { - txq->txcsum = 0; - txq->tso_wrs = 0; - txq->vlan_insertion = 0; - txq->imm_wrs = 0; - txq->sgl_wrs = 0; - txq->txpkt_wrs = 0; - txq->txpkts0_wrs = 0; - txq->txpkts1_wrs = 0; - txq->txpkts0_pkts = 0; - txq->txpkts1_pkts = 0; - mp_ring_reset_stats(txq->r); - } - -#if defined(TCP_OFFLOAD) || defined(RATELIMIT) - /* nothing to clear for each ofld_rxq */ - - for_each_ofld_txq(vi, i, wrq) { - wrq->tx_wrs_direct = 0; - wrq->tx_wrs_copied = 0; - } -#endif - - if (IS_MAIN_VI(vi)) { - wrq = &sc->sge.ctrlq[pi->port_id]; - wrq->tx_wrs_direct = 0; - wrq->tx_wrs_copied = 0; - } - } - } + case CHELSIO_T4_CLEAR_STATS: + rc = clear_stats(sc, *(uint32_t *)data); break; - } case CHELSIO_T4_SCHED_CLASS: rc = t4_set_sched_class(sc, (struct t4_sched_params *)data); break; From owner-svn-src-all@freebsd.org Tue Jul 23 22:18: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 46BAFB59B6; Tue, 23 Jul 2019 22:18:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 27DDB812B2; Tue, 23 Jul 2019 22:18:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02E6B49A2; Tue, 23 Jul 2019 22:18:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6NMI93t057114; Tue, 23 Jul 2019 22:18:09 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NMI9rR057110; Tue, 23 Jul 2019 22:18:09 GMT (envelope-from np@FreeBSD.org) Message-Id: <201907232218.x6NMI9rR057110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 23 Jul 2019 22:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350267 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 350267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27DDB812B2 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]; 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, 23 Jul 2019 22:18:10 -0000 Author: np Date: Tue Jul 23 22:18:09 2019 New Revision: 350267 URL: https://svnweb.freebsd.org/changeset/base/350267 Log: MFC r340173 (by jhb@): Add a facility for transmitting "raw" work requests on regular NIC queues. - Use PH_loc.eight[1] as a general 'cflags' (Chelsio flags) field to describe properties of a queued packet. The MC_RAW_WR flag indicates an mbuf holding a raw work request. mbuf_cflags() returns the current flags. - Raw work request mbufs are allocated via alloc_wr_mbuf() which will allocate a single contiguous range to hold the mbuf data. The consumer can use mtod() to obtain the start of the work request and write the required work request in the buffer. The mbuf can then be enqueued directly to the txq via mp_ring_enqueue(). - Since raw work requests might potentially send arbitrary work requests, only set the EQUIQ and EQUEQ bits on work requests that support them such as the normal tunneled Ethernet packet work requests. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D17811 Modified: stable/12/sys/dev/cxgbe/adapter.h stable/12/sys/dev/cxgbe/t4_main.c stable/12/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/12/sys/dev/cxgbe/adapter.h Tue Jul 23 22:00:19 2019 (r350266) +++ stable/12/sys/dev/cxgbe/adapter.h Tue Jul 23 22:18:09 2019 (r350267) @@ -581,6 +581,7 @@ struct sge_txq { uint64_t txpkts1_wrs; /* # of type1 coalesced tx work requests */ uint64_t txpkts0_pkts; /* # of frames in type0 coalesced tx WRs */ uint64_t txpkts1_pkts; /* # of frames in type1 coalesced tx WRs */ + uint64_t raw_wrs; /* # of raw work requests (alloc_wr_mbuf) */ /* stats for not-that-common events */ } __aligned(CACHE_LINE_SIZE); @@ -1202,6 +1203,7 @@ void t4_intr_err(void *); void t4_intr_evt(void *); void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *); void t4_update_fl_bufsize(struct ifnet *); +struct mbuf *alloc_wr_mbuf(int, int); int parse_pkt(struct adapter *, struct mbuf **); void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *); void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *); Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Tue Jul 23 22:00:19 2019 (r350266) +++ stable/12/sys/dev/cxgbe/t4_main.c Tue Jul 23 22:18:09 2019 (r350267) @@ -9909,6 +9909,7 @@ clear_stats(struct adapter *sc, u_int port_id) txq->txpkts1_wrs = 0; txq->txpkts0_pkts = 0; txq->txpkts1_pkts = 0; + txq->raw_wrs = 0; mp_ring_reset_stats(txq->r); } Modified: stable/12/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_sge.c Tue Jul 23 22:00:19 2019 (r350266) +++ stable/12/sys/dev/cxgbe/t4_sge.c Tue Jul 23 22:18:09 2019 (r350267) @@ -82,6 +82,9 @@ __FBSDID("$FreeBSD$"); #define RX_COPY_THRESHOLD MINCLSIZE #endif +/* Internal mbuf flags stored in PH_loc.eight[1]. */ +#define MC_RAW_WR 0x02 + /* * Ethernet frames are DMA'd at this byte offset into the freelist buffer. * 0-7 are valid values. @@ -285,6 +288,7 @@ static inline u_int txpkt_len16(u_int, u_int); static inline u_int txpkt_vm_len16(u_int, u_int); static inline u_int txpkts0_len16(u_int); static inline u_int txpkts1_len16(void); +static u_int write_raw_wr(struct sge_txq *, void *, struct mbuf *, u_int); static u_int write_txpkt_wr(struct sge_txq *, struct fw_eth_tx_pkt_wr *, struct mbuf *, u_int); static u_int write_txpkt_vm_wr(struct adapter *, struct sge_txq *, @@ -2226,6 +2230,22 @@ set_mbuf_nsegs(struct mbuf *m, uint8_t nsegs) } static inline int +mbuf_cflags(struct mbuf *m) +{ + + M_ASSERTPKTHDR(m); + return (m->m_pkthdr.PH_loc.eight[4]); +} + +static inline void +set_mbuf_cflags(struct mbuf *m, uint8_t flags) +{ + + M_ASSERTPKTHDR(m); + m->m_pkthdr.PH_loc.eight[4] = flags; +} + +static inline int mbuf_len16(struct mbuf *m) { int n; @@ -2306,6 +2326,31 @@ needs_eo(struct mbuf *m) } #endif +/* + * Try to allocate an mbuf to contain a raw work request. To make it + * easy to construct the work request, don't allocate a chain but a + * single mbuf. + */ +struct mbuf * +alloc_wr_mbuf(int len, int how) +{ + struct mbuf *m; + + if (len <= MHLEN) + m = m_gethdr(how, MT_DATA); + else if (len <= MCLBYTES) + m = m_getcl(how, MT_DATA, M_PKTHDR); + else + m = NULL; + if (m == NULL) + return (NULL); + m->m_pkthdr.len = len; + m->m_len = len; + set_mbuf_cflags(m, MC_RAW_WR); + set_mbuf_len16(m, howmany(len, 16)); + return (m); +} + static inline int needs_tso(struct mbuf *m) { @@ -2479,6 +2524,7 @@ restart: goto restart; } set_mbuf_nsegs(m0, nsegs); + set_mbuf_cflags(m0, 0); if (sc->flags & IS_VF) set_mbuf_len16(m0, txpkt_vm_len16(nsegs, needs_tso(m0))); else @@ -2721,7 +2767,7 @@ cannot_use_txpkts(struct mbuf *m) { /* maybe put a GL limit too, to avoid silliness? */ - return (needs_tso(m)); + return (needs_tso(m) || (mbuf_cflags(m) & MC_RAW_WR) != 0); } static inline int @@ -2731,6 +2777,21 @@ discard_tx(struct sge_eq *eq) return ((eq->flags & (EQ_ENABLED | EQ_QFLUSH)) != EQ_ENABLED); } +static inline int +wr_can_update_eq(struct fw_eth_tx_pkts_wr *wr) +{ + + switch (G_FW_WR_OP(be32toh(wr->op_pkd))) { + case FW_ULPTX_WR: + case FW_ETH_TX_PKT_WR: + case FW_ETH_TX_PKTS_WR: + case FW_ETH_TX_PKT_VM_WR: + return (1); + default: + return (0); + } +} + /* * r->items[cidx] to r->items[pidx], with a wraparound at r->size, are ready to * be consumed. Return the actual number consumed. 0 indicates a stall. @@ -2826,6 +2887,10 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx) n = write_txpkts_wr(txq, wr, m0, &txp, available); total += txp.npkt; remaining -= txp.npkt; + } else if (mbuf_cflags(m0) & MC_RAW_WR) { + total++; + remaining--; + n = write_raw_wr(txq, (void *)wr, m0, available); } else { total++; remaining--; @@ -2838,14 +2903,17 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx) dbdiff += n; IDXINCR(eq->pidx, n, eq->sidx); - if (total_available_tx_desc(eq) < eq->sidx / 4 && - atomic_cmpset_int(&eq->equiq, 0, 1)) { - wr->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ | - F_FW_WR_EQUEQ); - eq->equeqidx = eq->pidx; - } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 32) { - wr->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); - eq->equeqidx = eq->pidx; + if (wr_can_update_eq(wr)) { + if (total_available_tx_desc(eq) < eq->sidx / 4 && + atomic_cmpset_int(&eq->equiq, 0, 1)) { + wr->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ | + F_FW_WR_EQUEQ); + eq->equeqidx = eq->pidx; + } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= + 32) { + wr->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); + eq->equeqidx = eq->pidx; + } } if (dbdiff >= 16 && remaining >= 4) { @@ -4039,6 +4107,8 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txpkts1_pkts", CTLFLAG_RD, &txq->txpkts1_pkts, "# of frames tx'd using type1 txpkts work requests"); + SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "raw_wrs", CTLFLAG_RD, + &txq->raw_wrs, "# of raw work requests (non-packets)"); SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, "r_enqueues", CTLFLAG_RD, &txq->r->enqueues, @@ -4577,6 +4647,39 @@ write_txpkt_vm_wr(struct adapter *sc, struct sge_txq * txq->sgl_wrs++; txq->txpkt_wrs++; + + txsd = &txq->sdesc[eq->pidx]; + txsd->m = m0; + txsd->desc_used = ndesc; + + return (ndesc); +} + +/* + * Write a raw WR to the hardware descriptors, update the software + * descriptor, and advance the pidx. It is guaranteed that enough + * descriptors are available. + * + * The return value is the # of hardware descriptors used. + */ +static u_int +write_raw_wr(struct sge_txq *txq, void *wr, struct mbuf *m0, u_int available) +{ + struct sge_eq *eq = &txq->eq; + struct tx_sdesc *txsd; + struct mbuf *m; + caddr_t dst; + int len16, ndesc; + + len16 = mbuf_len16(m0); + ndesc = howmany(len16, EQ_ESIZE / 16); + MPASS(ndesc <= available); + + dst = wr; + for (m = m0; m != NULL; m = m->m_next) + copy_to_txd(eq, mtod(m, caddr_t), &dst, m->m_len); + + txq->raw_wrs++; txsd = &txq->sdesc[eq->pidx]; txsd->m = m0; From owner-svn-src-all@freebsd.org Tue Jul 23 23:14: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 090FAB6AB8; Tue, 23 Jul 2019 23:14:58 +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 DCDE0835C3; Tue, 23 Jul 2019 23:14:57 +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 B7594545E; Tue, 23 Jul 2019 23:14:57 +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 x6NNEvb8092524; Tue, 23 Jul 2019 23:14:57 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6NNEvS2092523; Tue, 23 Jul 2019 23:14:57 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907232314.x6NNEvS2092523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 23 Jul 2019 23:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350268 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 350268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DCDE0835C3 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]; 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, 23 Jul 2019 23:14:58 -0000 Author: asomers Date: Tue Jul 23 23:14:57 2019 New Revision: 350268 URL: https://svnweb.freebsd.org/changeset/base/350268 Log: VOP_FSYNC.9: update copyright after r345677 MFC after: 2 weeks MFC-With: r345677 Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/VOP_FSYNC.9 Modified: head/share/man/man9/VOP_FSYNC.9 ============================================================================== --- head/share/man/man9/VOP_FSYNC.9 Tue Jul 23 22:18:09 2019 (r350267) +++ head/share/man/man9/VOP_FSYNC.9 Tue Jul 23 23:14:57 2019 (r350268) @@ -4,6 +4,11 @@ .\" .\" All rights reserved. .\" +.\" Copyright (c) 2019 The FreeBSD Foundation +.\" +.\" Portions of this documentation were written by BFF Storage Systems under +.\" sponsorship from the FreeBSD Foundation. +.\" .\" This program is free software. .\" .\" Redistribution and use in source and binary forms, with or without From owner-svn-src-all@freebsd.org Wed Jul 24 02:37: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 41500B9B60; Wed, 24 Jul 2019 02:37:40 +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 081E5896F6; Wed, 24 Jul 2019 02:37:40 +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 D2BA37821; Wed, 24 Jul 2019 02:37:39 +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 x6O2bdhI010320; Wed, 24 Jul 2019 02:37:39 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6O2bdku010318; Wed, 24 Jul 2019 02:37:39 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907240237.x6O2bdku010318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 24 Jul 2019 02:37:39 +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: r350269 - stable/12/sys/powerpc/powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/powerpc/powerpc X-SVN-Commit-Revision: 350269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 081E5896F6 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.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: Wed, 24 Jul 2019 02:37:40 -0000 Author: jhibbits Date: Wed Jul 24 02:37:39 2019 New Revision: 350269 URL: https://svnweb.freebsd.org/changeset/base/350269 Log: MFC r346771 powerpc: micro-optimize cpu_switch() Since the non-volatile registers are restored at the end of cpu_switchin (of the new thread) they're free for us to use for our own purposes. Load the PCB_FLAGS into a non-volatile register so it's preserved across the C function calls that manage FPU and altivec state. This removes 4 loads from each file. Might be a trivial performance improvement (~12 clock cycles per context switch). Modified: stable/12/sys/powerpc/powerpc/swtch32.S stable/12/sys/powerpc/powerpc/swtch64.S Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/powerpc/swtch32.S ============================================================================== --- stable/12/sys/powerpc/powerpc/swtch32.S Tue Jul 23 23:14:57 2019 (r350268) +++ stable/12/sys/powerpc/powerpc/swtch32.S Wed Jul 24 02:37:39 2019 (r350269) @@ -98,17 +98,16 @@ ENTRY(cpu_switch) mr %r16,%r5 /* and the new lock */ mr %r17,%r6 /* and the PCB */ - lwz %r7,PCB_FLAGS(%r17) + lwz %r18,PCB_FLAGS(%r17) /* Save FPU context if needed */ - andi. %r7, %r7, PCB_FPU + andi. %r7, %r18, PCB_FPU beq .L1 bl save_fpu .L1: mr %r3,%r14 /* restore old thread ptr */ - lwz %r7,PCB_FLAGS(%r17) /* Save Altivec context if needed */ - andi. %r7, %r7, PCB_VEC + andi. %r7, %r18, PCB_VEC beq .L2 bl save_vec @@ -151,17 +150,16 @@ blocked_loop: mr %r3,%r2 /* Get new thread ptr */ bl pmap_activate /* Activate the new address space */ - lwz %r6, PCB_FLAGS(%r17) + lwz %r19, PCB_FLAGS(%r17) /* Restore FPU context if needed */ - andi. %r6, %r6, PCB_FPU + andi. %r6, %r19, PCB_FPU beq .L3 mr %r3,%r2 /* Pass curthread to enable_fpu */ bl enable_fpu .L3: - lwz %r6, PCB_FLAGS(%r17) /* Restore Altivec context if needed */ - andi. %r6, %r6, PCB_VEC + andi. %r6, %r19, PCB_VEC beq .L4 mr %r3,%r2 /* Pass curthread to enable_vec */ bl enable_vec Modified: stable/12/sys/powerpc/powerpc/swtch64.S ============================================================================== --- stable/12/sys/powerpc/powerpc/swtch64.S Tue Jul 23 23:14:57 2019 (r350268) +++ stable/12/sys/powerpc/powerpc/swtch64.S Wed Jul 24 02:37:39 2019 (r350269) @@ -125,26 +125,24 @@ ENTRY(cpu_switch) stdu %r1,-48(%r1) - lwz %r7, PCB_FLAGS(%r17) - andi. %r7, %r7, PCB_CDSCR + lwz %r18, PCB_FLAGS(%r17) + andi. %r7, %r18, PCB_CDSCR beq .L0 /* Custom DSCR was set. Reseting it to enter kernel */ - li %r7, 0x0 - mtspr SPR_DSCR, %r7 + li %r6, 0x0 + mtspr SPR_DSCR, %r6 .L0: - lwz %r7,PCB_FLAGS(%r17) /* Save FPU context if needed */ - andi. %r7, %r7, PCB_FPU + andi. %r7, %r18, PCB_FPU beq .L1 bl save_fpu nop .L1: mr %r3,%r14 /* restore old thread ptr */ - lwz %r7,PCB_FLAGS(%r17) /* Save Altivec context if needed */ - andi. %r7, %r7, PCB_VEC + andi. %r7, %r18, PCB_VEC beq .L2 bl save_vec nop @@ -186,30 +184,28 @@ blocked_loop: bl pmap_activate /* Activate the new address space */ nop - lwz %r6, PCB_FLAGS(%r17) + lwz %r19, PCB_FLAGS(%r17) /* Restore FPU context if needed */ - andi. %r6, %r6, PCB_FPU + andi. %r6, %r19, PCB_FPU beq .L3 mr %r3,%r13 /* Pass curthread to enable_fpu */ bl enable_fpu nop .L3: - lwz %r6, PCB_FLAGS(%r17) /* Restore Altivec context if needed */ - andi. %r6, %r6, PCB_VEC + andi. %r6, %r19, PCB_VEC beq .L31 mr %r3,%r13 /* Pass curthread to enable_vec */ bl enable_vec nop .L31: - lwz %r6, PCB_FLAGS(%r17) /* Restore Custom DSCR if needed */ - andi. %r6, %r6, PCB_CDSCR + andi. %r6, %r19, PCB_CDSCR beq .L4 - ld %r6, PCB_DSCR(%r17) /* Load the DSCR register*/ - mtspr SPR_DSCR, %r6 + ld %r7, PCB_DSCR(%r17) /* Load the DSCR register*/ + mtspr SPR_DSCR, %r7 /* thread to restore is in r3 */ .L4: From owner-svn-src-all@freebsd.org Wed Jul 24 02:48: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 22F41B9F58; Wed, 24 Jul 2019 02:48:30 +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 F238089CCC; Wed, 24 Jul 2019 02:48:29 +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 C0C0179DD; Wed, 24 Jul 2019 02:48:29 +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 x6O2mTOA016218; Wed, 24 Jul 2019 02:48:29 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6O2mTg7016217; Wed, 24 Jul 2019 02:48:29 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907240248.x6O2mTg7016217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 24 Jul 2019 02:48: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: r350270 - stable/12/sys/powerpc/powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/powerpc/powerpc X-SVN-Commit-Revision: 350270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F238089CCC 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]; 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, 24 Jul 2019 02:48:30 -0000 Author: jhibbits Date: Wed Jul 24 02:48:29 2019 New Revision: 350270 URL: https://svnweb.freebsd.org/changeset/base/350270 Log: MFC r349874 powerpc: Clamp 32-bit binaries to 32-bit MAXUSER sv_maxuser specifies the maximum addressable space for user space. Presently this is all 64-bits worth, which is impossible for a 32-bit process. This bug has existed since the initial import of powerpc64 in 2010. Modified: stable/12/sys/powerpc/powerpc/elf32_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- stable/12/sys/powerpc/powerpc/elf32_machdep.c Wed Jul 24 02:37:39 2019 (r350269) +++ stable/12/sys/powerpc/powerpc/elf32_machdep.c Wed Jul 24 02:48:29 2019 (r350270) @@ -98,7 +98,7 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_minuser = VM_MIN_ADDRESS, .sv_stackprot = VM_PROT_ALL, #ifdef __powerpc64__ - .sv_maxuser = VM_MAXUSER_ADDRESS, + .sv_maxuser = VM_MAXUSER_ADDRESS32, .sv_usrstack = FREEBSD32_USRSTACK, .sv_psstrings = FREEBSD32_PS_STRINGS, .sv_copyout_strings = freebsd32_copyout_strings, From owner-svn-src-all@freebsd.org Wed Jul 24 04:48: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 2739CBC8B7; Wed, 24 Jul 2019 04:48:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 09D618DE9A; Wed, 24 Jul 2019 04:48:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D87EF9031; Wed, 24 Jul 2019 04:48:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6O4m452087783; Wed, 24 Jul 2019 04:48:04 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6O4m4c0087782; Wed, 24 Jul 2019 04:48:04 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201907240448.x6O4m4c0087782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 24 Jul 2019 04:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r350271 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 350271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 09D618DE9A 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.953,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, 24 Jul 2019 04:48:05 -0000 Author: gjb Date: Wed Jul 24 04:48:04 2019 New Revision: 350271 URL: https://svnweb.freebsd.org/changeset/base/350271 Log: Belatedly turn over releng/11.3 to so@. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (Netgate) Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Wed Jul 24 02:48:29 2019 (r350270) +++ svnadmin/conf/approvers Wed Jul 24 04:48:04 2019 (r350271) @@ -21,8 +21,7 @@ #^stable/11/ re ^release/ re ^releng/12.0/ (security-officer|so) -^releng/11.3/ re -^releng/11.[0-2]/ (security-officer|so) +^releng/11.[0-3]/ (security-officer|so) ^releng/10.[0-4]/ (security-officer|so) ^releng/9.[0-3]/ (security-officer|so) ^releng/8.[0-4]/ (security-officer|so) From owner-svn-src-all@freebsd.org Wed Jul 24 06:29: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 584FDBE29F; Wed, 24 Jul 2019 06:29:20 +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 3555E6AAE3; Wed, 24 Jul 2019 06:29:20 +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 08F09A1FE; Wed, 24 Jul 2019 06:29:20 +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 x6O6TJic046871; Wed, 24 Jul 2019 06:29:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6O6TJRr046870; Wed, 24 Jul 2019 06:29:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907240629.x6O6TJRr046870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 24 Jul 2019 06:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350272 - stable/12/lib/libc/stdlib X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libc/stdlib X-SVN-Commit-Revision: 350272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3555E6AAE3 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.919,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, 24 Jul 2019 06:29:20 -0000 Author: kib Date: Wed Jul 24 06:29:19 2019 New Revision: 350272 URL: https://svnweb.freebsd.org/changeset/base/350272 Log: MFC r350091: bsearch.3: Improve the example Modified: stable/12/lib/libc/stdlib/bsearch.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/stdlib/bsearch.3 ============================================================================== --- stable/12/lib/libc/stdlib/bsearch.3 Wed Jul 24 04:48:04 2019 (r350271) +++ stable/12/lib/libc/stdlib/bsearch.3 Wed Jul 24 06:29:19 2019 (r350272) @@ -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 24 06:32: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 E20ACBE499; Wed, 24 Jul 2019 06:32: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 C126F6AEDA; Wed, 24 Jul 2019 06:32: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 9707BA3B2; Wed, 24 Jul 2019 06:32: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 x6O6WLJN049958; Wed, 24 Jul 2019 06:32:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6O6WLM6049957; Wed, 24 Jul 2019 06:32:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907240632.x6O6WLM6049957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 24 Jul 2019 06:32:21 +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: r350273 - stable/11/lib/libc/stdlib X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libc/stdlib X-SVN-Commit-Revision: 350273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C126F6AEDA 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.916,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, 24 Jul 2019 06:32:21 -0000 Author: kib Date: Wed Jul 24 06:32:21 2019 New Revision: 350273 URL: https://svnweb.freebsd.org/changeset/base/350273 Log: MFC r347617 (by bcr), r350091: Add an example to bsearch.3. Modified: stable/11/lib/libc/stdlib/bsearch.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/stdlib/bsearch.3 ============================================================================== --- stable/11/lib/libc/stdlib/bsearch.3 Wed Jul 24 06:29:19 2019 (r350272) +++ stable/11/lib/libc/stdlib/bsearch.3 Wed Jul 24 06:32:21 2019 (r350273) @@ -32,7 +32,7 @@ .\" @(#)bsearch.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd February 22, 2013 +.Dd July 17, 2019 .Dt BSEARCH 3 .Os .Sh NAME @@ -83,6 +83,70 @@ The function returns a pointer to a matching member of the array, or a null pointer if no match is found. If two members compare as equal, which member is matched is unspecified. +.Sh EXAMPLES +A sample program that searches people by age in a sorted array: +.Bd -literal +#include +#include +#include +#include +#include + +struct person { + const char *name; + int age; +}; + +static int +compare(const void *a, const void *b) +{ + const int *age; + const struct person *person; + + age = a; + person = b; + + return (*age - person->age); +} + +int +main(void) +{ + struct person *friend; + int age; + /* Sorted array */ + const struct person friends[] = { + { "paul", 22 }, + { "anne", 25 }, + { "fred", 25 }, + { "mary", 27 }, + { "mark", 35 }, + { "bill", 50 } + }; + const size_t len = sizeof(friends) / sizeof(friends[0]); + + 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); + + 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); + + age = 30; + friend = bsearch(&age, friends, len, sizeof(friends[0]), compare); + assert(friend == NULL); + printf("friend aged 30 not found\en"); +} +.Ed .Sh SEE ALSO .Xr db 3 , .Xr lsearch 3 , From owner-svn-src-all@freebsd.org Wed Jul 24 07:07: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 DD59CBEC62; Wed, 24 Jul 2019 07:07:47 +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 BEF6F6C0A5; Wed, 24 Jul 2019 07:07:47 +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 8D563A92B; Wed, 24 Jul 2019 07:07:47 +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 x6O77lYP070150; Wed, 24 Jul 2019 07:07:47 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6O77kh4070147; Wed, 24 Jul 2019 07:07:46 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201907240707.x6O77kh4070147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 24 Jul 2019 07:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350274 - 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: 350274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BEF6F6C0A5 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]; 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, 24 Jul 2019 07:07:47 -0000 Author: kevlo Date: Wed Jul 24 07:07:46 2019 New Revision: 350274 URL: https://svnweb.freebsd.org/changeset/base/350274 Log: Don't use .Xr for things that have no man page. Modified: head/share/man/man4/cue.4 head/share/man/man4/kue.4 head/share/man/man4/rgephy.4 Modified: head/share/man/man4/cue.4 ============================================================================== --- head/share/man/man4/cue.4 Wed Jul 24 06:32:21 2019 (r350273) +++ head/share/man/man4/cue.4 Wed Jul 24 07:07:46 2019 (r350274) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2015 +.Dd July 24, 2019 .Dt CUE 4 .Os .Sh NAME @@ -68,7 +68,7 @@ received and transmitted over separate USB bulk transf .Pp The CATC chipset supports only 10Mbps half-duplex mode, hence there are no -.Xr ifmedia 4 +.Fn ifmedia modes to select. .Pp For more information on configuring this device, see Modified: head/share/man/man4/kue.4 ============================================================================== --- head/share/man/man4/kue.4 Wed Jul 24 06:32:21 2019 (r350273) +++ head/share/man/man4/kue.4 Wed Jul 24 07:07:46 2019 (r350274) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2015 +.Dd July 24, 2019 .Dt KUE 4 .Os .Sh NAME @@ -68,7 +68,7 @@ received and transmitted over separate USB bulk transf .Pp The Kawasaki chipset supports only 10Mbps half-duplex mode, hence there are no -.Xr ifmedia 4 +.Fn ifmedia modes to select. .Pp For more information on configuring this device, see Modified: head/share/man/man4/rgephy.4 ============================================================================== --- head/share/man/man4/rgephy.4 Wed Jul 24 06:32:21 2019 (r350273) +++ head/share/man/man4/rgephy.4 Wed Jul 24 07:07:46 2019 (r350274) @@ -90,7 +90,6 @@ autonegotiation: .Pp .Dl "ifconfig re0 media 100baseTX mediaopt full-duplex,flag0" .Sh SEE ALSO -.\".Xr ifmedia 4 , .Xr intro 4 , .Xr miibus 4 , .Xr ifconfig 8 From owner-svn-src-all@freebsd.org Wed Jul 24 08:00: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 9A095A162D; Wed, 24 Jul 2019 08:00:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 7992B6E24C; Wed, 24 Jul 2019 08:00:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66709B28E; Wed, 24 Jul 2019 08:00: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 x6O801ni000311; Wed, 24 Jul 2019 08:00:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6O801nr000310; Wed, 24 Jul 2019 08:00:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907240800.x6O801nr000310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 24 Jul 2019 08:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350275 - head X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7992B6E24C 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]; 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, 24 Jul 2019 08:00:01 -0000 Author: manu Date: Wed Jul 24 08:00:00 2019 New Revision: 350275 URL: https://svnweb.freebsd.org/changeset/base/350275 Log: pkgbase: Add the sub stage-packages targets to TGTS This helps when you don't want to run the dependencies targets. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D20955 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Jul 24 07:07:46 2019 (r350274) +++ head/Makefile Wed Jul 24 08:00:00 2019 (r350275) @@ -138,7 +138,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel bu build32 distribute32 install32 buildsoft distributesoft installsoft \ builddtb xdev xdev-build xdev-install \ xdev-links native-xtools native-xtools-install stageworld stagekernel \ - stage-packages \ + stage-packages stage-packages-kernel stage-packages-world \ create-packages-world create-packages-kernel create-packages \ packages installconfig real-packages sign-packages package-pkg \ print-dir test-system-compiler test-system-linker From owner-svn-src-all@freebsd.org Wed Jul 24 11:34: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 98BF4A5A03; Wed, 24 Jul 2019 11:34:10 +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 7657F75D57; Wed, 24 Jul 2019 11:34:10 +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 643AADBD6; Wed, 24 Jul 2019 11:34:10 +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 x6OBYACi029087; Wed, 24 Jul 2019 11:34:10 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OBYAjA029086; Wed, 24 Jul 2019 11:34:10 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201907241134.x6OBYAjA029086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 24 Jul 2019 11:34: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: r350276 - stable/11/sys/riscv/riscv X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/riscv/riscv X-SVN-Commit-Revision: 350276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7657F75D57 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.964,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, 24 Jul 2019 11:34:10 -0000 Author: kp Date: Wed Jul 24 11:34:09 2019 New Revision: 350276 URL: https://svnweb.freebsd.org/changeset/base/350276 Log: MFC r350095: 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 below 0x100000000, but as soon as it doesn't this breaks. Sponsored by: Axiado Modified: stable/11/sys/riscv/riscv/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/riscv/riscv/pmap.c ============================================================================== --- stable/11/sys/riscv/riscv/pmap.c Wed Jul 24 08:00:00 2019 (r350275) +++ stable/11/sys/riscv/riscv/pmap.c Wed Jul 24 11:34:09 2019 (r350276) @@ -457,7 +457,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 24 11:34: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 81D70A5A1A; Wed, 24 Jul 2019 11:34:11 +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 61E3975D59; Wed, 24 Jul 2019 11:34:11 +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 52C67DBD7; Wed, 24 Jul 2019 11:34:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OBYBdg029136; Wed, 24 Jul 2019 11:34:11 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OBYBrM029135; Wed, 24 Jul 2019 11:34:11 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201907241134.x6OBYBrM029135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 24 Jul 2019 11:34: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: r350277 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 350277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 61E3975D59 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.964,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, 24 Jul 2019 11:34:11 -0000 Author: kp Date: Wed Jul 24 11:34:10 2019 New Revision: 350277 URL: https://svnweb.freebsd.org/changeset/base/350277 Log: MFC r350095: 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 below 0x100000000, but as soon as it doesn't this breaks. Sponsored by: Axiado Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Wed Jul 24 11:34:09 2019 (r350276) +++ stable/12/sys/riscv/riscv/pmap.c Wed Jul 24 11:34:10 2019 (r350277) @@ -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 24 12:46: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 D19F3A70DF; Wed, 24 Jul 2019 12:46:56 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 B23B380660; Wed, 24 Jul 2019 12:46:56 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B81FE814; Wed, 24 Jul 2019 12:46:56 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OCku52070380; Wed, 24 Jul 2019 12:46:56 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OCkuAB070378; Wed, 24 Jul 2019 12:46:56 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201907241246.x6OCkuAB070378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Wed, 24 Jul 2019 12:46: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: r350278 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 350278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B23B380660 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.916,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, 24 Jul 2019 12:46:56 -0000 Author: tijl Date: Wed Jul 24 12:46:55 2019 New Revision: 350278 URL: https://svnweb.freebsd.org/changeset/base/350278 Log: MFC r349880: Let linuxulator mprotect mask unsupported bits before calling kern_mprotect. After r349240 kern_mprotect returns EINVAL for unsupported bits in the prot argument. Linux rtld uses PROT_GROWSDOWN and PROT_GROWS_UP when marking the stack executable. Mask these bits like kern_mprotect used to do. For other unsupported bits EINVAL is returned like Linux does. Reviewed by: trasz, brooks Modified: stable/12/sys/compat/linux/linux_mmap.c stable/12/sys/compat/linux/linux_mmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_mmap.c ============================================================================== --- stable/12/sys/compat/linux/linux_mmap.c Wed Jul 24 11:34:10 2019 (r350277) +++ stable/12/sys/compat/linux/linux_mmap.c Wed Jul 24 12:46:55 2019 (r350278) @@ -228,6 +228,11 @@ int linux_mprotect_common(struct thread *td, uintptr_t addr, size_t len, int prot) { + /* XXX Ignore PROT_GROWSDOWN and PROT_GROWSUP for now. */ + prot &= ~(LINUX_PROT_GROWSDOWN | LINUX_PROT_GROWSUP); + if ((prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) + return (EINVAL); + #if defined(__amd64__) linux_fixup_prot(td, &prot); #endif Modified: stable/12/sys/compat/linux/linux_mmap.h ============================================================================== --- stable/12/sys/compat/linux/linux_mmap.h Wed Jul 24 11:34:10 2019 (r350277) +++ stable/12/sys/compat/linux/linux_mmap.h Wed Jul 24 12:46:55 2019 (r350278) @@ -41,6 +41,8 @@ #define LINUX_MAP_ANON 0x0020 #define LINUX_MAP_GROWSDOWN 0x0100 +#define LINUX_PROT_GROWSDOWN 0x01000000 +#define LINUX_PROT_GROWSUP 0x02000000 int linux_mmap_common(struct thread *, uintptr_t, size_t, int, int, int, off_t); From owner-svn-src-all@freebsd.org Wed Jul 24 12:48: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 AD224A726B; Wed, 24 Jul 2019 12:48:52 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 8F42180926; Wed, 24 Jul 2019 12:48:52 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66A00E815; Wed, 24 Jul 2019 12:48:52 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OCmqxN070510; Wed, 24 Jul 2019 12:48:52 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OCmqgN070509; Wed, 24 Jul 2019 12:48:52 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201907241248.x6OCmqgN070509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Wed, 24 Jul 2019 12:48:52 +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: r350279 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 350279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F42180926 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.916,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, 24 Jul 2019 12:48:52 -0000 Author: tijl Date: Wed Jul 24 12:48:51 2019 New Revision: 350279 URL: https://svnweb.freebsd.org/changeset/base/350279 Log: MFC r349880: Let linuxulator mprotect mask unsupported bits before calling kern_mprotect. After r349240 kern_mprotect returns EINVAL for unsupported bits in the prot argument. Linux rtld uses PROT_GROWSDOWN and PROT_GROWS_UP when marking the stack executable. Mask these bits like kern_mprotect used to do. For other unsupported bits EINVAL is returned like Linux does. Reviewed by: trasz, brooks Modified: stable/11/sys/compat/linux/linux_mmap.c stable/11/sys/compat/linux/linux_mmap.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_mmap.c ============================================================================== --- stable/11/sys/compat/linux/linux_mmap.c Wed Jul 24 12:46:55 2019 (r350278) +++ stable/11/sys/compat/linux/linux_mmap.c Wed Jul 24 12:48:51 2019 (r350279) @@ -229,6 +229,11 @@ int linux_mprotect_common(struct thread *td, uintptr_t addr, size_t len, int prot) { + /* XXX Ignore PROT_GROWSDOWN and PROT_GROWSUP for now. */ + prot &= ~(LINUX_PROT_GROWSDOWN | LINUX_PROT_GROWSUP); + if ((prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) + return (EINVAL); + #if defined(__amd64__) linux_fixup_prot(td, &prot); #endif Modified: stable/11/sys/compat/linux/linux_mmap.h ============================================================================== --- stable/11/sys/compat/linux/linux_mmap.h Wed Jul 24 12:46:55 2019 (r350278) +++ stable/11/sys/compat/linux/linux_mmap.h Wed Jul 24 12:48:51 2019 (r350279) @@ -41,6 +41,8 @@ #define LINUX_MAP_ANON 0x0020 #define LINUX_MAP_GROWSDOWN 0x0100 +#define LINUX_PROT_GROWSDOWN 0x01000000 +#define LINUX_PROT_GROWSUP 0x02000000 int linux_mmap_common(struct thread *, uintptr_t, size_t, int, int, int, off_t); From owner-svn-src-all@freebsd.org Wed Jul 24 12:50: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 27B55A73E6; Wed, 24 Jul 2019 12:50:48 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 09BF580B33; Wed, 24 Jul 2019 12:50:48 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA280E823; Wed, 24 Jul 2019 12:50:47 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OCol6n071463; Wed, 24 Jul 2019 12:50:47 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OCollM071461; Wed, 24 Jul 2019 12:50:47 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201907241250.x6OCollM071461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 24 Jul 2019 12:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350280 - in releng: 11.2/sys/x86/x86 11.3/sys/x86/x86 12.0/sys/x86/x86 X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2/sys/x86/x86 11.3/sys/x86/x86 12.0/sys/x86/x86 X-SVN-Commit-Revision: 350280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 09BF580B33 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.93)[-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: Wed, 24 Jul 2019 12:50:48 -0000 Author: gordon Date: Wed Jul 24 12:50:46 2019 New Revision: 350280 URL: https://svnweb.freebsd.org/changeset/base/350280 Log: Fix panic from Intel CPU vulnerability mitigation. Approved by: so Security: FreeBSD-EN-19:13.mds Modified: releng/11.2/sys/x86/x86/cpu_machdep.c releng/11.3/sys/x86/x86/cpu_machdep.c releng/12.0/sys/x86/x86/cpu_machdep.c Modified: releng/11.2/sys/x86/x86/cpu_machdep.c ============================================================================== --- releng/11.2/sys/x86/x86/cpu_machdep.c Wed Jul 24 12:48:51 2019 (r350279) +++ releng/11.2/sys/x86/x86/cpu_machdep.c Wed Jul 24 12:50:46 2019 (r350280) @@ -946,7 +946,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); @@ -955,6 +954,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) Modified: releng/11.3/sys/x86/x86/cpu_machdep.c ============================================================================== --- releng/11.3/sys/x86/x86/cpu_machdep.c Wed Jul 24 12:48:51 2019 (r350279) +++ releng/11.3/sys/x86/x86/cpu_machdep.c Wed Jul 24 12:50:46 2019 (r350280) @@ -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) Modified: releng/12.0/sys/x86/x86/cpu_machdep.c ============================================================================== --- releng/12.0/sys/x86/x86/cpu_machdep.c Wed Jul 24 12:48:51 2019 (r350279) +++ releng/12.0/sys/x86/x86/cpu_machdep.c Wed Jul 24 12:50:46 2019 (r350280) @@ -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 Wed Jul 24 12:51: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 C6B70A7460; Wed, 24 Jul 2019 12:51:54 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 A944F80E5A; Wed, 24 Jul 2019 12:51:54 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84D16E99D; Wed, 24 Jul 2019 12:51:54 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OCpsBN072287; Wed, 24 Jul 2019 12:51:54 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OCpqHo072277; Wed, 24 Jul 2019 12:51:52 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201907241251.x6OCpqHo072277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 24 Jul 2019 12:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350281 - in releng: 11.2/contrib/telnet/telnet 11.3/contrib/telnet/telnet 12.0/contrib/telnet/telnet X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2/contrib/telnet/telnet 11.3/contrib/telnet/telnet 12.0/contrib/telnet/telnet X-SVN-Commit-Revision: 350281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A944F80E5A 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: Wed, 24 Jul 2019 12:51:54 -0000 Author: gordon Date: Wed Jul 24 12:51:52 2019 New Revision: 350281 URL: https://svnweb.freebsd.org/changeset/base/350281 Log: Fix multiple telnet client vulnerabilities. Approved by: so Security: FreeBSD-SA-19:12.telnet Security: CVE-2019-0053 Modified: releng/11.2/contrib/telnet/telnet/commands.c releng/11.2/contrib/telnet/telnet/telnet.c releng/11.2/contrib/telnet/telnet/utilities.c releng/11.3/contrib/telnet/telnet/commands.c releng/11.3/contrib/telnet/telnet/telnet.c releng/11.3/contrib/telnet/telnet/utilities.c releng/12.0/contrib/telnet/telnet/commands.c releng/12.0/contrib/telnet/telnet/telnet.c releng/12.0/contrib/telnet/telnet/utilities.c Modified: releng/11.2/contrib/telnet/telnet/commands.c ============================================================================== --- releng/11.2/contrib/telnet/telnet/commands.c Wed Jul 24 12:50:46 2019 (r350280) +++ releng/11.2/contrib/telnet/telnet/commands.c Wed Jul 24 12:51:52 2019 (r350281) @@ -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: releng/11.2/contrib/telnet/telnet/telnet.c ============================================================================== --- releng/11.2/contrib/telnet/telnet/telnet.c Wed Jul 24 12:50:46 2019 (r350280) +++ releng/11.2/contrib/telnet/telnet/telnet.c Wed Jul 24 12:51:52 2019 (r350281) @@ -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: releng/11.2/contrib/telnet/telnet/utilities.c ============================================================================== --- releng/11.2/contrib/telnet/telnet/utilities.c Wed Jul 24 12:50:46 2019 (r350280) +++ releng/11.2/contrib/telnet/telnet/utilities.c Wed Jul 24 12:51:52 2019 (r350281) @@ -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" : "", Modified: releng/11.3/contrib/telnet/telnet/commands.c ============================================================================== --- releng/11.3/contrib/telnet/telnet/commands.c Wed Jul 24 12:50:46 2019 (r350280) +++ releng/11.3/contrib/telnet/telnet/commands.c Wed Jul 24 12:51:52 2019 (r350281) @@ -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: releng/11.3/contrib/telnet/telnet/telnet.c ============================================================================== --- releng/11.3/contrib/telnet/telnet/telnet.c Wed Jul 24 12:50:46 2019 (r350280) +++ releng/11.3/contrib/telnet/telnet/telnet.c Wed Jul 24 12:51:52 2019 (r350281) @@ -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: releng/11.3/contrib/telnet/telnet/utilities.c ============================================================================== --- releng/11.3/contrib/telnet/telnet/utilities.c Wed Jul 24 12:50:46 2019 (r350280) +++ releng/11.3/contrib/telnet/telnet/utilities.c Wed Jul 24 12:51:52 2019 (r350281) @@ -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" : "", Modified: releng/12.0/contrib/telnet/telnet/commands.c ============================================================================== --- releng/12.0/contrib/telnet/telnet/commands.c Wed Jul 24 12:50:46 2019 (r350280) +++ releng/12.0/contrib/telnet/telnet/commands.c Wed Jul 24 12:51:52 2019 (r350281) @@ -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: releng/12.0/contrib/telnet/telnet/telnet.c ============================================================================== --- releng/12.0/contrib/telnet/telnet/telnet.c Wed Jul 24 12:50:46 2019 (r350280) +++ releng/12.0/contrib/telnet/telnet/telnet.c Wed Jul 24 12:51:52 2019 (r350281) @@ -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: releng/12.0/contrib/telnet/telnet/utilities.c ============================================================================== --- releng/12.0/contrib/telnet/telnet/utilities.c Wed Jul 24 12:50:46 2019 (r350280) +++ releng/12.0/contrib/telnet/telnet/utilities.c Wed Jul 24 12:51:52 2019 (r350281) @@ -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 Wed Jul 24 12: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 9E104A7673; Wed, 24 Jul 2019 12:53:07 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 7F24E8102C; Wed, 24 Jul 2019 12:53:07 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AC75E9E4; Wed, 24 Jul 2019 12:53:07 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OCr73u076209; Wed, 24 Jul 2019 12:53:07 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OCr6EY076207; Wed, 24 Jul 2019 12:53:06 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201907241253.x6OCr6EY076207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 24 Jul 2019 12:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350282 - in releng: 11.2/sys/kern 11.3/sys/kern 12.0/sys/kern X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2/sys/kern 11.3/sys/kern 12.0/sys/kern X-SVN-Commit-Revision: 350282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7F24E8102C 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.926,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, 24 Jul 2019 12:53:07 -0000 Author: gordon Date: Wed Jul 24 12:53:06 2019 New Revision: 350282 URL: https://svnweb.freebsd.org/changeset/base/350282 Log: Fix pts write-after-free. Approved by: so Security: FreeBSD-SA-19:13.pts Security: CVE-2019-5606 Modified: releng/11.2/sys/kern/tty.c releng/11.3/sys/kern/tty.c releng/12.0/sys/kern/tty.c Modified: releng/11.2/sys/kern/tty.c ============================================================================== --- releng/11.2/sys/kern/tty.c Wed Jul 24 12:51:52 2019 (r350281) +++ releng/11.2/sys/kern/tty.c Wed Jul 24 12:53:06 2019 (r350282) @@ -230,9 +230,6 @@ ttydev_leave(struct tty *tp) tp->t_flags |= TF_OPENCLOSE; - /* Stop asynchronous I/O. */ - funsetown(&tp->t_sigio); - /* Remove console TTY. */ if (constty == tp) constty_clear(); @@ -1122,6 +1119,9 @@ tty_rel_free(struct tty *tp) tty_unlock(tp); return; } + + /* Stop asynchronous I/O. */ + funsetown(&tp->t_sigio); /* TTY can be deallocated. */ dev = tp->t_dev; Modified: releng/11.3/sys/kern/tty.c ============================================================================== --- releng/11.3/sys/kern/tty.c Wed Jul 24 12:51:52 2019 (r350281) +++ releng/11.3/sys/kern/tty.c Wed Jul 24 12:53:06 2019 (r350282) @@ -230,9 +230,6 @@ ttydev_leave(struct tty *tp) tp->t_flags |= TF_OPENCLOSE; - /* Stop asynchronous I/O. */ - funsetown(&tp->t_sigio); - /* Remove console TTY. */ if (constty == tp) constty_clear(); @@ -1122,6 +1119,12 @@ tty_rel_free(struct tty *tp) tty_unlock(tp); return; } + + /* Stop asynchronous I/O. */ + funsetown(&tp->t_sigio); + + /* Stop asynchronous I/O. */ + funsetown(&tp->t_sigio); /* TTY can be deallocated. */ dev = tp->t_dev; Modified: releng/12.0/sys/kern/tty.c ============================================================================== --- releng/12.0/sys/kern/tty.c Wed Jul 24 12:51:52 2019 (r350281) +++ releng/12.0/sys/kern/tty.c Wed Jul 24 12:53:06 2019 (r350282) @@ -231,9 +231,6 @@ ttydev_leave(struct tty *tp) tp->t_flags |= TF_OPENCLOSE; - /* Stop asynchronous I/O. */ - funsetown(&tp->t_sigio); - /* Remove console TTY. */ if (constty == tp) constty_clear(); @@ -1123,6 +1120,9 @@ tty_rel_free(struct tty *tp) tty_unlock(tp); return; } + + /* Stop asynchronous I/O. */ + funsetown(&tp->t_sigio); /* TTY can be deallocated. */ dev = tp->t_dev; From owner-svn-src-all@freebsd.org Wed Jul 24 12:54: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 23C43A76E9; Wed, 24 Jul 2019 12:54:11 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 05A7A8119B; Wed, 24 Jul 2019 12:54:11 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2405E9E5; Wed, 24 Jul 2019 12:54:10 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OCsAou076298; Wed, 24 Jul 2019 12:54:10 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OCsABl076296; Wed, 24 Jul 2019 12:54:10 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201907241254.x6OCsABl076296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 24 Jul 2019 12:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350283 - in releng: 11.2/sys/compat/freebsd32 11.3/sys/compat/freebsd32 X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2/sys/compat/freebsd32 11.3/sys/compat/freebsd32 X-SVN-Commit-Revision: 350283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05A7A8119B 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.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: Wed, 24 Jul 2019 12:54:11 -0000 Author: gordon Date: Wed Jul 24 12:54:10 2019 New Revision: 350283 URL: https://svnweb.freebsd.org/changeset/base/350283 Log: Fix kernel memory disclosure in freebsd32_ioctl. Approved by: so Security: FreeBSD-SA-19:14.freebsd32 Security: CVE-2019-5605 Modified: releng/11.2/sys/compat/freebsd32/freebsd32_ioctl.c releng/11.3/sys/compat/freebsd32/freebsd32_ioctl.c Modified: releng/11.2/sys/compat/freebsd32/freebsd32_ioctl.c ============================================================================== --- releng/11.2/sys/compat/freebsd32/freebsd32_ioctl.c Wed Jul 24 12:53:06 2019 (r350282) +++ releng/11.2/sys/compat/freebsd32/freebsd32_ioctl.c Wed Jul 24 12:54:10 2019 (r350283) @@ -262,6 +262,8 @@ freebsd32_ioctl_pciocgetconf(struct thread *td, vm_offset_t addr; int error; + memset(&pmc, 0, sizeof(pmc)); + memset(&pc32, 0, sizeof(pc32)); if ((error = copyin(uap->data, &pci32, sizeof(pci32))) != 0) return (error); Modified: releng/11.3/sys/compat/freebsd32/freebsd32_ioctl.c ============================================================================== --- releng/11.3/sys/compat/freebsd32/freebsd32_ioctl.c Wed Jul 24 12:53:06 2019 (r350282) +++ releng/11.3/sys/compat/freebsd32/freebsd32_ioctl.c Wed Jul 24 12:54:10 2019 (r350283) @@ -262,6 +262,8 @@ freebsd32_ioctl_pciocgetconf(struct thread *td, vm_offset_t addr; int error; + memset(&pmc, 0, sizeof(pmc)); + memset(&pc32, 0, sizeof(pc32)); if ((error = copyin(uap->data, &pci32, sizeof(pci32))) != 0) return (error); From owner-svn-src-all@freebsd.org Wed Jul 24 12:55: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 6B7C8A7768; Wed, 24 Jul 2019 12:55:17 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 4D0C581300; Wed, 24 Jul 2019 12:55:17 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F1B8E9E7; Wed, 24 Jul 2019 12:55:17 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OCtGj3076439; Wed, 24 Jul 2019 12:55:16 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OCtGcQ076435; Wed, 24 Jul 2019 12:55:16 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201907241255.x6OCtGcQ076435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 24 Jul 2019 12:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350284 - in releng: 11.2/sys/kern 11.3/sys/kern 12.0/sys/kern X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2/sys/kern 11.3/sys/kern 12.0/sys/kern X-SVN-Commit-Revision: 350284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D0C581300 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.93)[-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: Wed, 24 Jul 2019 12:55:17 -0000 Author: gordon Date: Wed Jul 24 12:55:16 2019 New Revision: 350284 URL: https://svnweb.freebsd.org/changeset/base/350284 Log: Fix reference count overflow in mqueuefs. Approved by: so Security: FreeBSD-SA-19:15.mqueuefs Security: CVE-2019-5603 Modified: releng/11.2/sys/kern/uipc_mqueue.c releng/11.3/sys/kern/uipc_mqueue.c releng/12.0/sys/kern/uipc_mqueue.c Modified: releng/11.2/sys/kern/uipc_mqueue.c ============================================================================== --- releng/11.2/sys/kern/uipc_mqueue.c Wed Jul 24 12:54:10 2019 (r350283) +++ releng/11.2/sys/kern/uipc_mqueue.c Wed Jul 24 12:55:16 2019 (r350284) @@ -2266,13 +2266,14 @@ sys_kmq_timedreceive(struct thread *td, struct kmq_tim if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets, sizeof(ets)); if (error != 0) - return (error); + goto out; abs_timeout = &ets; } else abs_timeout = NULL; waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } @@ -2291,13 +2292,14 @@ sys_kmq_timedsend(struct thread *td, struct kmq_timeds if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets, sizeof(ets)); if (error != 0) - return (error); + goto out; abs_timeout = &ets; } else abs_timeout = NULL; waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_send(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } @@ -2815,7 +2817,7 @@ freebsd32_kmq_timedreceive(struct thread *td, if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets32, sizeof(ets32)); if (error != 0) - return (error); + goto out; CP(ets32, ets, tv_sec); CP(ets32, ets, tv_nsec); abs_timeout = &ets; @@ -2824,6 +2826,7 @@ freebsd32_kmq_timedreceive(struct thread *td, waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } Modified: releng/11.3/sys/kern/uipc_mqueue.c ============================================================================== --- releng/11.3/sys/kern/uipc_mqueue.c Wed Jul 24 12:54:10 2019 (r350283) +++ releng/11.3/sys/kern/uipc_mqueue.c Wed Jul 24 12:55:16 2019 (r350284) @@ -2266,13 +2266,14 @@ sys_kmq_timedreceive(struct thread *td, struct kmq_tim if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets, sizeof(ets)); if (error != 0) - return (error); + goto out; abs_timeout = &ets; } else abs_timeout = NULL; waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } @@ -2291,13 +2292,14 @@ sys_kmq_timedsend(struct thread *td, struct kmq_timeds if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets, sizeof(ets)); if (error != 0) - return (error); + goto out; abs_timeout = &ets; } else abs_timeout = NULL; waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_send(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } @@ -2815,7 +2817,7 @@ freebsd32_kmq_timedreceive(struct thread *td, if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets32, sizeof(ets32)); if (error != 0) - return (error); + goto out; CP(ets32, ets, tv_sec); CP(ets32, ets, tv_nsec); abs_timeout = &ets; @@ -2824,6 +2826,7 @@ freebsd32_kmq_timedreceive(struct thread *td, waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } Modified: releng/12.0/sys/kern/uipc_mqueue.c ============================================================================== --- releng/12.0/sys/kern/uipc_mqueue.c Wed Jul 24 12:54:10 2019 (r350283) +++ releng/12.0/sys/kern/uipc_mqueue.c Wed Jul 24 12:55:16 2019 (r350284) @@ -2275,13 +2275,14 @@ sys_kmq_timedreceive(struct thread *td, struct kmq_tim if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets, sizeof(ets)); if (error != 0) - return (error); + goto out; abs_timeout = &ets; } else abs_timeout = NULL; waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } @@ -2301,13 +2302,14 @@ sys_kmq_timedsend(struct thread *td, struct kmq_timeds if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets, sizeof(ets)); if (error != 0) - return (error); + goto out; abs_timeout = &ets; } else abs_timeout = NULL; waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_send(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } @@ -2826,7 +2828,7 @@ freebsd32_kmq_timedreceive(struct thread *td, if (uap->abs_timeout != NULL) { error = copyin(uap->abs_timeout, &ets32, sizeof(ets32)); if (error != 0) - return (error); + goto out; CP(ets32, ets, tv_sec); CP(ets32, ets, tv_nsec); abs_timeout = &ets; @@ -2835,6 +2837,7 @@ freebsd32_kmq_timedreceive(struct thread *td, waitok = !(fp->f_flag & O_NONBLOCK); error = mqueue_receive(mq, uap->msg_ptr, uap->msg_len, uap->msg_prio, waitok, abs_timeout); +out: fdrop(fp, td); return (error); } From owner-svn-src-all@freebsd.org Wed Jul 24 12:56: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 08DDFA77DC; Wed, 24 Jul 2019 12:56:08 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 DFE0C81454; Wed, 24 Jul 2019 12:56:07 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA90CE9E8; Wed, 24 Jul 2019 12:56:07 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OCu7AN076545; Wed, 24 Jul 2019 12:56:07 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OCu7xM076540; Wed, 24 Jul 2019 12:56:07 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201907241256.x6OCu7xM076540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 24 Jul 2019 12:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350285 - in releng: 11.2/usr.sbin/bhyve 11.3/usr.sbin/bhyve 12.0/usr.sbin/bhyve X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2/usr.sbin/bhyve 11.3/usr.sbin/bhyve 12.0/usr.sbin/bhyve X-SVN-Commit-Revision: 350285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DFE0C81454 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.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, 24 Jul 2019 12:56:08 -0000 Author: gordon Date: Wed Jul 24 12:56:06 2019 New Revision: 350285 URL: https://svnweb.freebsd.org/changeset/base/350285 Log: Fix byhve out-of-bounds read in XHCI device. Approved by: so Security: FreeBSD-SA-19:16.bhyve Security: CVE-2019-5604 Modified: releng/11.2/usr.sbin/bhyve/pci_xhci.c releng/11.3/usr.sbin/bhyve/pci_xhci.c releng/12.0/usr.sbin/bhyve/pci_xhci.c Modified: releng/11.2/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- releng/11.2/usr.sbin/bhyve/pci_xhci.c Wed Jul 24 12:55:16 2019 (r350284) +++ releng/11.2/usr.sbin/bhyve/pci_xhci.c Wed Jul 24 12:56:06 2019 (r350285) @@ -1898,6 +1898,11 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui return; } + if (epid == 0 || epid >= XHCI_MAX_ENDPOINTS) { + DPRINTF(("pci_xhci: invalid endpoint %u\r\n", epid)); + return; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); @@ -1923,6 +1928,23 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui /* get next trb work item */ if (XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0) != 0) { + struct xhci_stream_ctx *sctx; + + /* + * Stream IDs of 0, 65535 (any stream), and 65534 + * (prime) are invalid. + */ + if (streamid == 0 || streamid == 65534 || streamid == 65535) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } + + sctx = NULL; + pci_xhci_find_stream(sc, ep_ctx, streamid, &sctx); + if (sctx == NULL) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } sctx_tr = &devep->ep_sctx_trbs[streamid]; ringaddr = sctx_tr->ringaddr; ccs = sctx_tr->ccs; @@ -1931,6 +1953,10 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui streamid, ep_ctx->qwEpCtx2 & XHCI_TRB_3_CYCLE_BIT, trb->dwTrb3 & XHCI_TRB_3_CYCLE_BIT)); } else { + if (streamid != 0) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } ringaddr = devep->ep_ringaddr; ccs = devep->ep_ccs; trb = devep->ep_tr; Modified: releng/11.3/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- releng/11.3/usr.sbin/bhyve/pci_xhci.c Wed Jul 24 12:55:16 2019 (r350284) +++ releng/11.3/usr.sbin/bhyve/pci_xhci.c Wed Jul 24 12:56:06 2019 (r350285) @@ -1900,6 +1900,11 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui return; } + if (epid == 0 || epid >= XHCI_MAX_ENDPOINTS) { + DPRINTF(("pci_xhci: invalid endpoint %u\r\n", epid)); + return; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); @@ -1925,6 +1930,23 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui /* get next trb work item */ if (XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0) != 0) { + struct xhci_stream_ctx *sctx; + + /* + * Stream IDs of 0, 65535 (any stream), and 65534 + * (prime) are invalid. + */ + if (streamid == 0 || streamid == 65534 || streamid == 65535) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } + + sctx = NULL; + pci_xhci_find_stream(sc, ep_ctx, streamid, &sctx); + if (sctx == NULL) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } sctx_tr = &devep->ep_sctx_trbs[streamid]; ringaddr = sctx_tr->ringaddr; ccs = sctx_tr->ccs; @@ -1933,6 +1955,10 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui streamid, ep_ctx->qwEpCtx2 & XHCI_TRB_3_CYCLE_BIT, trb->dwTrb3 & XHCI_TRB_3_CYCLE_BIT)); } else { + if (streamid != 0) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } ringaddr = devep->ep_ringaddr; ccs = devep->ep_ccs; trb = devep->ep_tr; Modified: releng/12.0/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- releng/12.0/usr.sbin/bhyve/pci_xhci.c Wed Jul 24 12:55:16 2019 (r350284) +++ releng/12.0/usr.sbin/bhyve/pci_xhci.c Wed Jul 24 12:56:06 2019 (r350285) @@ -1900,6 +1900,11 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui return; } + if (epid == 0 || epid >= XHCI_MAX_ENDPOINTS) { + DPRINTF(("pci_xhci: invalid endpoint %u\r\n", epid)); + return; + } + dev = XHCI_SLOTDEV_PTR(sc, slot); devep = &dev->eps[epid]; dev_ctx = pci_xhci_get_dev_ctx(sc, slot); @@ -1925,6 +1930,23 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui /* get next trb work item */ if (XHCI_EPCTX_0_MAXP_STREAMS_GET(ep_ctx->dwEpCtx0) != 0) { + struct xhci_stream_ctx *sctx; + + /* + * Stream IDs of 0, 65535 (any stream), and 65534 + * (prime) are invalid. + */ + if (streamid == 0 || streamid == 65534 || streamid == 65535) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } + + sctx = NULL; + pci_xhci_find_stream(sc, ep_ctx, streamid, &sctx); + if (sctx == NULL) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } sctx_tr = &devep->ep_sctx_trbs[streamid]; ringaddr = sctx_tr->ringaddr; ccs = sctx_tr->ccs; @@ -1933,6 +1955,10 @@ pci_xhci_device_doorbell(struct pci_xhci_softc *sc, ui streamid, ep_ctx->qwEpCtx2 & XHCI_TRB_3_CYCLE_BIT, trb->dwTrb3 & XHCI_TRB_3_CYCLE_BIT)); } else { + if (streamid != 0) { + DPRINTF(("pci_xhci: invalid stream %u\r\n", streamid)); + return; + } ringaddr = devep->ep_ringaddr; ccs = devep->ep_ccs; trb = devep->ep_tr; From owner-svn-src-all@freebsd.org Wed Jul 24 12:57: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 0E024A785A; Wed, 24 Jul 2019 12:57:51 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 E36A4815DD; Wed, 24 Jul 2019 12:57:50 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3B2EE9E9; Wed, 24 Jul 2019 12:57:50 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OCvoFH076686; Wed, 24 Jul 2019 12:57:50 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OCvo64076684; Wed, 24 Jul 2019 12:57:50 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201907241257.x6OCvo64076684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 24 Jul 2019 12:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350286 - in releng: 11.2/sys/kern 11.3/sys/kern 12.0/sys/kern X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2/sys/kern 11.3/sys/kern 12.0/sys/kern X-SVN-Commit-Revision: 350286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E36A4815DD 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.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, 24 Jul 2019 12:57:51 -0000 Author: gordon Date: Wed Jul 24 12:57:49 2019 New Revision: 350286 URL: https://svnweb.freebsd.org/changeset/base/350286 Log: Fix file descriptor reference count leak. Approved by: so Security: FreeBSD-SA-19:17.fd Security: CVE-2019-5607 Modified: releng/11.2/sys/kern/uipc_usrreq.c releng/11.3/sys/kern/uipc_usrreq.c releng/12.0/sys/kern/uipc_usrreq.c Modified: releng/11.2/sys/kern/uipc_usrreq.c ============================================================================== --- releng/11.2/sys/kern/uipc_usrreq.c Wed Jul 24 12:56:06 2019 (r350285) +++ releng/11.2/sys/kern/uipc_usrreq.c Wed Jul 24 12:57:49 2019 (r350286) @@ -1896,29 +1896,52 @@ 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; - 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; @@ -2045,6 +2068,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); } Modified: releng/11.3/sys/kern/uipc_usrreq.c ============================================================================== --- releng/11.3/sys/kern/uipc_usrreq.c Wed Jul 24 12:56:06 2019 (r350285) +++ releng/11.3/sys/kern/uipc_usrreq.c Wed Jul 24 12:57:49 2019 (r350286) @@ -1908,30 +1908,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; @@ -2082,6 +2105,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); } Modified: releng/12.0/sys/kern/uipc_usrreq.c ============================================================================== --- releng/12.0/sys/kern/uipc_usrreq.c Wed Jul 24 12:56:06 2019 (r350285) +++ releng/12.0/sys/kern/uipc_usrreq.c Wed Jul 24 12:57:49 2019 (r350286) @@ -2123,30 +2123,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; @@ -2297,6 +2320,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 Wed Jul 24 12:58: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 F2E53A78BE; Wed, 24 Jul 2019 12:58:23 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 D5D718171E; Wed, 24 Jul 2019 12:58:23 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACD6DE9EA; Wed, 24 Jul 2019 12:58:23 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OCwNXA076770; Wed, 24 Jul 2019 12:58:23 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OCwM8G076764; Wed, 24 Jul 2019 12:58:22 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201907241258.x6OCwM8G076764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 24 Jul 2019 12:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350287 - in releng: 11.2 11.2/sys/conf 11.3 11.3/sys/conf 12.0 12.0/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2 11.2/sys/conf 11.3 11.3/sys/conf 12.0 12.0/sys/conf X-SVN-Commit-Revision: 350287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D5D718171E 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.93)[-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: Wed, 24 Jul 2019 12:58:24 -0000 Author: gordon Date: Wed Jul 24 12:58:21 2019 New Revision: 350287 URL: https://svnweb.freebsd.org/changeset/base/350287 Log: Bump version information and update UPDATING. Approved by: so Modified: releng/11.2/UPDATING releng/11.2/sys/conf/newvers.sh releng/11.3/UPDATING releng/11.3/sys/conf/newvers.sh releng/12.0/UPDATING releng/12.0/sys/conf/newvers.sh Modified: releng/11.2/UPDATING ============================================================================== --- releng/11.2/UPDATING Wed Jul 24 12:57:49 2019 (r350286) +++ releng/11.2/UPDATING Wed Jul 24 12:58:21 2019 (r350287) @@ -16,6 +16,28 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 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. +20190724 p12 FreeBSD-EN-19:13.mds + FreeBSD-SA-19:12.telnet + FreeBSD-SA-19:13.pts + FreeBSD-SA-19:14.freebsd32 + FreeBSD-SA-19:15.mqueuefs + FreeBSD-SA-19:16.bhyve + FreeBSD-SA-19:17.fd + + Fix panic from Intel CPU vulnerability mitigation. [EN-19:13.mds] + + Fix multiple telnet client vulnerabilities. [SA-19:12.telnet] + + Fix pts write-after-free. [SA-19:13.pts] + + Fix kernel memory disclosure in freebsd32_ioctl. [SA-19:14.freebsd32] + + Fix reference count overflow in mqueuefs. [SA-19:15.mqueuefs] + + Fix byhve out-of-bounds read in XHCI device. [SA-19:16.bhyve] + + Fix file descriptor reference count leak. [SA-19:17.fd] + 20190702 p11 FreeBSD-EN-19:12.tzdata FreeBSD-SA-19:09.iconv FreeBSD-SA-19:10.ufs Modified: releng/11.2/sys/conf/newvers.sh ============================================================================== --- releng/11.2/sys/conf/newvers.sh Wed Jul 24 12:57:49 2019 (r350286) +++ releng/11.2/sys/conf/newvers.sh Wed Jul 24 12:58:21 2019 (r350287) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.2" -BRANCH="RELEASE-p11" +BRANCH="RELEASE-p12" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/11.3/UPDATING ============================================================================== --- releng/11.3/UPDATING Wed Jul 24 12:57:49 2019 (r350286) +++ releng/11.3/UPDATING Wed Jul 24 12:58:21 2019 (r350287) @@ -16,10 +16,32 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 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. +20190724 p1 FreeBSD-EN-19:13.mds + FreeBSD-SA-19:12.telnet + FreeBSD-SA-19:13.pts + FreeBSD-SA-19:14.freebsd32 + FreeBSD-SA-19:15.mqueuefs + FreeBSD-SA-19:16.bhyve + FreeBSD-SA-19:17.fd + + Fix panic from Intel CPU vulnerability mitigation. [EN-19:13.mds] + + Fix multiple telnet client vulnerabilities. [SA-19:12.telnet] + + Fix pts write-after-free. [SA-19:13.pts] + + Fix kernel memory disclosure in freebsd32_ioctl. [SA-19:14.freebsd32] + + Fix reference count overflow in mqueuefs. [SA-19:15.mqueuefs] + + Fix byhve out-of-bounds read in XHCI device. [SA-19:16.bhyve] + + Fix file descriptor reference count leak. [SA-19:17.fd] + 20190709: 11.3-RELEASE. -20190702 p1 FreeBSD-EN-19:12.tzdata +20190702 FreeBSD-EN-19:12.tzdata FreeBSD-SA-19:09.iconv FreeBSD-SA-19:11.cd_ioctl Modified: releng/11.3/sys/conf/newvers.sh ============================================================================== --- releng/11.3/sys/conf/newvers.sh Wed Jul 24 12:57:49 2019 (r350286) +++ releng/11.3/sys/conf/newvers.sh Wed Jul 24 12:58:21 2019 (r350287) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.3" -BRANCH="RELEASE" +BRANCH="RELEASE-p1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/12.0/UPDATING ============================================================================== --- releng/12.0/UPDATING Wed Jul 24 12:57:49 2019 (r350286) +++ releng/12.0/UPDATING Wed Jul 24 12:58:21 2019 (r350287) @@ -16,6 +16,25 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 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. +20190724 p8 FreeBSD-EN-19:13.mds + FreeBSD-SA-19:12.telnet + FreeBSD-SA-19:13.pts + FreeBSD-SA-19:15.mqueuefs + FreeBSD-SA-19:16.bhyve + FreeBSD-SA-19:17.fd + + Fix panic from Intel CPU vulnerability mitigation. [EN-19:13.mds] + + Fix multiple telnet client vulnerabilities. [SA-19:12.telnet] + + Fix pts write-after-free. [SA-19:13.pts] + + Fix reference count overflow in mqueuefs. [SA-19:15.mqueuefs] + + Fix byhve out-of-bounds read in XHCI device. [SA-19:16.bhyve] + + Fix file descriptor reference count leak. [SA-19:17.fd] + 20190702 p7 FreeBSD-EN-19:12.tzdata FreeBSD-SA-19:09.iconv FreeBSD-SA-19:10.ufs Modified: releng/12.0/sys/conf/newvers.sh ============================================================================== --- releng/12.0/sys/conf/newvers.sh Wed Jul 24 12:57:49 2019 (r350286) +++ releng/12.0/sys/conf/newvers.sh Wed Jul 24 12:58:21 2019 (r350287) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="RELEASE-p7" +BRANCH="RELEASE-p8" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Wed Jul 24 14:15: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 24452AD8FD; Wed, 24 Jul 2019 14:15:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 05F1B88AA1; Wed, 24 Jul 2019 14:15:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD35BF909; Wed, 24 Jul 2019 14:15:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OEFVnB023934; Wed, 24 Jul 2019 14:15:31 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OEFV5N023932; Wed, 24 Jul 2019 14:15:31 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201907241415.x6OEFV5N023932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 24 Jul 2019 14:15:31 +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: r350288 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 350288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05F1B88AA1 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.931,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, 24 Jul 2019 14:15:32 -0000 Author: gjb Date: Wed Jul 24 14:15:31 2019 New Revision: 350288 URL: https://svnweb.freebsd.org/changeset/base/350288 Log: Document EN-19:13, SA-19:12-SA-19:17. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/release/doc/share/xml/errata.xml stable/11/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/errata.xml ============================================================================== --- stable/11/release/doc/share/xml/errata.xml Wed Jul 24 12:58:21 2019 (r350287) +++ stable/11/release/doc/share/xml/errata.xml Wed Jul 24 14:15:31 2019 (r350288) @@ -19,9 +19,11 @@ - No errata notices. -   -   + FreeBSD-EN-19:13.mds + 24 July 2019 + System crash from Intel CPU vulnerability + mitigation Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Wed Jul 24 12:58:21 2019 (r350287) +++ stable/11/release/doc/share/xml/security.xml Wed Jul 24 14:15:31 2019 (r350288) @@ -19,9 +19,45 @@ - No advisories. -   -   + FreeBSD-SA-19:12.telnet + 24 July 2019 + Multiple vulnerabilities + + + + FreeBSD-SA-19:13.pts + 24 July 2019 + Write-after-free vulnerability + + + + FreeBSD-SA-19:14.freebsd32 + 24 July 2019 + Kernel memory disclosure + + + + FreeBSD-SA-19:15.mqueuefs + 24 July 2019 + Reference count overflow + + + + FreeBSD-SA-19:16.bhyve + 24 July 2019 + &man.xhci.4; out-of-bounds read + + + + FreeBSD-SA-19:17.fd + 24 July 2019 + Reference count leak From owner-svn-src-all@freebsd.org Wed Jul 24 14:39: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 C9175AE838; Wed, 24 Jul 2019 14:39: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 A32DC89831; Wed, 24 Jul 2019 14:39: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 7C28EFCA6; Wed, 24 Jul 2019 14:39: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 x6OEdVFS035827; Wed, 24 Jul 2019 14:39:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OEdVg8035826; Wed, 24 Jul 2019 14:39:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907241439.x6OEdVg8035826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 24 Jul 2019 14:39: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: r350289 - stable/12/usr.sbin/rtadvd X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.sbin/rtadvd X-SVN-Commit-Revision: 350289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A32DC89831 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,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, 24 Jul 2019 14:39:31 -0000 Author: markj Date: Wed Jul 24 14:39:31 2019 New Revision: 350289 URL: https://svnweb.freebsd.org/changeset/base/350289 Log: MFC r350086: Remove obsolete compatibility code from rtadvd. Modified: stable/12/usr.sbin/rtadvd/rtadvd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- stable/12/usr.sbin/rtadvd/rtadvd.c Wed Jul 24 14:15:31 2019 (r350288) +++ stable/12/usr.sbin/rtadvd/rtadvd.c Wed Jul 24 14:39:31 2019 (r350289) @@ -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 24 14: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 A3632AE87A; Wed, 24 Jul 2019 14:39:53 +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 56A2089961; Wed, 24 Jul 2019 14:39:53 +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 2A01AFCAB; Wed, 24 Jul 2019 14:39:53 +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 x6OEdrYu035889; Wed, 24 Jul 2019 14:39:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OEdr8A035888; Wed, 24 Jul 2019 14:39:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907241439.x6OEdr8A035888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 24 Jul 2019 14:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350290 - stable/12/cddl/contrib/opensolaris/lib/libctf/common X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/lib/libctf/common X-SVN-Commit-Revision: 350290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56A2089961 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.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: Wed, 24 Jul 2019 14:39:53 -0000 Author: markj Date: Wed Jul 24 14:39:52 2019 New Revision: 350290 URL: https://svnweb.freebsd.org/changeset/base/350290 Log: MFC r350082: Reference stdint.h types in ctf.5. Modified: stable/12/cddl/contrib/opensolaris/lib/libctf/common/ctf.5 Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/lib/libctf/common/ctf.5 ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libctf/common/ctf.5 Wed Jul 24 14:39:31 2019 (r350289) +++ stable/12/cddl/contrib/opensolaris/lib/libctf/common/ctf.5 Wed Jul 24 14:39:52 2019 (r350290) @@ -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 24 15:09: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 05597AF265; Wed, 24 Jul 2019 15:09:16 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 53BEF8A654; Wed, 24 Jul 2019 15:09:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f41.google.com with SMTP id m24so90358246ioo.2; Wed, 24 Jul 2019 08:09:15 -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=Ocfh8a7hTjOFnS4YRaFIfLJKhPN6VUsFOSfcF9MI8kk=; b=lGm9WGWL3Hrpck2xf++4k19g/LjvuNNHrarP1Tntmo2m9XeYN1KG8q7k1spbkCkTVT 2sPoHhFQFE+qHADGy04GUAo5zoJHRd0jSr7x/49VBCRI+MrjKSZnaNZUEW6dZQaiBXKp atJXiGh5jJHhDoVgG6vc9jz1P7Nf2hdCWNr4kE0+C2J7Mo6H7tzOPxZwSSskL9n0HjP4 LiS0V4zCkHkRPv8ZL+UGqMPN8pAGxBxaKjvJm+SgD6MttvNM8cvioDQr4AeGp1cQrDHi /1EuKVj/pJMeA9vhAQ05GevNDmqFYjpWrHOlqSiDBOjQsslZm2pqY7H/IHPUdjDQSdh2 fXrw== X-Gm-Message-State: APjAAAVJA/lrrr1UG+R5uGe9WB19JH2NlZu5HW4aMhFOKrV3UZlYtFWH 1toC4Wca+5ToJhADsnL4kdOFP+0Jqofwd14E436o1w== X-Google-Smtp-Source: APXvYqzaTrB/CnMTl1cqqOyYO04RqXZ6zDqWnHFGwZdIJpMsZiM5ceMGJkmpuGfV6dEhLZr3KDWMCM2kkgdGbV8NXog= X-Received: by 2002:a5d:9d42:: with SMTP id k2mr28195724iok.45.1563980473819; Wed, 24 Jul 2019 08:01:13 -0700 (PDT) MIME-Version: 1.0 References: <201907070858.x678w3go067222@repo.freebsd.org> In-Reply-To: <201907070858.x678w3go067222@repo.freebsd.org> From: Ed Maste Date: Wed, 24 Jul 2019 09:21:32 -0400 Message-ID: Subject: Re: svn commit: r349802 - head/sys/fs/ext2fs To: Fedor Uporov Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 53BEF8A654 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.41 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-5.26 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_LAST(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.93)[-0.930,0]; RCVD_IN_DNSWL_NONE(0.00)[41.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.32)[ip: (-5.67), ipnet: 209.85.128.0/17(-3.44), asn: 15169(-2.43), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@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)[emaste@freebsd.org,carpeddiem@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: Wed, 24 Jul 2019 15:09:16 -0000 On Sun, 7 Jul 2019 at 04:58, Fedor Uporov wrote: > > Author: fsu > Date: Sun Jul 7 08:58:02 2019 > New Revision: 349802 > URL: https://svnweb.freebsd.org/changeset/base/349802 > > Log: > Add additional check for 'blocks per group' and 'fragments per group' superblock fields. Will you MFC this to stable/12 and stable/11? From owner-svn-src-all@freebsd.org Wed Jul 24 15:10: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 329E0AF32E; Wed, 24 Jul 2019 15:10:10 +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 13ECD8A7D2; Wed, 24 Jul 2019 15:10:10 +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 E431118241; Wed, 24 Jul 2019 15:10:09 +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 x6OFA9Ix053622; Wed, 24 Jul 2019 15:10:09 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OFA9QP053621; Wed, 24 Jul 2019 15:10:09 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907241510.x6OFA9QP053621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 24 Jul 2019 15:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350291 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 350291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 13ECD8A7D2 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,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, 24 Jul 2019 15:10:10 -0000 Author: asomers Date: Wed Jul 24 15:10:09 2019 New Revision: 350291 URL: https://svnweb.freebsd.org/changeset/base/350291 Log: Add c++14 and c++17 to COMPILER_FEATURES This will be used to gate the fusefs tests. It's a partial merge of r348281 from projects/fuse2. Reviewed by: kib, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21044 Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Wed Jul 24 14:39:52 2019 (r350290) +++ head/share/mk/bsd.compiler.mk Wed Jul 24 15:10:09 2019 (r350291) @@ -19,6 +19,8 @@ # COMPILER_FEATURES will contain one or more of the following, based on # compiler support for that feature: # +# - c++17: supports full (or nearly full) C++17 programming environment. +# - c++14: supports full (or nearly full) C++14 programming environment. # - c++11: supports full (or nearly full) C++11 programming environment. # - retpoline: supports the retpoline speculative execution vulnerability # mitigation. @@ -200,9 +202,17 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown .endif ${X_}COMPILER_FEATURES= -.if ${${X_}COMPILER_TYPE} == "clang" || \ +.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 30300) || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) ${X_}COMPILER_FEATURES+= c++11 +.endif +.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 30400) || \ + (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 50000) +${X_}COMPILER_FEATURES+= c++14 +.endif +.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 50000) || \ + (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 70000) +${X_}COMPILER_FEATURES+= c++17 .endif .if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000 ${X_}COMPILER_FEATURES+= retpoline From owner-svn-src-all@freebsd.org Wed Jul 24 15:18: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 286A6AF84A; Wed, 24 Jul 2019 15:18: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 097AA8AEEB; Wed, 24 Jul 2019 15:18: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 C5DFA18415; Wed, 24 Jul 2019 15:18:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OFI5bD059139; Wed, 24 Jul 2019 15:18:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OFI5OV059138; Wed, 24 Jul 2019 15:18:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907241518.x6OFI5OV059138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 24 Jul 2019 15:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350292 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 097AA8AEEB 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,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, 24 Jul 2019 15:18:06 -0000 Author: markj Date: Wed Jul 24 15:18:05 2019 New Revision: 350292 URL: https://svnweb.freebsd.org/changeset/base/350292 Log: Remove a redundant offset computation in elf_load_section(). With r344705 the offset is always zero. Submitted by: Wuyang Chung Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Wed Jul 24 15:10:09 2019 (r350291) +++ head/sys/kern/imgact_elf.c Wed Jul 24 15:18:05 2019 (r350292) @@ -550,7 +550,7 @@ __elfN(load_section)(struct image_params *imgp, vm_oof size_t map_len; vm_map_t map; vm_object_t object; - vm_offset_t off, map_addr; + vm_offset_t map_addr; int error, rv, cow; size_t copy_len; vm_ooffset_t file_addr; @@ -629,9 +629,8 @@ __elfN(load_section)(struct image_params *imgp, vm_oof return (EIO); /* send the page fragment to user space */ - off = trunc_page(offset + filsz) - trunc_page(offset + filsz); - error = copyout((caddr_t)sf_buf_kva(sf) + off, - (caddr_t)map_addr, copy_len); + error = copyout((caddr_t)sf_buf_kva(sf), (caddr_t)map_addr, + copy_len); vm_imgact_unmap_page(sf); if (error != 0) return (error); From owner-svn-src-all@freebsd.org Wed Jul 24 16:10: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 7BA3BB0CAF; Wed, 24 Jul 2019 16:10:21 +0000 (UTC) (envelope-from krion@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 5D33E8C6B9; Wed, 24 Jul 2019 16:10:21 +0000 (UTC) (envelope-from krion@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3430A18D5F; Wed, 24 Jul 2019 16:10:21 +0000 (UTC) (envelope-from krion@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OGALFA088983; Wed, 24 Jul 2019 16:10:21 GMT (envelope-from krion@FreeBSD.org) Received: (from krion@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OGALkO088982; Wed, 24 Jul 2019 16:10:21 GMT (envelope-from krion@FreeBSD.org) Message-Id: <201907241610.x6OGALkO088982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: krion set sender to krion@FreeBSD.org using -f From: Kirill Ponomarev Date: Wed, 24 Jul 2019 16:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350293 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: krion X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 350293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D33E8C6B9 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]; 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, 24 Jul 2019 16:10:21 -0000 Author: krion (ports committer) Date: Wed Jul 24 16:10:20 2019 New Revision: 350293 URL: https://svnweb.freebsd.org/changeset/base/350293 Log: Allow set MTU more than 1500 bytes. Submitted by: Alexandr Fedorov Approved by: jhb, rgrimes Sponsored by: ITGlobal.com Differential Revision: https://reviews.freebsd.org/D19422 Modified: head/sys/net/if_vxlan.c Modified: head/sys/net/if_vxlan.c ============================================================================== --- head/sys/net/if_vxlan.c Wed Jul 24 15:18:05 2019 (r350292) +++ head/sys/net/if_vxlan.c Wed Jul 24 16:10:20 2019 (r350293) @@ -84,6 +84,15 @@ struct vxlan_socket_mc_info { int vxlsomc_users; }; +/* + * The maximum MTU of encapsulated ethernet frame within IPv4/UDP packet. + */ +#define VXLAN_MAX_MTU (IP_MAXPACKET - \ + 60 /* Maximum IPv4 header len */ - \ + sizeof(struct udphdr) - \ + sizeof(struct vxlan_header) - \ + ETHER_HDR_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN) + #define VXLAN_SO_MC_MAX_GROUPS 32 #define VXLAN_SO_VNI_HASH_SHIFT 6 @@ -2247,10 +2256,11 @@ vxlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat ifr = (struct ifreq *) data; ifd = (struct ifdrv *) data; + error = 0; + switch (cmd) { case SIOCADDMULTI: case SIOCDELMULTI: - error = 0; break; case SIOCGDRVSPEC: @@ -2267,6 +2277,13 @@ vxlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat error = ifmedia_ioctl(ifp, ifr, &sc->vxl_media, cmd); break; + case SIOCSIFMTU: + if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > VXLAN_MAX_MTU) + error = EINVAL; + else + ifp->if_mtu = ifr->ifr_mtu; + break; + default: error = ether_ioctl(ifp, cmd, data); break; @@ -2747,8 +2764,8 @@ vxlan_clone_create(struct if_clone *ifc, int unit, cad ifp->if_ioctl = vxlan_ioctl; ifp->if_transmit = vxlan_transmit; ifp->if_qflush = vxlan_qflush; - ifp->if_capabilities |= IFCAP_LINKSTATE; - ifp->if_capenable |= IFCAP_LINKSTATE; + ifp->if_capabilities |= IFCAP_LINKSTATE | IFCAP_JUMBO_MTU; + ifp->if_capenable |= IFCAP_LINKSTATE | IFCAP_JUMBO_MTU; ifmedia_init(&sc->vxl_media, 0, vxlan_media_change, vxlan_media_status); ifmedia_add(&sc->vxl_media, IFM_ETHER | IFM_AUTO, 0, NULL); From owner-svn-src-all@freebsd.org Wed Jul 24 16:51: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 809D7B1E14; Wed, 24 Jul 2019 16:51:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 614B48E014; Wed, 24 Jul 2019 16:51:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E90019561; Wed, 24 Jul 2019 16:51:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OGpFsH016250; Wed, 24 Jul 2019 16:51:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OGpFDr016249; Wed, 24 Jul 2019 16:51:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907241651.x6OGpFDr016249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 24 Jul 2019 16:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350294 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 350294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 614B48E014 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: Wed, 24 Jul 2019 16:51:15 -0000 Author: emaste Date: Wed Jul 24 16:51:14 2019 New Revision: 350294 URL: https://svnweb.freebsd.org/changeset/base/350294 Log: pf: zero output buffer in pfioctl Avoid potential structure padding leak. Reported by: Vlad Tsyrklevich Reviewed by: kp MFC after: 3 days Security: Potential kernel memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Wed Jul 24 16:10:20 2019 (r350293) +++ head/sys/netpfil/pf/pf_ioctl.c Wed Jul 24 16:51:14 2019 (r350294) @@ -2169,7 +2169,7 @@ relock_DIOCKILLSTATES: break; } - p = pstore = malloc(ps->ps_len, M_TEMP, M_WAITOK); + p = pstore = malloc(ps->ps_len, M_TEMP, M_WAITOK | M_ZERO); nr = 0; for (i = 0; i <= pf_hashmask; i++) { From owner-svn-src-all@freebsd.org Wed Jul 24 17:41: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 3CE1AB3628; Wed, 24 Jul 2019 17:41:41 +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 1F5216A36B; Wed, 24 Jul 2019 17:41:41 +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 BAAF419F97; Wed, 24 Jul 2019 17:41:40 +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 x6OHfeY4045829; Wed, 24 Jul 2019 17:41:40 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OHfehO045809; Wed, 24 Jul 2019 17:41:40 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907241741.x6OHfehO045809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 24 Jul 2019 17:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350295 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 350295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F5216A36B 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.953,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, 24 Jul 2019 17:41:41 -0000 Author: lwhsu Date: Wed Jul 24 17:41:40 2019 New Revision: 350295 URL: https://svnweb.freebsd.org/changeset/base/350295 Log: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__follow_fork_parent_detached_unrelated_debugger PR: 239425 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Wed Jul 24 16:51:14 2019 (r350294) +++ head/tests/sys/kern/ptrace_test.c Wed Jul 24 17:41:40 2019 (r350295) @@ -936,6 +936,8 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrela pid_t children[2], fpid, wpid; int cpipe[2], status; + atf_tc_skip("https://bugs.freebsd.org/239425"); + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { From owner-svn-src-all@freebsd.org Wed Jul 24 19:16: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 2C927B5C38; Wed, 24 Jul 2019 19:16:06 +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 0E3B96EA39; Wed, 24 Jul 2019 19:16:06 +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 DB9CB1B07F; Wed, 24 Jul 2019 19:16:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OJG5eV003323; Wed, 24 Jul 2019 19:16:05 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OJG3wx003309; Wed, 24 Jul 2019 19:16:03 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907241916.x6OJG3wx003309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 24 Jul 2019 19:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350296 - stable/12/contrib/tcp_wrappers X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/contrib/tcp_wrappers X-SVN-Commit-Revision: 350296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0E3B96EA39 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.932,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, 24 Jul 2019 19:16:06 -0000 Author: brooks Date: Wed Jul 24 19:16:02 2019 New Revision: 350296 URL: https://svnweb.freebsd.org/changeset/base/350296 Log: MFC r350098, r350100-r350101 r350098: Use ANSI C function definitions and declerations. r350100: Use headers instead of manual declerations of standard functions and variables. r350101: 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 Sponsored by: DARPA, AFRL Modified: stable/12/contrib/tcp_wrappers/hosts_access.c stable/12/contrib/tcp_wrappers/inetcf.c stable/12/contrib/tcp_wrappers/inetcf.h stable/12/contrib/tcp_wrappers/mystdarg.h stable/12/contrib/tcp_wrappers/options.c stable/12/contrib/tcp_wrappers/rfc931.c stable/12/contrib/tcp_wrappers/scaffold.c stable/12/contrib/tcp_wrappers/scaffold.h stable/12/contrib/tcp_wrappers/shell_cmd.c stable/12/contrib/tcp_wrappers/socket.c stable/12/contrib/tcp_wrappers/tcpd.c stable/12/contrib/tcp_wrappers/tcpdchk.c stable/12/contrib/tcp_wrappers/tcpdmatch.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/tcp_wrappers/hosts_access.c ============================================================================== --- stable/12/contrib/tcp_wrappers/hosts_access.c Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/hosts_access.c Wed Jul 24 19:16:02 2019 (r350296) @@ -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: stable/12/contrib/tcp_wrappers/inetcf.c ============================================================================== --- stable/12/contrib/tcp_wrappers/inetcf.c Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/inetcf.c Wed Jul 24 19:16:02 2019 (r350296) @@ -14,12 +14,9 @@ static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02: #include #include #include -#include #include +#include -extern int errno; -extern void exit(); - #include "tcpd.h" #include "inetcf.h" #include "scaffold.h" @@ -39,8 +36,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 +67,6 @@ char *conf; char *arg0; char *arg1; struct tcpd_context saved_context; - char *percent_m(); int i; struct stat st; Modified: stable/12/contrib/tcp_wrappers/inetcf.h ============================================================================== --- stable/12/contrib/tcp_wrappers/inetcf.h Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/inetcf.h Wed Jul 24 19:16:02 2019 (r350296) @@ -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: stable/12/contrib/tcp_wrappers/mystdarg.h ============================================================================== --- stable/12/contrib/tcp_wrappers/mystdarg.h Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/mystdarg.h Wed Jul 24 19:16:02 2019 (r350296) @@ -16,4 +16,4 @@ #define VAEND(ap) va_end(ap);} #endif -extern char *percent_m(); +extern char *percent_m(char *obuf, char *ibuf); Modified: stable/12/contrib/tcp_wrappers/options.c ============================================================================== --- stable/12/contrib/tcp_wrappers/options.c Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/options.c Wed Jul 24 19:16:02 2019 (r350296) @@ -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: stable/12/contrib/tcp_wrappers/rfc931.c ============================================================================== --- stable/12/contrib/tcp_wrappers/rfc931.c Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/rfc931.c Wed Jul 24 19:16:02 2019 (r350296) @@ -66,8 +66,7 @@ int protocol; /* timeout - handle timeouts */ -static void timeout(sig) -int sig; +static void timeout(int sig) { longjmp(timebuf, sig); } Modified: stable/12/contrib/tcp_wrappers/scaffold.c ============================================================================== --- stable/12/contrib/tcp_wrappers/scaffold.c Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/scaffold.c Wed Jul 24 19:16:02 2019 (r350296) @@ -21,6 +21,7 @@ static char sccs_id[] = "@(#) scaffold.c 1.6 97/03/21 #include #include #include +#include #include #include @@ -38,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 */ Modified: stable/12/contrib/tcp_wrappers/scaffold.h ============================================================================== --- stable/12/contrib/tcp_wrappers/scaffold.h Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/scaffold.h Wed Jul 24 19:16:02 2019 (r350296) @@ -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: stable/12/contrib/tcp_wrappers/shell_cmd.c ============================================================================== --- stable/12/contrib/tcp_wrappers/shell_cmd.c Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/shell_cmd.c Wed Jul 24 19:16:02 2019 (r350296) @@ -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: stable/12/contrib/tcp_wrappers/socket.c ============================================================================== --- stable/12/contrib/tcp_wrappers/socket.c Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/socket.c Wed Jul 24 19:16:02 2019 (r350296) @@ -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: stable/12/contrib/tcp_wrappers/tcpd.c ============================================================================== --- stable/12/contrib/tcp_wrappers/tcpd.c Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/tcpd.c Wed Jul 24 19:16:02 2019 (r350296) @@ -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: stable/12/contrib/tcp_wrappers/tcpdchk.c ============================================================================== --- stable/12/contrib/tcp_wrappers/tcpdchk.c Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/tcpdchk.c Wed Jul 24 19:16:02 2019 (r350296) @@ -34,15 +34,10 @@ 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 */ #endif @@ -73,15 +68,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 +180,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: stable/12/contrib/tcp_wrappers/tcpdmatch.c ============================================================================== --- stable/12/contrib/tcp_wrappers/tcpdmatch.c Wed Jul 24 17:41:40 2019 (r350295) +++ stable/12/contrib/tcp_wrappers/tcpdmatch.c Wed Jul 24 19:16:02 2019 (r350296) @@ -30,13 +30,10 @@ 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 */ #endif @@ -51,8 +48,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 24 19:21: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 E7E15B5D7A; Wed, 24 Jul 2019 19:21:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 CB12F6EEB0; Wed, 24 Jul 2019 19:21:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A69021B0C1; Wed, 24 Jul 2019 19:21:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OJLGkx007400; Wed, 24 Jul 2019 19:21:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OJLGjB007399; Wed, 24 Jul 2019 19:21:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907241921.x6OJLGjB007399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 24 Jul 2019 19:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350297 - stable/12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/mk X-SVN-Commit-Revision: 350297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CB12F6EEB0 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.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, 24 Jul 2019 19:21:17 -0000 Author: emaste Date: Wed Jul 24 19:21:16 2019 New Revision: 350297 URL: https://svnweb.freebsd.org/changeset/base/350297 Log: MFC r343606: Enable lld as the system linker on i386 The migration to LLVM's lld linker has been in progress for quite some time - I opened an LLVM tracking bug (23214) in April 2015 to track issues using lld as FreeBSD's linker, and requested the first exp-run using lld as /usr/bin/ld in November 2016. In 12.0 LLD is the system linker on amd64, arm64, and armv7. i386 was not switched [for 12.0] as there were additional ports failures not found on amd64. Those have largely been addressed now, although there are a small number of issues that are still being worked on. In some of these cases having lld as the system linker makes it easier for developers and third parties to investigate failures. Thanks to antoine@ for handling the exp-runs and to everyone in the FreeBSD and LLVM communites who have fixed issues with lld to get us to this point. Note for 12.1: There are still some issues to resolve in the ports tree, but having the bootstrap linker (to build the kernel and installed userland) be lld and the installed system linker (/usr/bin/ld) be GNU ld causes other problems. In addition having having a different linker configuration for i386 and amd64 in the same release causes some grief for the ports team. So, switch to lld as the system linker on i386 in stable/12 and plan to address remaining ports issues before 12.1. PR: 214864 [exp-run] Discussed with: jbeich, antoine Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Wed Jul 24 19:16:02 2019 (r350296) +++ stable/12/share/mk/src.opts.mk Wed Jul 24 19:21:16 2019 (r350297) @@ -322,11 +322,9 @@ __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND .else __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND .endif -.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv7" +.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv7" || \ + ${__T} == "i386" __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD -.elif ${__T} == "i386" -__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP -__DEFAULT_NO_OPTIONS+=LLD_IS_LD .else __DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD .endif From owner-svn-src-all@freebsd.org Wed Jul 24 19:24: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 0523BB5F8F; Wed, 24 Jul 2019 19:24:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 DA5B36F325; Wed, 24 Jul 2019 19:24:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADD081B252; Wed, 24 Jul 2019 19:24:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OJOYJE009254; Wed, 24 Jul 2019 19:24:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OJOYN6009253; Wed, 24 Jul 2019 19:24:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907241924.x6OJOYN6009253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 24 Jul 2019 19:24: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: r350298 - stable/12/share/man/man5 X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/man/man5 X-SVN-Commit-Revision: 350298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA5B36F325 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_SHORT(-0.93)[-0.932,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: Wed, 24 Jul 2019 19:24:35 -0000 Author: emaste Date: Wed Jul 24 19:24:34 2019 New Revision: 350298 URL: https://svnweb.freebsd.org/changeset/base/350298 Log: src.conf.5: regenerate after r350297 (lld for i386 MFC) Modified: stable/12/share/man/man5/src.conf.5 Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Wed Jul 24 19:21:16 2019 (r350297) +++ stable/12/share/man/man5/src.conf.5 Wed Jul 24 19:24:34 2019 (r350298) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 22, 2019 +.Dd July 24, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1063,12 +1063,12 @@ amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386. Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on -arm/arm, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp This is a default setting on -amd64/amd64, arm/armv7 and arm64/aarch64. +amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386. .It Va WITHOUT_LLVM_COV Set to not build the .Xr llvm-cov 1 From owner-svn-src-all@freebsd.org Wed Jul 24 19:57: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 CDF18B6BE0; Wed, 24 Jul 2019 19:57:12 +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 A9CFD70FB5; Wed, 24 Jul 2019 19:57:12 +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 80DAB1B7FB; Wed, 24 Jul 2019 19:57:12 +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 x6OJvClJ027070; Wed, 24 Jul 2019 19:57:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OJvCoh027069; Wed, 24 Jul 2019 19:57:12 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907241957.x6OJvCoh027069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 24 Jul 2019 19:57:12 +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: r350299 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 350299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9CFD70FB5 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.932,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, 24 Jul 2019 19:57:12 -0000 Author: brooks Date: Wed Jul 24 19:57:11 2019 New Revision: 350299 URL: https://svnweb.freebsd.org/changeset/base/350299 Log: MFC r350102: Remove redundent decleration of __elf_phdr_match_addr(). Obtained from: CheriBSD Sponsored by: DARPA, AFRL Modified: stable/12/lib/libc/gen/elf_utils.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/elf_utils.c ============================================================================== --- stable/12/lib/libc/gen/elf_utils.c Wed Jul 24 19:24:34 2019 (r350298) +++ stable/12/lib/libc/gen/elf_utils.c Wed Jul 24 19:57:11 2019 (r350299) @@ -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 Wed Jul 24 20:17: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 D88F4B74CE; Wed, 24 Jul 2019 20:17:40 +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 BB77271FAE; Wed, 24 Jul 2019 20:17:40 +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 97D651BB94; Wed, 24 Jul 2019 20:17:40 +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 x6OKHeGO038973; Wed, 24 Jul 2019 20:17:40 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OKHevn038972; Wed, 24 Jul 2019 20:17:40 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907242017.x6OKHevn038972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 24 Jul 2019 20:17: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: r350300 - stable/12/contrib/amd/amd X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/contrib/amd/amd X-SVN-Commit-Revision: 350300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB77271FAE 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.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, 24 Jul 2019 20:17:40 -0000 Author: brooks Date: Wed Jul 24 20:17:39 2019 New Revision: 350300 URL: https://svnweb.freebsd.org/changeset/base/350300 Log: MFC r350049: 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: stable/12/contrib/amd/amd/amd.h stable/12/contrib/amd/amd/rpc_fwd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/amd/amd/amd.h ============================================================================== --- stable/12/contrib/amd/amd/amd.h Wed Jul 24 19:57:11 2019 (r350299) +++ stable/12/contrib/amd/amd/amd.h Wed Jul 24 20:17:39 2019 (r350300) @@ -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: stable/12/contrib/amd/amd/rpc_fwd.c ============================================================================== --- stable/12/contrib/amd/amd/rpc_fwd.c Wed Jul 24 19:57:11 2019 (r350299) +++ stable/12/contrib/amd/amd/rpc_fwd.c Wed Jul 24 20:17:39 2019 (r350300) @@ -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 Wed Jul 24 21:06: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 5E56CB8D26; Wed, 24 Jul 2019 21:06:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 41A0C74A90; Wed, 24 Jul 2019 21:06:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 314661C4BF; Wed, 24 Jul 2019 21:06:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OL6Ko2068072; Wed, 24 Jul 2019 21:06:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OL6KaM068071; Wed, 24 Jul 2019 21:06:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907242106.x6OL6KaM068071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 24 Jul 2019 21:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350301 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 350301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 41A0C74A90 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.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: Wed, 24 Jul 2019 21:06:20 -0000 Author: emaste Date: Wed Jul 24 21:06:19 2019 New Revision: 350301 URL: https://svnweb.freebsd.org/changeset/base/350301 Log: libsysdecode: add explicit dependencies on recently changed headers r349369 removed IP_MIN_MEMBERSHIPS and IPV6_MIN_MEMBERSHIPS, and r349893 removed TCP_RACK_SESS_CWV. libsysdecode lacked dependencies to trigger a rebuild of tables.h. Add explicit dependencies as a workaround to address these specific cases; a holistic solution is still needed. Sponsored by: The FreeBSD Foundation Modified: head/lib/libsysdecode/Makefile Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Wed Jul 24 20:17:39 2019 (r350300) +++ head/lib/libsysdecode/Makefile Wed Jul 24 21:06:19 2019 (r350301) @@ -123,7 +123,8 @@ CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} DEPENDOBJS+= tables.h -tables.h: mktables +tables.h: mktables ${SYSROOT}/sys/netinet/in.h ${SYSROOT}/sys/netinet/tcp.h \ + ${SYSROOT}/sys/netinet6/in6.h sh ${.CURDIR}/mktables ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} ${.TARGET}.tmp && \ mv -f ${.TARGET}.tmp ${.TARGET} From owner-svn-src-all@freebsd.org Wed Jul 24 21:08: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 6A9D8B8DE7; Wed, 24 Jul 2019 21:08:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 4CE5574C4E; Wed, 24 Jul 2019 21:08:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D4F71C4C0; Wed, 24 Jul 2019 21:08:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OL8UrO068216; Wed, 24 Jul 2019 21:08:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OL8Uwg068215; Wed, 24 Jul 2019 21:08:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907242108.x6OL8Uwg068215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 24 Jul 2019 21:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350302 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CE5574C4E 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.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: Wed, 24 Jul 2019 21:08:31 -0000 Author: emaste Date: Wed Jul 24 21:08:30 2019 New Revision: 350302 URL: https://svnweb.freebsd.org/changeset/base/350302 Log: cirrus.yml: use OVMF.fd from uefi-edk2-qemu-x86_64 package Sponsored by: The FreeBSD Foundation Modified: head/.cirrus.yml Modified: head/.cirrus.yml ============================================================================== --- head/.cirrus.yml Wed Jul 24 21:06:19 2019 (r350301) +++ head/.cirrus.yml Wed Jul 24 21:08:30 2019 (r350302) @@ -11,9 +11,9 @@ env: task: timeout_in: 90m install_script: - - pkg install -y qemu-devel + - pkg install -y qemu-devel uefi-edk2-qemu-x86_64 - fetch https://people.freebsd.org/~emaste/OVMF.fd script: - make -j$(sysctl -n hw.ncpu) WITHOUT_TOOLCHAIN=yes buildworld buildkernel test_script: - - OVMF=$(pwd)/OVMF.fd sh tools/boot/ci-qemu-test.sh + - sh tools/boot/ci-qemu-test.sh From owner-svn-src-all@freebsd.org Wed Jul 24 21:26: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 9440EB95C6; Wed, 24 Jul 2019 21:26:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 7653D759B2; Wed, 24 Jul 2019 21:26:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 672881C848; Wed, 24 Jul 2019 21:26:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OLQI0X080124; Wed, 24 Jul 2019 21:26:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OLQIwo080123; Wed, 24 Jul 2019 21:26:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907242126.x6OLQIwo080123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 24 Jul 2019 21:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350303 - head/sys/modules/i2c/controllers/ichiic X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/modules/i2c/controllers/ichiic X-SVN-Commit-Revision: 350303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7653D759B2 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.953,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, 24 Jul 2019 21:26:18 -0000 Author: emaste Date: Wed Jul 24 21:26:17 2019 New Revision: 350303 URL: https://svnweb.freebsd.org/changeset/base/350303 Log: enable ig4_acpi on aarch64 The already-listed APMC0D0F ID belongs to the Ampere eMAG aarch64 platform, but ACPI support was not even built on aarch64. Submitted by: Greg V Differential Revision: https://reviews.freebsd.org/D21059 Modified: head/sys/modules/i2c/controllers/ichiic/Makefile Modified: head/sys/modules/i2c/controllers/ichiic/Makefile ============================================================================== --- head/sys/modules/i2c/controllers/ichiic/Makefile Wed Jul 24 21:08:30 2019 (r350302) +++ head/sys/modules/i2c/controllers/ichiic/Makefile Wed Jul 24 21:26:17 2019 (r350303) @@ -6,7 +6,8 @@ SRCS = acpi_if.h device_if.h bus_if.h iicbus_if.h pci smbus_if.h ${ig4_acpi} ig4_iic.c ig4_pci.c ig4_reg.h \ ig4_var.h opt_acpi.h -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" ig4_acpi= ig4_acpi.c .endif From owner-svn-src-all@freebsd.org Wed Jul 24 21:39: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 86870B9A63; Wed, 24 Jul 2019 21:39:02 +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 671DF76358; Wed, 24 Jul 2019 21:39:02 +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 3D6971CA41; Wed, 24 Jul 2019 21:39:02 +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 x6OLd2CO086298; Wed, 24 Jul 2019 21:39:02 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OLd1IM086292; Wed, 24 Jul 2019 21:39:01 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907242139.x6OLd1IM086292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 24 Jul 2019 21:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350304 - in stable/12/contrib/netbsd-tests/lib/libc: gen stdio sys X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/12/contrib/netbsd-tests/lib/libc: gen stdio sys X-SVN-Commit-Revision: 350304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 671DF76358 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: Wed, 24 Jul 2019 21:39:02 -0000 Author: brooks Date: Wed Jul 24 21:39:00 2019 New Revision: 350304 URL: https://svnweb.freebsd.org/changeset/base/350304 Log: MFC r350067: 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: stable/12/contrib/netbsd-tests/lib/libc/gen/t_ftok.c stable/12/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c stable/12/contrib/netbsd-tests/lib/libc/sys/t_access.c stable/12/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c stable/12/contrib/netbsd-tests/lib/libc/sys/t_stat.c stable/12/contrib/netbsd-tests/lib/libc/sys/t_write.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/netbsd-tests/lib/libc/gen/t_ftok.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/libc/gen/t_ftok.c Wed Jul 24 21:26:17 2019 (r350303) +++ stable/12/contrib/netbsd-tests/lib/libc/gen/t_ftok.c Wed Jul 24 21:39:00 2019 (r350304) @@ -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: stable/12/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c Wed Jul 24 21:26:17 2019 (r350303) +++ stable/12/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c Wed Jul 24 21:39:00 2019 (r350304) @@ -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: stable/12/contrib/netbsd-tests/lib/libc/sys/t_access.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/libc/sys/t_access.c Wed Jul 24 21:26:17 2019 (r350303) +++ stable/12/contrib/netbsd-tests/lib/libc/sys/t_access.c Wed Jul 24 21:39:00 2019 (r350304) @@ -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: stable/12/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c Wed Jul 24 21:26:17 2019 (r350303) +++ stable/12/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c Wed Jul 24 21:39:00 2019 (r350304) @@ -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: stable/12/contrib/netbsd-tests/lib/libc/sys/t_stat.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/libc/sys/t_stat.c Wed Jul 24 21:26:17 2019 (r350303) +++ stable/12/contrib/netbsd-tests/lib/libc/sys/t_stat.c Wed Jul 24 21:39:00 2019 (r350304) @@ -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: stable/12/contrib/netbsd-tests/lib/libc/sys/t_write.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/libc/sys/t_write.c Wed Jul 24 21:26:17 2019 (r350303) +++ stable/12/contrib/netbsd-tests/lib/libc/sys/t_write.c Wed Jul 24 21:39:00 2019 (r350304) @@ -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 Wed Jul 24 21:40: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 4FC79B9B31; Wed, 24 Jul 2019 21:40:35 +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 2F46A76536; Wed, 24 Jul 2019 21:40:35 +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 0B8E21CA49; Wed, 24 Jul 2019 21:40:35 +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 x6OLeYV5086448; Wed, 24 Jul 2019 21:40:34 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OLeYvq086447; Wed, 24 Jul 2019 21:40:34 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907242140.x6OLeYvq086447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 24 Jul 2019 21:40:34 +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: r350305 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 350305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F46A76536 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.947,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, 24 Jul 2019 21:40:35 -0000 Author: brooks Date: Wed Jul 24 21:40:34 2019 New Revision: 350305 URL: https://svnweb.freebsd.org/changeset/base/350305 Log: MFC r350102: Remove redundent decleration of __elf_phdr_match_addr(). Obtained from: CheriBSD Sponsored by: DARPA, AFRL Modified: stable/11/lib/libc/gen/elf_utils.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/elf_utils.c ============================================================================== --- stable/11/lib/libc/gen/elf_utils.c Wed Jul 24 21:39:00 2019 (r350304) +++ stable/11/lib/libc/gen/elf_utils.c Wed Jul 24 21:40:34 2019 (r350305) @@ -36,7 +36,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 Wed Jul 24 21:43: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 5B2E4B9D1A; Wed, 24 Jul 2019 21:43:42 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 350557696C; Wed, 24 Jul 2019 21:43:42 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C19D31CC03; Wed, 24 Jul 2019 21:43:41 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6OLhfSW092080; Wed, 24 Jul 2019 21:43:41 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OLhfWI092079; Wed, 24 Jul 2019 21:43:41 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201907242143.x6OLhfWI092079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 24 Jul 2019 21:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350306 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 350306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 350557696C 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.953,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, 24 Jul 2019 21:43:42 -0000 Author: erj Date: Wed Jul 24 21:43:41 2019 New Revision: 350306 URL: https://svnweb.freebsd.org/changeset/base/350306 Log: iflib: fix dangling device softc pointer Commit text by Jake: If a driver's IFDI_ATTACH_PRE function fails, the iflib_device_register function will free the ctx pointer. However, it does not reset the device softc pointer to NULL. This will result in memory corruption as a future access to the now invalid pointer will corrupt memory that is later allocated on top of the same memory location. The iflib_device_deregister function correctly resets the softc pointer by using device_set_softc(). This clears up the invalid dangling pointer and prevents memory corruption that could lead to a panic or undefined behavior if the device's driver failed to attach. Signed-off-by: Jacob Keller Submitted by: Jacob Keller Reviewed by: erj@, gallatin@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D21003 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Jul 24 21:40:34 2019 (r350305) +++ head/sys/net/iflib.c Wed Jul 24 21:43:41 2019 (r350306) @@ -4785,6 +4785,7 @@ fail_queues: fail_unlock: CTX_UNLOCK(ctx); fail_ctx_free: + device_set_softc(ctx->ifc_dev, NULL); if (ctx->ifc_flags & IFC_SC_ALLOCATED) free(ctx->ifc_softc, M_IFLIB); free(ctx, M_IFLIB); From owner-svn-src-all@freebsd.org Wed Jul 24 22:15: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 C2430BA828; Wed, 24 Jul 2019 22:15:00 +0000 (UTC) (envelope-from madpilot@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 A29C480044; Wed, 24 Jul 2019 22:15:00 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from tommy.madpilot.net (78-134-115-11.v4.ngi.it [78.134.115.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: madpilot/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id D17612AD; Wed, 24 Jul 2019 22:14:59 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Subject: Re: svn commit: r350135 - head/share/mk To: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201907191511.x6JFBWVi053537@repo.freebsd.org> From: Guido Falsi Openpgp: preference=signencrypt Autocrypt: addr=madpilot@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBE+G+l0BCADi/WBQ0aRJfnE7LBPsM0G3m/m3Yx7OPu4iYFvS84xawmRHtCNjWIntsxuX fptkmEo3Rsw816WUrek8dxoUAYdHd+EcpBcnnDzfDH5LW/TZ4gbrFezrHPdRp7wdxi23GN80 qPwHEwXuF0X4Wy5V0OO8B6VT/nA0ADYnBDhXS52HGIJ/GCUjgqJn+phDTdCFLvrSFdmgx4Wl c0W5Z1p5cmDF9l8L/hc959AeyNf7I9dXnjekGM9gVv7UDUYzCifR3U8T0fnfdMmS8NeI9NC+ wuREpRO4lKOkTnj9TtQJRiptlhcHQiAlG1cFqs7EQo57Tqq6cxD1FycZJLuC32bGbgalABEB AAG0Ikd1aWRvIEZhbHNpIDxtYWRwaWxvdEBGcmVlQlNELm9yZz6JATYEEwEIACACGwMCHgEC F4AFAlLvzwUFCwkIBwMFFQoJCAsEFgIDAQAKCRAa5oYOVsvSk6EzCAC4ovSo6XF4x0spuKmp RzVuZ5ywqCJAfRIrJHpW8HjSPkcUYwmXVOE3zjul9j2C2eHPPGobEDN5FqovAtzb7HdYGGcU aUdhDApUMMRVkzflwb23C/CI1RBcZxjC0noajSKgbIHx4+Afg6CFMgpngq+NJwEaaVrKlYzq G+KcfeVKAdwlWHJOgQJIEylUtwtBqXx/iJDrGwKO5A6a1uSEZrZfuwjSh8cBqoUfIwLZUIFE HBjHa8pUkp8mWx7JaZ19vBF6pDpPVZSoLSg8stWd1DPesn/qySYgtSGSY6hpWABVF98HRsBG +VXlHtqCaB0j0cGCDhCpHQUI10oGGc8k4zcvuQINBFMQe0EBEAChYaw3HqD3SvyBw0pqI+kk GIrLzO1XYXJXkuxPQ6BAFbe8jG3+h22zFU02OnJL8E1kLLMsCwVzVasYHOFiyY831IYHn/lh O+TN/lhWJTlUCxmWP8xFYJmta2mJzhzQDs3hyw5hF422T+rxgHg8gWxn0D6RO6hmGe7m3k91 8EDvj5JXAq7zj49mT3AMRjUtsVVPy8zjagqyaizCUiHAnbG4kj+BuT5wxR7TKJGk2OjhK/Dh EHzgHq4XB1Gv8+1LvGLZmqih/kBpBP1hIGkakok579CTkw/g8XoWqr6Cjz2fvtjaQmTBwdou gP8Yn5kMBIiIxF7XLngUc5DVEJMYamcktd0q4aHC/cnbWlTwc2WrQBI1AwxCZgDC1RbOOan8 oTIjWqRyaNp9zFvxOaJqgrxJA3Vl/3p9z+witk3pnmg4ITLIJDSmsf89MDaOVGQpDjzs9MaT YlIpTlW5Lns2WTYOue+NanntpX14UCGmeusk+4aYXPzf89zyALS3s3uLtVUdhFwLmdrFgHZS gjU5STLGlP8e9AVddVnf8qZ1czOvHX3UCCAI9YjBQA/5VxpRFJil4OTr9lUA5U57UKGpwmKw IPvArbT8468nYC2Rat4a7UJn3NLHucr9Vh0uvfgbFDhtPUb72sFA2cVI1tfZMnjfUx2jUYKM N5ErgK1Kes0piQARAQABiQEfBBgBCAAJBQJTEHtBAhsMAAoJEBrmhg5Wy9KTDecIAOGwpF/6 sBFQtOk6HkegtqbrZklkDIKQ2qq7+uR7m6PkBpoNj+HsE2EEOIOqGFktN6h8alVVoSs+xY36 1fnR/Kmwi30oCHL3QYWu2shmVa7IrjCyhm8N+n3JpGT6Ugznx3D9Fx/GfrvQlo9MVJE8QJWf +4uoGElKRtiVjbXZhP1/FVRMl7rAi8MtCtASOtAP+HUUyF9wuECqyd2W1F3oM+9Mp4x3/pUD GfSGSgEqETLkuRaMz0Iemm75sGRD3X+SPa4lBJc7x66ifAcdLdz7o3aLYfsjR6Zwca7TvC5E Ha0OfD9EsHGiF9909lPaRvG4buWFUfPBUPDkNHBLDwaQ53I= Message-ID: <37944eff-6e00-df14-59d3-beae3fa89b6a@FreeBSD.org> Date: Thu, 25 Jul 2019 00:14:56 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201907191511.x6JFBWVi053537@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: A29C480044 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.978,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, 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: Wed, 24 Jul 2019 22:15:00 -0000 On 19/07/19 17:11, Emmanuel Vadot wrote: > 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 > Hello, I don't know the actual workings of this file and have not checked it in depth, but this change is causing "make package" to not package /etc/rc.d/sshd (and others, all the ones being defined in ${group}PACKAGE variables), which are then missing when upgrading machines. Reverting this change makes packaging things work again. I think this change is actually wrong and the previous version was correct. -- Guido Falsi From owner-svn-src-all@freebsd.org Wed Jul 24 22:17: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 2281EBA8D2; Wed, 24 Jul 2019 22:17:33 +0000 (UTC) (envelope-from madpilot@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 048CF8021C; Wed, 24 Jul 2019 22:17:33 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from tommy.madpilot.net (78-134-115-11.v4.ngi.it [78.134.115.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: madpilot/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 363542AE; Wed, 24 Jul 2019 22:17:32 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Subject: Re: svn commit: r350135 - head/share/mk From: Guido Falsi To: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201907191511.x6JFBWVi053537@repo.freebsd.org> <37944eff-6e00-df14-59d3-beae3fa89b6a@FreeBSD.org> Openpgp: preference=signencrypt Autocrypt: addr=madpilot@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBE+G+l0BCADi/WBQ0aRJfnE7LBPsM0G3m/m3Yx7OPu4iYFvS84xawmRHtCNjWIntsxuX fptkmEo3Rsw816WUrek8dxoUAYdHd+EcpBcnnDzfDH5LW/TZ4gbrFezrHPdRp7wdxi23GN80 qPwHEwXuF0X4Wy5V0OO8B6VT/nA0ADYnBDhXS52HGIJ/GCUjgqJn+phDTdCFLvrSFdmgx4Wl c0W5Z1p5cmDF9l8L/hc959AeyNf7I9dXnjekGM9gVv7UDUYzCifR3U8T0fnfdMmS8NeI9NC+ wuREpRO4lKOkTnj9TtQJRiptlhcHQiAlG1cFqs7EQo57Tqq6cxD1FycZJLuC32bGbgalABEB AAG0Ikd1aWRvIEZhbHNpIDxtYWRwaWxvdEBGcmVlQlNELm9yZz6JATYEEwEIACACGwMCHgEC F4AFAlLvzwUFCwkIBwMFFQoJCAsEFgIDAQAKCRAa5oYOVsvSk6EzCAC4ovSo6XF4x0spuKmp RzVuZ5ywqCJAfRIrJHpW8HjSPkcUYwmXVOE3zjul9j2C2eHPPGobEDN5FqovAtzb7HdYGGcU aUdhDApUMMRVkzflwb23C/CI1RBcZxjC0noajSKgbIHx4+Afg6CFMgpngq+NJwEaaVrKlYzq G+KcfeVKAdwlWHJOgQJIEylUtwtBqXx/iJDrGwKO5A6a1uSEZrZfuwjSh8cBqoUfIwLZUIFE HBjHa8pUkp8mWx7JaZ19vBF6pDpPVZSoLSg8stWd1DPesn/qySYgtSGSY6hpWABVF98HRsBG +VXlHtqCaB0j0cGCDhCpHQUI10oGGc8k4zcvuQINBFMQe0EBEAChYaw3HqD3SvyBw0pqI+kk GIrLzO1XYXJXkuxPQ6BAFbe8jG3+h22zFU02OnJL8E1kLLMsCwVzVasYHOFiyY831IYHn/lh O+TN/lhWJTlUCxmWP8xFYJmta2mJzhzQDs3hyw5hF422T+rxgHg8gWxn0D6RO6hmGe7m3k91 8EDvj5JXAq7zj49mT3AMRjUtsVVPy8zjagqyaizCUiHAnbG4kj+BuT5wxR7TKJGk2OjhK/Dh EHzgHq4XB1Gv8+1LvGLZmqih/kBpBP1hIGkakok579CTkw/g8XoWqr6Cjz2fvtjaQmTBwdou gP8Yn5kMBIiIxF7XLngUc5DVEJMYamcktd0q4aHC/cnbWlTwc2WrQBI1AwxCZgDC1RbOOan8 oTIjWqRyaNp9zFvxOaJqgrxJA3Vl/3p9z+witk3pnmg4ITLIJDSmsf89MDaOVGQpDjzs9MaT YlIpTlW5Lns2WTYOue+NanntpX14UCGmeusk+4aYXPzf89zyALS3s3uLtVUdhFwLmdrFgHZS gjU5STLGlP8e9AVddVnf8qZ1czOvHX3UCCAI9YjBQA/5VxpRFJil4OTr9lUA5U57UKGpwmKw IPvArbT8468nYC2Rat4a7UJn3NLHucr9Vh0uvfgbFDhtPUb72sFA2cVI1tfZMnjfUx2jUYKM N5ErgK1Kes0piQARAQABiQEfBBgBCAAJBQJTEHtBAhsMAAoJEBrmhg5Wy9KTDecIAOGwpF/6 sBFQtOk6HkegtqbrZklkDIKQ2qq7+uR7m6PkBpoNj+HsE2EEOIOqGFktN6h8alVVoSs+xY36 1fnR/Kmwi30oCHL3QYWu2shmVa7IrjCyhm8N+n3JpGT6Ugznx3D9Fx/GfrvQlo9MVJE8QJWf +4uoGElKRtiVjbXZhP1/FVRMl7rAi8MtCtASOtAP+HUUyF9wuECqyd2W1F3oM+9Mp4x3/pUD GfSGSgEqETLkuRaMz0Iemm75sGRD3X+SPa4lBJc7x66ifAcdLdz7o3aLYfsjR6Zwca7TvC5E Ha0OfD9EsHGiF9909lPaRvG4buWFUfPBUPDkNHBLDwaQ53I= Message-ID: <28eb9717-533e-3d87-0e30-f60317ed97cb@FreeBSD.org> Date: Thu, 25 Jul 2019 00:17:31 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <37944eff-6e00-df14-59d3-beae3fa89b6a@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 048CF8021C 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.979,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: Wed, 24 Jul 2019 22:17:33 -0000 On 25/07/19 00:14, Guido Falsi wrote: > On 19/07/19 17:11, Emmanuel Vadot wrote: >> 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 >> > > Hello, > > I don't know the actual workings of this file and have not checked it in > depth, but this change is causing "make package" to not package > /etc/rc.d/sshd (and others, all the ones being defined in > ${group}PACKAGE variables), which are then missing when upgrading machines. > > Reverting this change makes packaging things work again. I think this > change is actually wrong and the previous version was correct. > After sending this message I also noticed, it causes the spurious "FreeBSD-zfs" package to be generated again. -- Guido Falsi From owner-svn-src-all@freebsd.org Wed Jul 24 22:50: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 CA481BB77C; Wed, 24 Jul 2019 22:50: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 AD2D1819C3; Wed, 24 Jul 2019 22:50:45 +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 84B781D7A3; Wed, 24 Jul 2019 22:50:45 +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 x6OMojud029435; Wed, 24 Jul 2019 22:50:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OMoidw029429; Wed, 24 Jul 2019 22:50:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907242250.x6OMoidw029429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 24 Jul 2019 22:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350307 - in head: . lib/libcasper/libcasper lib/libcasper/services lib/libcasper/services/cap_random share/mk sys/sys targets/pseudo/userland/lib X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: . lib/libcasper/libcasper lib/libcasper/services lib/libcasper/services/cap_random share/mk sys/sys targets/pseudo/userland/lib X-SVN-Commit-Revision: 350307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AD2D1819C3 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.959,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, 24 Jul 2019 22:50:45 -0000 Author: markj Date: Wed Jul 24 22:50:43 2019 New Revision: 350307 URL: https://svnweb.freebsd.org/changeset/base/350307 Log: Remove cap_random(3). Now that we have a way to obtain entropy in capability mode (getrandom(2)), libcap_random is obsolete. Remove it. Bump __FreeBSD_version in case anything happens to use it, though I've found no consumers. Reviewed by: delphij, emaste, oshogbo Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21033 Deleted: head/lib/libcasper/services/cap_random/ Modified: head/ObsoleteFiles.inc head/lib/libcasper/libcasper/libcasper.3 head/lib/libcasper/services/Makefile head/share/mk/src.libnames.mk head/sys/sys/param.h head/targets/pseudo/userland/lib/Makefile.depend Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jul 24 21:43:41 2019 (r350306) +++ head/ObsoleteFiles.inc Wed Jul 24 22:50:43 2019 (r350307) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20190722: cap_random(3) removed +OLD_FILES+=lib/casper/libcap_random.so.1 +OLD_FILES+=usr/include/casper/cap_random.h +OLD_FILES+=usr/share/man/man3/cap_random.3.gz +OLD_FILES+=usr/share/man/man3/cap_random_buf.3.gz # 20190708: vm_page_hold() and _unhold() removed OLD_FILES+=usr/share/man/man9/vm_page_hold.9.gz # 20190618: sys/capability.h removed (sys/capsicum.h is the one to use) Modified: head/lib/libcasper/libcasper/libcasper.3 ============================================================================== --- head/lib/libcasper/libcasper/libcasper.3 Wed Jul 24 21:43:41 2019 (r350306) +++ head/lib/libcasper/libcasper/libcasper.3 Wed Jul 24 22:50:43 2019 (r350307) @@ -264,7 +264,6 @@ functions always succeed. .Xr cap_dns 3 , .Xr cap_grp 3 , .Xr cap_pwd 3 , -.Xr cap_random 3 , .Xr cap_sysctl 3 , .Xr cap_syslog 3 , .Xr libcasper_service 3 , Modified: head/lib/libcasper/services/Makefile ============================================================================== --- head/lib/libcasper/services/Makefile Wed Jul 24 21:43:41 2019 (r350306) +++ head/lib/libcasper/services/Makefile Wed Jul 24 22:50:43 2019 (r350307) @@ -6,7 +6,6 @@ SUBDIR= cap_dns SUBDIR+= cap_fileargs SUBDIR+= cap_grp SUBDIR+= cap_pwd -SUBDIR+= cap_random SUBDIR+= cap_sysctl SUBDIR+= cap_syslog Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Wed Jul 24 21:43:41 2019 (r350306) +++ head/share/mk/src.libnames.mk Wed Jul 24 22:50:43 2019 (r350307) @@ -82,7 +82,6 @@ _LIBRARIES= \ cap_fileargs \ cap_grp \ cap_pwd \ - cap_random \ cap_sysctl \ cap_syslog \ com_err \ @@ -260,7 +259,6 @@ _DP_cap_dns= nv _DP_cap_fileargs= nv _DP_cap_grp= nv _DP_cap_pwd= nv -_DP_cap_random= nv _DP_cap_sysctl= nv _DP_cap_syslog= nv .if ${MK_OFED} != "no" @@ -599,7 +597,6 @@ LIBCASPERDIR= ${OBJTOP}/lib/libcasper/libcasper LIBCAP_DNSDIR= ${OBJTOP}/lib/libcasper/services/cap_dns LIBCAP_GRPDIR= ${OBJTOP}/lib/libcasper/services/cap_grp LIBCAP_PWDDIR= ${OBJTOP}/lib/libcasper/services/cap_pwd -LIBCAP_RANDOMDIR= ${OBJTOP}/lib/libcasper/services/cap_random LIBCAP_SYSCTLDIR= ${OBJTOP}/lib/libcasper/services/cap_sysctl LIBCAP_SYSLOGDIR= ${OBJTOP}/lib/libcasper/services/cap_syslog LIBBSDXMLDIR= ${OBJTOP}/lib/libexpat Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Jul 24 21:43:41 2019 (r350306) +++ head/sys/sys/param.h Wed Jul 24 22:50:43 2019 (r350307) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300036 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300037 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/targets/pseudo/userland/lib/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/lib/Makefile.depend Wed Jul 24 21:43:41 2019 (r350306) +++ head/targets/pseudo/userland/lib/Makefile.depend Wed Jul 24 22:50:43 2019 (r350307) @@ -221,7 +221,6 @@ DIRDEPS+= \ lib/libcasper/services/cap_dns \ lib/libcasper/services/cap_grp \ lib/libcasper/services/cap_pwd \ - lib/libcasper/services/cap_random \ lib/libcasper/services/cap_sysctl \ .endif From owner-svn-src-all@freebsd.org Wed Jul 24 22:57: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 94964BBA3E; Wed, 24 Jul 2019 22:57:18 +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 75B83821E7; Wed, 24 Jul 2019 22:57:18 +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 4656D1D985; Wed, 24 Jul 2019 22:57:18 +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 x6OMvI16033548; Wed, 24 Jul 2019 22:57:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6OMvIve033547; Wed, 24 Jul 2019 22:57:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907242257.x6OMvIve033547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 24 Jul 2019 22:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350308 - head X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 75B83821E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 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.89)[-0.895,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, 24 Jul 2019 22:57:18 -0000 Author: markj Date: Wed Jul 24 22:57:17 2019 New Revision: 350308 URL: https://svnweb.freebsd.org/changeset/base/350308 Log: Document r350307. Sponsored by: The FreeBSD Foundation Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Wed Jul 24 22:50:43 2019 (r350307) +++ head/RELNOTES Wed Jul 24 22:57:17 2019 (r350308) @@ -10,6 +10,10 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r350307: + libcap_random(3) has been removed. Applications can use native + APIs to get random data in capability mode. + r349352: nand(4) and related components have been removed. From owner-svn-src-all@freebsd.org Wed Jul 24 23:04: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 55014BBC87; Wed, 24 Jul 2019 23:04:27 +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 3564A82776; Wed, 24 Jul 2019 23: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 103821DB44; Wed, 24 Jul 2019 23: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 x6ON4QnW039733; Wed, 24 Jul 2019 23:04:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6ON4Q3d039732; Wed, 24 Jul 2019 23:04:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907242304.x6ON4Q3d039732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 24 Jul 2019 23:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350309 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 350309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3564A82776 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 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.89)[-0.895,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, 24 Jul 2019 23:04:27 -0000 Author: imp Date: Wed Jul 24 23:04:26 2019 New Revision: 350309 URL: https://svnweb.freebsd.org/changeset/base/350309 Log: Fix several related coverity issues: Make sure to always free shortopts and lopts when returning. Fix minor logic bug to guard against NULLs properly. CID: 1403654, 1403656, 1403658 Modified: head/sbin/nvmecontrol/comnd.c head/sbin/nvmecontrol/logpage.c Modified: head/sbin/nvmecontrol/comnd.c ============================================================================== --- head/sbin/nvmecontrol/comnd.c Wed Jul 24 22:57:17 2019 (r350308) +++ head/sbin/nvmecontrol/comnd.c Wed Jul 24 23:04:26 2019 (r350309) @@ -155,7 +155,7 @@ find_long(struct option *lopts, int ch) for (i = 0; lopts[i].val != ch && lopts[i].name != NULL; i++) continue; - return i; + return (i); } int @@ -251,6 +251,8 @@ arg_parse(int argc, char * const * argv, const struct if (optind >= argc) { fprintf(stderr, "Missing arg %s\n", args->descr); arg_help(argc, argv, f); + free(lopts); + free(shortopts); return (1); } *(char **)args->ptr = argv[optind++]; @@ -258,10 +260,12 @@ arg_parse(int argc, char * const * argv, const struct } } free(lopts); + free(shortopts); return (0); bad_arg: fprintf(stderr, "Bad value to --%s: %s\n", opts[idx].long_arg, optarg); free(lopts); + free(shortopts); exit(1); } Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Wed Jul 24 22:57:17 2019 (r350308) +++ head/sbin/nvmecontrol/logpage.c Wed Jul 24 23:04:26 2019 (r350309) @@ -465,7 +465,7 @@ logpage(const struct cmd *f, int argc, char *argv[]) * unless the vendors match. */ SLIST_FOREACH(lpf, &logpages, link) { - if (lpf->vendor != NULL && vendor != NULL && + if (lpf->vendor == NULL || vendor == NULL || strcmp(lpf->vendor, vendor) != 0) continue; if (opt.page != lpf->log_page) From owner-svn-src-all@freebsd.org Wed Jul 24 23:05: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 44CC5BBCED; Wed, 24 Jul 2019 23:05: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 24786828DA; Wed, 24 Jul 2019 23:05: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 F377A1DB45; Wed, 24 Jul 2019 23:04:59 +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 x6ON4xf7039801; Wed, 24 Jul 2019 23:04:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6ON4xX1039797; Wed, 24 Jul 2019 23:04:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907242304.x6ON4xX1039797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 24 Jul 2019 23:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350310 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 350310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 24786828DA 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.947,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, 24 Jul 2019 23:05:00 -0000 Author: markj Date: Wed Jul 24 23:04:59 2019 New Revision: 350310 URL: https://svnweb.freebsd.org/changeset/base/350310 Log: Fix the turnstile_lock() KPI. turnstile_{lock,unlock}() were added for use in epoch. turnstile_lock() returned NULL to indicate that the calling thread had lost a race and the turnstile was no longer associated with the given lock, or the lock owner. However, reader-writer locks may not have a designated owner, in which case turnstile_lock() would return NULL and epoch_block_handler_preempt() would leak spinlocks as a result. Apply a minimal fix: return the lock owner as a separate return value. Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21048 Modified: head/sys/kern/subr_epoch.c head/sys/kern/subr_turnstile.c head/sys/sys/turnstile.h Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Wed Jul 24 23:04:26 2019 (r350309) +++ head/sys/kern/subr_epoch.c Wed Jul 24 23:04:59 2019 (r350310) @@ -438,26 +438,20 @@ epoch_block_handler_preempt(struct ck_epoch *global __ */ critical_enter(); thread_unlock(td); - owner = turnstile_lock(ts, &lock); - /* - * The owner pointer indicates that the lock succeeded. - * Only in case we hold the lock and the turnstile we - * locked is still the one that curwaittd is blocked on - * can we continue. Otherwise the turnstile pointer has - * been changed out from underneath us, as in the case - * where the lock holder has signalled curwaittd, - * and we need to continue. - */ - if (owner != NULL && ts == curwaittd->td_blocked) { - MPASS(TD_IS_INHIBITED(curwaittd) && - TD_ON_LOCK(curwaittd)); - critical_exit(); - turnstile_wait(ts, owner, curwaittd->td_tsqueue); - counter_u64_add(turnstile_count, 1); - thread_lock(td); - return; - } else if (owner != NULL) + + if (turnstile_lock(ts, &lock, &owner)) { + if (ts == curwaittd->td_blocked) { + MPASS(TD_IS_INHIBITED(curwaittd) && + TD_ON_LOCK(curwaittd)); + critical_exit(); + turnstile_wait(ts, owner, + curwaittd->td_tsqueue); + counter_u64_add(turnstile_count, 1); + thread_lock(td); + return; + } turnstile_unlock(ts, lock); + } thread_lock(td); critical_exit(); KASSERT(td->td_locks == locksheld, Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Wed Jul 24 23:04:26 2019 (r350309) +++ head/sys/kern/subr_turnstile.c Wed Jul 24 23:04:59 2019 (r350310) @@ -566,24 +566,26 @@ turnstile_trywait(struct lock_object *lock) return (ts); } -struct thread * -turnstile_lock(struct turnstile *ts, struct lock_object **lockp) +bool +turnstile_lock(struct turnstile *ts, struct lock_object **lockp, + struct thread **tdp) { struct turnstile_chain *tc; struct lock_object *lock; if ((lock = ts->ts_lockobj) == NULL) - return (NULL); + return (false); tc = TC_LOOKUP(lock); mtx_lock_spin(&tc->tc_lock); mtx_lock_spin(&ts->ts_lock); if (__predict_false(lock != ts->ts_lockobj)) { mtx_unlock_spin(&tc->tc_lock); mtx_unlock_spin(&ts->ts_lock); - return (NULL); + return (false); } *lockp = lock; - return (ts->ts_owner); + *tdp = ts->ts_owner; + return (true); } void Modified: head/sys/sys/turnstile.h ============================================================================== --- head/sys/sys/turnstile.h Wed Jul 24 23:04:26 2019 (r350309) +++ head/sys/sys/turnstile.h Wed Jul 24 23:04:59 2019 (r350310) @@ -99,7 +99,8 @@ int turnstile_signal(struct turnstile *, int); struct turnstile *turnstile_trywait(struct lock_object *); void turnstile_unpend(struct turnstile *); void turnstile_wait(struct turnstile *, struct thread *, int); -struct thread *turnstile_lock(struct turnstile *, struct lock_object **); +bool turnstile_lock(struct turnstile *, struct lock_object **, + struct thread **); void turnstile_unlock(struct turnstile *, struct lock_object *); void turnstile_assert(struct turnstile *); #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Wed Jul 24 23:08: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 32F31BBDAD; Wed, 24 Jul 2019 23:08:50 +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 13BA382B06; Wed, 24 Jul 2019 23:08:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 017DD1DB4A; Wed, 24 Jul 2019 23:08:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6ON8nPd040029; Wed, 24 Jul 2019 23:08:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6ON8nRg040028; Wed, 24 Jul 2019 23:08:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907242308.x6ON8nRg040028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 24 Jul 2019 23:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350311 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 350311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 13BA382B06 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.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: Wed, 24 Jul 2019 23:08:50 -0000 Author: imp Date: Wed Jul 24 23:08:49 2019 New Revision: 350311 URL: https://svnweb.freebsd.org/changeset/base/350311 Log: Fix the fix to the logic bug. Upon further testing, the bug is that we shadoow opt.vendor with vendor. We shouldn't. Delete the latter and use the former everywhere and restore the prior logic which is now correct. Modified: head/sbin/nvmecontrol/logpage.c Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Wed Jul 24 23:04:59 2019 (r350310) +++ head/sbin/nvmecontrol/logpage.c Wed Jul 24 23:08:49 2019 (r350311) @@ -403,7 +403,6 @@ logpage(const struct cmd *f, int argc, char *argv[]) char cname[64]; uint32_t nsid, size; void *buf; - const char *vendor = NULL; const struct logpage_function *lpf; struct nvme_controller_data cdata; print_fn_t print_fn; @@ -465,8 +464,8 @@ logpage(const struct cmd *f, int argc, char *argv[]) * unless the vendors match. */ SLIST_FOREACH(lpf, &logpages, link) { - if (lpf->vendor == NULL || vendor == NULL || - strcmp(lpf->vendor, vendor) != 0) + if (lpf->vendor != NULL && opt.vendor != NULL && + strcmp(lpf->vendor, opt.vendor) != 0) continue; if (opt.page != lpf->log_page) continue; From owner-svn-src-all@freebsd.org Thu Jul 25 00:07: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 F36D5BD6FE; Thu, 25 Jul 2019 00:07:10 +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 ABA1084FC7; Thu, 25 Jul 2019 00:07:10 +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 81AD61E604; Thu, 25 Jul 2019 00:07:10 +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 x6P07ASc074877; Thu, 25 Jul 2019 00:07:10 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6P07Aub074876; Thu, 25 Jul 2019 00:07:10 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201907250007.x6P07Aub074876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 25 Jul 2019 00:07: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: r350312 - stable/12/stand/common X-SVN-Group: stable-12 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: stable/12/stand/common X-SVN-Commit-Revision: 350312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ABA1084FC7 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: Thu, 25 Jul 2019 00:07:11 -0000 Author: sjg Date: Thu Jul 25 00:07:10 2019 New Revision: 350312 URL: https://svnweb.freebsd.org/changeset/base/350312 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. MFC of r350099 Reviewed by: stevek Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org//D20909 Modified: stable/12/stand/common/commands.c Modified: stable/12/stand/common/commands.c ============================================================================== --- stable/12/stand/common/commands.c Wed Jul 24 23:08:49 2019 (r350311) +++ stable/12/stand/common/commands.c Thu Jul 25 00:07:10 2019 (r350312) @@ -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 Thu Jul 25 01:57: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 0EB1BBFCF2; Thu, 25 Jul 2019 01:57:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) (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 ECAED88DDA; Thu, 25 Jul 2019 01:56:57 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f67.google.com with SMTP id i10so93763576iol.13; Wed, 24 Jul 2019 18:56:57 -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=mYhSleMh0kX4qcI4pHUXwHl0jbw4yu48cFnyNukh5Jo=; b=qy+3QFr2Tvbomx7iVQabDiaGVo8rmzV0q3at+hs0Pz6sZYL+U9bi7xLVbmsN459g/c l0MxG0NNsDXBi2//rkztJj6B2LuC9Y+qT8JPykIEhYVGKHnPK0IHxNEEDvj89KEET1Zm Y2rFAYL2CNZuPcK2+OX14NmNCZmJ4LdldyrB/DP5Mx8hmc/qyWl2t7/cXyrTNE0U3kmM n+uY+o1Espgusl8BKH2FvPlxk9JFF44vvXcvJ+ZoNqA0PuEJddWaoN+EA/4s1zfiib1A FoOEb6E7lIzfWARdL9VzH4EA9lm6waKPlCoqn+O3o7JuSbkeMAg2URL7BVdOQHdfCTlC SGfQ== X-Gm-Message-State: APjAAAVMgjj/QNs6We5PpvTRyWh9WMeQDvQdjdNjCGRK0+it6WBvbYkT LiZPLI9egEy2+BKDZq/aTKyKfEbO X-Google-Smtp-Source: APXvYqy3qZGqJ4XC0DckebikwJM1C7f4eaXF9U11FyTY5Gsp1+vFg0y4IqzV5XGYAI3jjUiTuAG2rw== X-Received: by 2002:a02:c550:: with SMTP id g16mr86349353jaj.49.1564019466723; Wed, 24 Jul 2019 18:51:06 -0700 (PDT) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com. [209.85.166.47]) by smtp.gmail.com with ESMTPSA id u17sm45264149iob.57.2019.07.24.18.51.05 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jul 2019 18:51:06 -0700 (PDT) Received: by mail-io1-f47.google.com with SMTP id j6so18655940ioa.5; Wed, 24 Jul 2019 18:51:05 -0700 (PDT) X-Received: by 2002:a02:6d24:: with SMTP id m36mr89865171jac.87.1564019465491; Wed, 24 Jul 2019 18:51:05 -0700 (PDT) MIME-Version: 1.0 References: <201907101742.x6AHg4os016752@repo.freebsd.org> In-Reply-To: <201907101742.x6AHg4os016752@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 24 Jul 2019 18:50:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r349890 - head/contrib/telnet/telnet To: Philip Paeps Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: ECAED88DDA X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.67 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-4.33 / 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.74)[-0.737,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; 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)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; 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]; DMARC_NA(0.00)[freebsd.org]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[67.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.59)[ip: (-2.01), ipnet: 209.85.128.0/17(-3.44), asn: 15169(-2.43), country: US(-0.05)] 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, 25 Jul 2019 01:57:00 -0000 Hi Philip, Sorry I'm late to the party. Unless I am mistaken, most of these are *not* overflows or vulnerabilities of any sort. On Wed, Jul 10, 2019 at 10:42 AM Philip Paeps wrote: > > Author: philip > Date: Wed Jul 10 17:42:04 2019 > New Revision: 349890 > URL: https://svnweb.freebsd.org/changeset/base/349890 > > Log: > telnet: fix a couple of snprintf() buffer overflows >... > --- head/contrib/telnet/telnet/commands.c Wed Jul 10 17:21:59 2019 (r349889) > +++ head/contrib/telnet/telnet/commands.c Wed Jul 10 17:42:04 2019 (r349890) > @@ -1655,10 +1655,11 @@ env_init(void) > char hbuf[256+1]; > char *cp2 = strchr((char *)ep->value, ':'); > > - 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'; > + unsigned int buflen = strlen(hbuf) + strlen(cp2) + 1; > + cp = (char *)malloc(sizeof(char)*buflen); > + snprintf((char *)cp, buflen, "%s%s", hbuf, cp2); This patch makes no functional change, except gethostname()'s 2nd parameter is now 257 instead of 256. It was not an overflow before and the formatted malloc contents are identical. > Modified: head/contrib/telnet/telnet/telnet.c > ============================================================================== > --- head/contrib/telnet/telnet/telnet.c Wed Jul 10 17:21:59 2019 (r349889) > +++ head/contrib/telnet/telnet/telnet.c Wed Jul 10 17:42:04 2019 (r349890) > @@ -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); This one actually overflowed before. But the new behavior isn't much better. Truncating the formatted string arbitrarily is still wrong; it would be better to errx() or assert() or abort(). > @@ -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 ... */ Unless I'm miscounting, this could not overflow (on any FreeBSD system with 64-bit or smaller long)... > Modified: head/contrib/telnet/telnet/utilities.c > ============================================================================== > --- head/contrib/telnet/telnet/utilities.c Wed Jul 10 17:21:59 2019 (r349889) > +++ head/contrib/telnet/telnet/utilities.c Wed Jul 10 17:42:04 2019 (r349890) > @@ -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" : "", This one could not overflow before either. I think most of this change is an unnecessary regression, and the actual overflow should be fixed in a better way anyway. Thanks, Conrad From owner-svn-src-all@freebsd.org Thu Jul 25 02:03: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 B77CCC001F; Thu, 25 Jul 2019 02:03:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 65B008933A; Thu, 25 Jul 2019 02:03:20 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id qT6Dh4RqoSrVcqT6Eh8fyM; Wed, 24 Jul 2019 20:03:18 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=0o9FgrsRnhwA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=syWdyGADkbmwRjC54sMA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 8BD4E21C; Wed, 24 Jul 2019 19:03:16 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x6P23G2K076821; Wed, 24 Jul 2019 19:03:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x6P23GeQ076818; Wed, 24 Jul 2019 19:03:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201907250203.x6P23GeQ076818@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ed Maste cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350301 - head/lib/libsysdecode In-reply-to: <201907242106.x6OL6KaM068071@repo.freebsd.org> References: <201907242106.x6OL6KaM068071@repo.freebsd.org> Comments: In-reply-to Ed Maste message dated "Wed, 24 Jul 2019 21:06:20 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 24 Jul 2019 19:03:16 -0700 X-CMAE-Envelope: MS4wfIWkKP+oCORx6rJ2Kf9lt8Qc+4lSdlEtOSa0q6ncpWCarnvkwVfxLoSa7vqT3Y7ooVEZkxjauKYkgDujozD0D0I8qoR6JQhnBjvvBduaggnBNkQACwaU 7DvwmjqcsAAEbU2Fnhnv7Ba4rVOOAArcrZm9QbeusNXy3GvpcUXPsH9KjagmhvE9mvVh5nNauq2lm+Ozhe6BIfQbkfHjWDqIsGDgyO1uG4k6nBXxoYBnsKgv mf6WAMQKOE6KPykOHaHmLE1fn7xdYO4K1qTTCXf01cycp6jUL/eTXmzTPNL003fW X-Rspamd-Queue-Id: 65B008933A X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.92 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; IP_SCORE(-2.44)[ip: (-6.42), ipnet: 64.59.128.0/20(-3.21), asn: 6327(-2.50), country: CA(-0.09)]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.87)[-0.867,0]; RCVD_IN_DNSWL_NONE(0.00)[138.136.59.64.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11] 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, 25 Jul 2019 02:03:21 -0000 In message <201907242106.x6OL6KaM068071@repo.freebsd.org>, Ed Maste writes: > Author: emaste > Date: Wed Jul 24 21:06:19 2019 > New Revision: 350301 > URL: https://svnweb.freebsd.org/changeset/base/350301 > > Log: > libsysdecode: add explicit dependencies on recently changed headers > > r349369 removed IP_MIN_MEMBERSHIPS and IPV6_MIN_MEMBERSHIPS, and r349893 > removed TCP_RACK_SESS_CWV. libsysdecode lacked dependencies to trigger a > rebuild of tables.h. > > Add explicit dependencies as a workaround to address these specific > cases; a holistic solution is still needed. > > Sponsored by: The FreeBSD Foundation > > Modified: > head/lib/libsysdecode/Makefile > > Modified: head/lib/libsysdecode/Makefile > ============================================================================= > = > --- head/lib/libsysdecode/Makefile Wed Jul 24 20:17:39 2019 (r35030 > 0) > +++ head/lib/libsysdecode/Makefile Wed Jul 24 21:06:19 2019 (r35030 > 1) > @@ -123,7 +123,8 @@ CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls > CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} > > DEPENDOBJS+= tables.h > -tables.h: mktables > +tables.h: mktables ${SYSROOT}/sys/netinet/in.h ${SYSROOT}/sys/netinet/tcp.h > \ > + ${SYSROOT}/sys/netinet6/in6.h > sh ${.CURDIR}/mktables ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} ${.TARGET}.t > mp && \ > mv -f ${.TARGET}.tmp ${.TARGET} > > Hi Ed, This breaks 32-bit compatibility builds on amd64. --- all_subdir_lib/libsysdecode --- ===> lib/libsysdecode (all) make[5]: make[5]: don't know how to make /export/obj/opt/src/svn-current /amd64.amd64/obj-lib32/tmp/sys/netinet/in.h. Stop make[5]: stopped in /opt/src/svn-current/lib/libsysdecode -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Thu Jul 25 03:47: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 523D1C1C4A; Thu, 25 Jul 2019 03:47:29 +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 0CF598CA17; Thu, 25 Jul 2019 03:47:29 +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 96A5F20DDB; Thu, 25 Jul 2019 03:47: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 x6P3lSUZ006283; Thu, 25 Jul 2019 03:47:28 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6P3lRpT006278; Thu, 25 Jul 2019 03:47:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907250347.x6P3lRpT006278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 25 Jul 2019 03:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350313 - in head/sys: conf powerpc/aim powerpc/ps3 powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf powerpc/aim powerpc/ps3 powerpc/pseries X-SVN-Commit-Revision: 350313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CF598CA17 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.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: Thu, 25 Jul 2019 03:47:29 -0000 Author: jhibbits Date: Thu Jul 25 03:47:27 2019 New Revision: 350313 URL: https://svnweb.freebsd.org/changeset/base/350313 Log: powerpc/pmap64: Make moea64 statistics optional Summary: It turns out statistics accounting is very expensive in the pmap driver, and doesn't seem necessary in the common case. Make this optional behind a MOEA64_STATS #define, which one can set if they really need statistics. This saves ~7-8% on buildworld time on a POWER9. Found by bdragon. Reviewed by: luporl Differential Revision: https://reviews.freebsd.org/D20903 Modified: head/sys/conf/options.powerpc head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/mmu_oea64.h head/sys/powerpc/aim/moea64_native.c head/sys/powerpc/ps3/mmu_ps3.c head/sys/powerpc/pseries/mmu_phyp.c Modified: head/sys/conf/options.powerpc ============================================================================== --- head/sys/conf/options.powerpc Thu Jul 25 00:07:10 2019 (r350312) +++ head/sys/conf/options.powerpc Thu Jul 25 03:47:27 2019 (r350313) @@ -19,6 +19,7 @@ GFB_DEBUG opt_gfb.h GFB_NO_FONT_LOADING opt_gfb.h GFB_NO_MODE_CHANGE opt_gfb.h +MOEA64_STATS opt_pmap.h MPC85XX opt_platform.h POWERMAC opt_platform.h PS3 opt_platform.h Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Jul 25 00:07:10 2019 (r350312) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Jul 25 03:47:27 2019 (r350313) @@ -200,6 +200,7 @@ static u_int moea64_vsid_bitmap[NVSIDS / VSID_NBPW]; static boolean_t moea64_initialized = FALSE; +#ifdef MOEA64_STATS /* * Statistics. */ @@ -218,6 +219,7 @@ SYSCTL_INT(_machdep, OID_AUTO, moea64_pvo_enter_calls, &moea64_pvo_enter_calls, 0, ""); SYSCTL_INT(_machdep, OID_AUTO, moea64_pvo_remove_calls, CTLFLAG_RD, &moea64_pvo_remove_calls, 0, ""); +#endif vm_offset_t moea64_scratchpage_va[2]; struct pvo_entry *moea64_scratchpage_pvo[2]; @@ -1434,7 +1436,7 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, v /* If not in page table, reinsert it */ if (MOEA64_PTE_SYNCH(mmu, oldpvo) < 0) { - moea64_pte_overflow--; + STAT_MOEA64(moea64_pte_overflow--); MOEA64_PTE_INSERT(mmu, oldpvo); } @@ -2522,7 +2524,7 @@ moea64_pvo_enter(mmu_t mmu, struct pvo_entry *pvo, str PMAP_LOCK_ASSERT(pvo->pvo_pmap, MA_OWNED); - moea64_pvo_enter_calls++; + STAT_MOEA64(moea64_pvo_enter_calls++); /* * Add to pmap list @@ -2557,7 +2559,7 @@ moea64_pvo_enter(mmu_t mmu, struct pvo_entry *pvo, str panic("moea64_pvo_enter: overflow"); } - moea64_pvo_entries++; + STAT_MOEA64(moea64_pvo_entries++); if (pvo->pvo_pmap == kernel_pmap) isync(); @@ -2656,8 +2658,8 @@ moea64_pvo_remove_from_page_locked(mmu_t mmu, struct p } } - moea64_pvo_entries--; - moea64_pvo_remove_calls++; + STAT_MOEA64(moea64_pvo_entries--); + STAT_MOEA64(moea64_pvo_remove_calls++); } static void Modified: head/sys/powerpc/aim/mmu_oea64.h ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.h Thu Jul 25 00:07:10 2019 (r350312) +++ head/sys/powerpc/aim/mmu_oea64.h Thu Jul 25 03:47:27 2019 (r350313) @@ -30,6 +30,8 @@ #ifndef _POWERPC_AIM_MMU_OEA64_H #define _POWERPC_AIM_MMU_OEA64_H +#include "opt_pmap.h" + #include extern mmu_def_t oea64_mmu; @@ -72,8 +74,13 @@ void moea64_late_bootstrap(mmu_t mmup, vm_offset_t ke * Statistics */ +#ifdef MOEA64_STATS extern u_int moea64_pte_valid; extern u_int moea64_pte_overflow; +#define STAT_MOEA64(x) x +#else +#define STAT_MOEA64(x) ((void)0) +#endif /* * State variables Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Thu Jul 25 00:07:10 2019 (r350312) +++ head/sys/powerpc/aim/moea64_native.c Thu Jul 25 03:47:27 2019 (r350313) @@ -332,7 +332,7 @@ moea64_pte_unset_native(mmu_t mmu, struct pvo_entry *p if ((be64toh(pt->pte_hi & LPTE_AVPN_MASK)) != (properpt.pte_hi & LPTE_AVPN_MASK)) { /* Evicted */ - moea64_pte_overflow--; + STAT_MOEA64(moea64_pte_overflow--); rw_runlock(&moea64_eviction_lock); return (-1); } @@ -352,7 +352,7 @@ moea64_pte_unset_native(mmu_t mmu, struct pvo_entry *p rw_runlock(&moea64_eviction_lock); /* Keep statistics */ - moea64_pte_valid--; + STAT_MOEA64(moea64_pte_valid--); return (ptelo & (LPTE_CHG | LPTE_REF)); } @@ -656,8 +656,8 @@ moea64_insert_to_pteg_native(struct lpte *pvo_pt, uint (ADDR_API_SHFT64 - ADDR_PIDX_SHFT); PTESYNC(); TLBIE(va); - moea64_pte_valid--; - moea64_pte_overflow++; + STAT_MOEA64(moea64_pte_valid--); + STAT_MOEA64(moea64_pte_overflow++); } /* @@ -670,7 +670,7 @@ moea64_insert_to_pteg_native(struct lpte *pvo_pt, uint PTESYNC(); /* Keep statistics */ - moea64_pte_valid++; + STAT_MOEA64(moea64_pte_valid++); return (k); } Modified: head/sys/powerpc/ps3/mmu_ps3.c ============================================================================== --- head/sys/powerpc/ps3/mmu_ps3.c Thu Jul 25 00:07:10 2019 (r350312) +++ head/sys/powerpc/ps3/mmu_ps3.c Thu Jul 25 03:47:27 2019 (r350313) @@ -224,14 +224,14 @@ mps3_pte_unset(mmu_t mmu, struct pvo_entry *pvo) mtx_lock(&mps3_table_lock); refchg = mps3_pte_synch_locked(pvo); if (refchg < 0) { - moea64_pte_overflow--; + STAT_MOEA64(moea64_pte_overflow--); mtx_unlock(&mps3_table_lock); return (-1); } /* XXX: race on RC bits between unset and sync. Anything to do? */ lv1_write_htab_entry(mps3_vas_id, pvo->pvo_pte.slot, 0, 0); mtx_unlock(&mps3_table_lock); - moea64_pte_valid--; + STAT_MOEA64(moea64_pte_valid--); return (refchg & (LPTE_REF | LPTE_CHG)); } @@ -272,13 +272,13 @@ mps3_pte_insert(mmu_t mmu, struct pvo_entry *pvo) pvo->pvo_vaddr |= PVO_HID; pvo->pvo_pte.slot = index; - moea64_pte_valid++; + STAT_MOEA64(moea64_pte_valid++); if (evicted.pte_hi) { KASSERT((evicted.pte_hi & (LPTE_WIRED | LPTE_LOCKED)) == 0, ("Evicted a wired PTE")); - moea64_pte_valid--; - moea64_pte_overflow++; + STAT_MOEA64(moea64_pte_valid--); + STAT_MOEA64(moea64_pte_overflow++); } return (0); Modified: head/sys/powerpc/pseries/mmu_phyp.c ============================================================================== --- head/sys/powerpc/pseries/mmu_phyp.c Thu Jul 25 00:07:10 2019 (r350312) +++ head/sys/powerpc/pseries/mmu_phyp.c Thu Jul 25 03:47:27 2019 (r350313) @@ -364,7 +364,7 @@ mphyp_pte_unset(mmu_t mmu, struct pvo_entry *pvo) ("Error removing page: %d", err)); if (err == H_NOT_FOUND) { - moea64_pte_overflow--; + STAT_MOEA64(moea64_pte_overflow--); return (-1); } @@ -485,7 +485,7 @@ mphyp_pte_insert(mmu_t mmu, struct pvo_entry *pvo) result = phyp_pft_hcall(H_REMOVE, H_AVPN, index, evicted.pte_hi & LPTE_AVPN_MASK, 0, &junk, &lastptelo, &junk); - moea64_pte_overflow++; + STAT_MOEA64(moea64_pte_overflow++); KASSERT(result == H_SUCCESS || result == H_NOT_FOUND, ("Error evicting page: %d", (int)result)); } From owner-svn-src-all@freebsd.org Thu Jul 25 03:55: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 120AEC1E1D; Thu, 25 Jul 2019 03:55:06 +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 E766C8CEE7; Thu, 25 Jul 2019 03:55:05 +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 B3F5720FB4; Thu, 25 Jul 2019 03:55:05 +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 x6P3t5dU012004; Thu, 25 Jul 2019 03:55:05 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6P3t55p012003; Thu, 25 Jul 2019 03:55:05 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201907250355.x6P3t55p012003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 25 Jul 2019 03:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350314 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 350314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E766C8CEE7 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.939,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, 25 Jul 2019 03:55:06 -0000 Author: asomers Date: Thu Jul 25 03:55:05 2019 New Revision: 350314 URL: https://svnweb.freebsd.org/changeset/base/350314 Log: special-case getvfsbyname(3) for fusefs(5) fusefs file systems may have a fsname subtype (set by mount_fusefs's "-o subtype" option) that gets appended to the fsname as returned by statfs(2). The subtype is set on a per-mount basis so it isn't part of the struct vfsconf. Special-case getvfsbyname to match either the full "fusefs.foobar" or short "fusefs" fsname. This is a merge of r348007, r348054, and r350093 from projects/fuse2 Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21043 Modified: head/lib/libc/gen/getvfsbyname.c Directory Properties: head/ (props changed) Modified: head/lib/libc/gen/getvfsbyname.c ============================================================================== --- head/lib/libc/gen/getvfsbyname.c Thu Jul 25 03:47:27 2019 (r350313) +++ head/lib/libc/gen/getvfsbyname.c Thu Jul 25 03:55:05 2019 (r350314) @@ -37,10 +37,26 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include /* + * fusefs(5) file systems may have a "subtype" which gets appended to + * statfs(2)'s f_fstypename field on a per-mount basis. Allow getvfsbyname to + * match either the full "fusefs.foobar" or the more general "fusefs". + */ +static bool +are_fusefs(const char *fsname, const char *vfc_name) +{ + const static char fusefs[] = "fusefs"; + const static char fusefs_dot[] = "fusefs."; + + return (strncmp(fsname, fusefs_dot, sizeof(fusefs_dot) - 1) == 0 && + strcmp(fusefs, vfc_name) == 0); +} + +/* * Given a filesystem name, determine if it is resident in the kernel, * and if it is resident, return its xvfsconf structure. */ @@ -62,7 +78,8 @@ getvfsbyname(const char *fsname, struct xvfsconf *vfcp } cnt = buflen / sizeof(struct xvfsconf); for (i = 0; i < cnt; i++) { - if (strcmp(fsname, xvfsp[i].vfc_name) == 0) { + if (strcmp(fsname, xvfsp[i].vfc_name) == 0 || + are_fusefs(fsname, xvfsp[i].vfc_name)) { memcpy(vfcp, xvfsp + i, sizeof(struct xvfsconf)); free(xvfsp); return (0); From owner-svn-src-all@freebsd.org Thu Jul 25 05:46: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 BEB1AC3443; Thu, 25 Jul 2019 05:46:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 AE13668582; Thu, 25 Jul 2019 05:46:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A38C22347; Thu, 25 Jul 2019 05:46:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6P5kIJK076763; Thu, 25 Jul 2019 05:46:18 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6P5kHWq076756; Thu, 25 Jul 2019 05:46:17 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201907250546.x6P5kHWq076756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 25 Jul 2019 05:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350315 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 350315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE13668582 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: Thu, 25 Jul 2019 05:46:18 -0000 Author: rmacklem Date: Thu Jul 25 05:46:16 2019 New Revision: 350315 URL: https://svnweb.freebsd.org/changeset/base/350315 Log: Add kernel support for a Linux compatible copy_file_range(2) syscall. This patch adds support to the kernel for a Linux compatible copy_file_range(2) syscall and the related VOP_COPY_FILE_RANGE(9). This syscall/VOP can be used by the NFSv4.2 client to implement the Copy operation against an NFSv4.2 server to do file copies locally on the server. The vn_generic_copy_file_range() function in this patch can be used by the NFSv4.2 server to implement the Copy operation. Fuse may also me able to use the VOP_COPY_FILE_RANGE() method. vn_generic_copy_file_range() attempts to maintain holes in the output file in the range to be copied, but may fail to do so if the input and output files are on different file systems with different _PC_MIN_HOLE_SIZE values. Separate commits will be done for the generated syscall files and userland changes. A commit for a compat32 syscall will be done later. Reviewed by: kib, asomers (plus comments by brooks, jilles) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D20584 Modified: head/sys/kern/syscalls.master head/sys/kern/vfs_default.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/kern/vnode_if.src head/sys/sys/syscallsubr.h head/sys/sys/vnode.h Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Jul 25 03:55:05 2019 (r350314) +++ head/sys/kern/syscalls.master Thu Jul 25 05:46:16 2019 (r350315) @@ -3175,6 +3175,16 @@ int flag ); } +569 AUE_NULL STD { + ssize_t copy_file_range( + int infd, + _Inout_opt_ off_t *inoffp, + int outfd, + _Inout_opt_ off_t *outoffp, + size_t len, + unsigned int flags + ); + } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Thu Jul 25 03:55:05 2019 (r350314) +++ head/sys/kern/vfs_default.c Thu Jul 25 05:46:16 2019 (r350315) @@ -83,6 +83,7 @@ static int dirent_exists(struct vnode *vp, const char static int vop_stdis_text(struct vop_is_text_args *ap); static int vop_stdunset_text(struct vop_unset_text_args *ap); static int vop_stdadd_writecount(struct vop_add_writecount_args *ap); +static int vop_stdcopy_file_range(struct vop_copy_file_range_args *ap); static int vop_stdfdatasync(struct vop_fdatasync_args *ap); static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); @@ -140,6 +141,7 @@ struct vop_vector default_vnodeops = { .vop_set_text = vop_stdset_text, .vop_unset_text = vop_stdunset_text, .vop_add_writecount = vop_stdadd_writecount, + .vop_copy_file_range = vop_stdcopy_file_range, }; /* @@ -1210,6 +1212,17 @@ vfs_stdnosync (mp, waitfor) { return (0); +} + +static int +vop_stdcopy_file_range(struct vop_copy_file_range_args *ap) +{ + int error; + + error = vn_generic_copy_file_range(ap->a_invp, ap->a_inoffp, + ap->a_outvp, ap->a_outoffp, ap->a_lenp, ap->a_flags, ap->a_incred, + ap->a_outcred, ap->a_fsizetd); + return (error); } int Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Jul 25 03:55:05 2019 (r350314) +++ head/sys/kern/vfs_syscalls.c Thu Jul 25 05:46:16 2019 (r350315) @@ -4814,3 +4814,122 @@ sys_posix_fadvise(struct thread *td, struct posix_fadv uap->advice); return (kern_posix_error(td, error)); } + +int +kern_copy_file_range(struct thread *td, int infd, off_t *inoffp, int outfd, + off_t *outoffp, size_t len, unsigned int flags) +{ + struct file *infp, *outfp; + struct vnode *invp, *outvp; + int error; + size_t retlen; + void *rl_rcookie, *rl_wcookie; + off_t savinoff, savoutoff; + + infp = outfp = NULL; + rl_rcookie = rl_wcookie = NULL; + savinoff = -1; + error = 0; + retlen = 0; + + if (flags != 0) { + error = EINVAL; + goto out; + } + if (len > SSIZE_MAX) + /* + * Although the len argument is size_t, the return argument + * is ssize_t (which is signed). Therefore a size that won't + * fit in ssize_t can't be returned. + */ + len = SSIZE_MAX; + + /* Get the file structures for the file descriptors. */ + error = fget_read(td, infd, &cap_read_rights, &infp); + if (error != 0) + goto out; + error = fget_write(td, outfd, &cap_write_rights, &outfp); + if (error != 0) + goto out; + + /* Set the offset pointers to the correct place. */ + if (inoffp == NULL) + inoffp = &infp->f_offset; + if (outoffp == NULL) + outoffp = &outfp->f_offset; + savinoff = *inoffp; + savoutoff = *outoffp; + + invp = infp->f_vnode; + outvp = outfp->f_vnode; + /* Sanity check the f_flag bits. */ + if ((outfp->f_flag & (FWRITE | FAPPEND)) != FWRITE || + (infp->f_flag & FREAD) == 0 || invp == outvp) { + error = EBADF; + goto out; + } + + /* If len == 0, just return 0. */ + if (len == 0) + goto out; + + /* Range lock the byte ranges for both invp and outvp. */ + for (;;) { + rl_wcookie = vn_rangelock_wlock(outvp, *outoffp, *outoffp + + len); + rl_rcookie = vn_rangelock_tryrlock(invp, *inoffp, *inoffp + + len); + if (rl_rcookie != NULL) + break; + vn_rangelock_unlock(outvp, rl_wcookie); + rl_rcookie = vn_rangelock_rlock(invp, *inoffp, *inoffp + len); + vn_rangelock_unlock(invp, rl_rcookie); + } + + retlen = len; + error = vn_copy_file_range(invp, inoffp, outvp, outoffp, &retlen, + flags, infp->f_cred, outfp->f_cred, td); +out: + if (rl_rcookie != NULL) + vn_rangelock_unlock(invp, rl_rcookie); + if (rl_wcookie != NULL) + vn_rangelock_unlock(outvp, rl_wcookie); + if (savinoff != -1 && (error == EINTR || error == ERESTART)) { + *inoffp = savinoff; + *outoffp = savoutoff; + } + if (outfp != NULL) + fdrop(outfp, td); + if (infp != NULL) + fdrop(infp, td); + td->td_retval[0] = retlen; + return (error); +} + +int +sys_copy_file_range(struct thread *td, struct copy_file_range_args *uap) +{ + off_t inoff, outoff, *inoffp, *outoffp; + int error; + + inoffp = outoffp = NULL; + if (uap->inoffp != NULL) { + error = copyin(uap->inoffp, &inoff, sizeof(off_t)); + if (error != 0) + return (error); + inoffp = &inoff; + } + if (uap->outoffp != NULL) { + error = copyin(uap->outoffp, &outoff, sizeof(off_t)); + if (error != 0) + return (error); + outoffp = &outoff; + } + error = kern_copy_file_range(td, uap->infd, inoffp, uap->outfd, + outoffp, uap->len, uap->flags); + if (error == 0 && uap->inoffp != NULL) + error = copyout(inoffp, uap->inoffp, sizeof(off_t)); + if (error == 0 && uap->outoffp != NULL) + error = copyout(outoffp, uap->outoffp, sizeof(off_t)); + return (error); +} Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Jul 25 03:55:05 2019 (r350314) +++ head/sys/kern/vfs_vnops.c Thu Jul 25 05:46:16 2019 (r350315) @@ -2619,3 +2619,372 @@ loop2: return (error); } + +/* + * Copies a byte range from invp to outvp. Calls VOP_COPY_FILE_RANGE() + * or vn_generic_copy_file_range() after rangelocking the byte ranges, + * to do the actual copy. + * vn_generic_copy_file_range() is factored out, so it can be called + * from a VOP_COPY_FILE_RANGE() call as well, but handles vnodes from + * different file systems. + */ +int +vn_copy_file_range(struct vnode *invp, off_t *inoffp, struct vnode *outvp, + off_t *outoffp, size_t *lenp, unsigned int flags, struct ucred *incred, + struct ucred *outcred, struct thread *fsize_td) +{ + struct vattr va; + int error; + size_t len; + uint64_t uvalin, uvalout; + + len = *lenp; + *lenp = 0; /* For error returns. */ + error = 0; + + /* Do some sanity checks on the arguments. */ + uvalin = *inoffp; + uvalin += len; + uvalout = *outoffp; + uvalout += len; + if (invp->v_type == VDIR || outvp->v_type == VDIR) + error = EISDIR; + else if (*inoffp < 0 || uvalin > INT64_MAX || uvalin < + (uint64_t)*inoffp || *outoffp < 0 || uvalout > INT64_MAX || + uvalout < (uint64_t)*outoffp || invp->v_type != VREG || + outvp->v_type != VREG) + error = EINVAL; + else if (invp == outvp) + error = EBADF; + if (error != 0) + goto out; + + error = vn_lock(invp, LK_SHARED); + if (error != 0) + goto out; + /* Check that the offset + len does not go past EOF of invp. */ + error = VOP_GETATTR(invp, &va, incred); + if (error == 0 && va.va_size < *inoffp + len) + error = EINVAL; + VOP_UNLOCK(invp, 0); + if (error != 0) + goto out; + + /* + * If the two vnode are for the same file system, call + * VOP_COPY_FILE_RANGE(), otherwise call vn_generic_copy_file_range() + * which can handle copies across multiple file systems. + */ + *lenp = len; + if (invp->v_mount == outvp->v_mount) + error = VOP_COPY_FILE_RANGE(invp, inoffp, outvp, outoffp, + lenp, flags, incred, outcred, fsize_td); + else + error = vn_generic_copy_file_range(invp, inoffp, outvp, + outoffp, lenp, flags, incred, outcred, fsize_td); +out: + return (error); +} + +/* + * Test len bytes of data starting at dat for all bytes == 0. + * Return true if all bytes are zero, false otherwise. + * Expects dat to be well aligned. + */ +static bool +mem_iszero(void *dat, int len) +{ + int i; + const u_int *p; + const char *cp; + + for (p = dat; len > 0; len -= sizeof(*p), p++) { + if (len >= sizeof(*p)) { + if (*p != 0) + return (false); + } else { + cp = (const char *)p; + for (i = 0; i < len; i++, cp++) + if (*cp != '\0') + return (false); + } + } + return (true); +} + +/* + * Write an xfer sized chunk to outvp in blksize blocks from dat. + * dat is a maximum of blksize in length and can be written repeatedly in + * the chunk. + * If growfile == true, just grow the file via vn_truncate_locked() instead + * of doing actual writes. + */ +static int +vn_write_outvp(struct vnode *outvp, char *dat, off_t outoff, off_t xfer, + u_long blksize, bool growfile, struct ucred *cred) +{ + struct mount *mp; + off_t xfer2; + int error, lckf; + + /* + * Loop around doing writes of blksize until write has been completed. + * Lock/unlock on each loop iteration so that a bwillwrite() can be + * done for each iteration, since the xfer argument can be very + * large if there is a large hole to punch in the output file. + */ + do { + bwillwrite(); + mp = NULL; + error = vn_start_write(outvp, &mp, V_WAIT); + if (error == 0) { + if (MNT_SHARED_WRITES(mp)) + lckf = LK_SHARED; + else + lckf = LK_EXCLUSIVE; + error = vn_lock(outvp, lckf); + } + if (error == 0) { + if (growfile) + error = vn_truncate_locked(outvp, outoff + xfer, + false, cred); + else { + xfer2 = MIN(xfer, blksize); + error = vn_rdwr(UIO_WRITE, outvp, dat, xfer2, + outoff, UIO_SYSSPACE, IO_NODELOCKED, + curthread->td_ucred, cred, NULL, curthread); + outoff += xfer2; + xfer -= xfer2; + } + VOP_UNLOCK(outvp, 0); + } + if (mp != NULL) + vn_finished_write(mp); + } while (!growfile && xfer > 0 && error == 0); + return (error); +} + +/* + * Copy a byte range of one file to another. This function can handle the + * case where invp and outvp are on different file systems. + * It can also be called by a VOP_COPY_FILE_RANGE() to do the work, if there + * is no better file system specific way to do it. + */ +int +vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, + struct vnode *outvp, off_t *outoffp, size_t *lenp, unsigned int flags, + struct ucred *incred, struct ucred *outcred, struct thread *fsize_td) +{ + struct vattr va; + struct mount *mp; + struct uio io; + off_t startoff, endoff, xfer, xfer2; + u_long blksize; + int error; + bool cantseek, readzeros; + ssize_t aresid; + size_t copylen, len, savlen; + char *dat; + long holein, holeout; + + holein = holeout = 0; + savlen = len = *lenp; + error = 0; + dat = NULL; + + error = vn_lock(invp, LK_SHARED); + if (error != 0) + goto out; + if (VOP_PATHCONF(invp, _PC_MIN_HOLE_SIZE, &holein) != 0) + holein = 0; + VOP_UNLOCK(invp, 0); + if (error != 0) + goto out; + + mp = NULL; + error = vn_start_write(outvp, &mp, V_WAIT); + if (error == 0) + error = vn_lock(outvp, LK_EXCLUSIVE); + if (error == 0) { + /* + * If fsize_td != NULL, do a vn_rlimit_fsize() call, + * now that outvp is locked. + */ + if (fsize_td != NULL) { + io.uio_offset = *outoffp; + io.uio_resid = len; + error = vn_rlimit_fsize(outvp, &io, fsize_td); + if (error != 0) + error = EFBIG; + } + if (VOP_PATHCONF(outvp, _PC_MIN_HOLE_SIZE, &holeout) != 0) + holeout = 0; + /* + * Holes that are past EOF do not need to be written as a block + * of zero bytes. So, truncate the output file as far as + * possible and then use va.va_size to decide if writing 0 + * bytes is necessary in the loop below. + */ + if (error == 0) + error = VOP_GETATTR(outvp, &va, outcred); + if (error == 0 && va.va_size > *outoffp && va.va_size <= + *outoffp + len) { +#ifdef MAC + error = mac_vnode_check_write(curthread->td_ucred, + outcred, outvp); + if (error == 0) +#endif + error = vn_truncate_locked(outvp, *outoffp, + false, outcred); + if (error == 0) + va.va_size = *outoffp; + } + VOP_UNLOCK(outvp, 0); + } + if (mp != NULL) + vn_finished_write(mp); + if (error != 0) + goto out; + + /* + * Set the blksize to the larger of the hole sizes for invp and outvp. + * If hole sizes aren't available, set the blksize to the larger + * f_iosize of invp and outvp. + * This code expects the hole sizes and f_iosizes to be powers of 2. + * This value is clipped at 4Kbytes and 1Mbyte. + */ + blksize = MAX(holein, holeout); + if (blksize == 0) + blksize = MAX(invp->v_mount->mnt_stat.f_iosize, + outvp->v_mount->mnt_stat.f_iosize); + if (blksize < 4096) + blksize = 4096; + else if (blksize > 1024 * 1024) + blksize = 1024 * 1024; + dat = malloc(blksize, M_TEMP, M_WAITOK); + + /* + * If VOP_IOCTL(FIOSEEKHOLE) works for invp, use it and FIOSEEKDATA + * to find holes. Otherwise, just scan the read block for all 0s + * in the inner loop where the data copying is done. + * Note that some file systems such as NFSv3, NFSv4.0 and NFSv4.1 may + * support holes on the server, but do not support FIOSEEKHOLE. + */ + while (len > 0 && error == 0) { + endoff = 0; /* To shut up compilers. */ + cantseek = true; + startoff = *inoffp; + copylen = len; + + /* + * Find the next data area. If there is just a hole to EOF, + * FIOSEEKDATA should fail and then we drop down into the + * inner loop and create the hole on the outvp file. + * (I do not know if any file system will report a hole to + * EOF via FIOSEEKHOLE, but I am pretty sure FIOSEEKDATA + * will fail for those file systems.) + * + * For input files that don't support FIOSEEKDATA/FIOSEEKHOLE, + * the code just falls through to the inner copy loop. + */ + error = EINVAL; + if (holein > 0) + error = VOP_IOCTL(invp, FIOSEEKDATA, &startoff, 0, + incred, curthread); + if (error == 0) { + endoff = startoff; + error = VOP_IOCTL(invp, FIOSEEKHOLE, &endoff, 0, + incred, curthread); + } + if (error == 0) { + if (startoff > *inoffp) { + /* Found hole before data block. */ + xfer = MIN(startoff - *inoffp, len); + if (*outoffp < va.va_size) { + /* Must write 0s to punch hole. */ + xfer2 = MIN(va.va_size - *outoffp, + xfer); + memset(dat, 0, MIN(xfer2, blksize)); + error = vn_write_outvp(outvp, dat, + *outoffp, xfer2, blksize, false, + outcred); + } + + if (error == 0 && *outoffp + xfer > + va.va_size && xfer == len) + /* Grow last block. */ + error = vn_write_outvp(outvp, dat, + *outoffp, xfer, blksize, true, + outcred); + if (error == 0) { + *inoffp += xfer; + *outoffp += xfer; + len -= xfer; + } + } + copylen = MIN(len, endoff - startoff); + cantseek = false; + } else { + cantseek = true; + startoff = *inoffp; + copylen = len; + error = 0; + } + + xfer = blksize; + if (cantseek) { + /* + * Set first xfer to end at a block boundary, so that + * holes are more likely detected in the loop below via + * the for all bytes 0 method. + */ + xfer -= (*inoffp % blksize); + } + /* Loop copying the data block. */ + while (copylen > 0 && error == 0) { + if (copylen < xfer) + xfer = copylen; + error = vn_lock(invp, LK_SHARED); + if (error != 0) + goto out; + error = vn_rdwr(UIO_READ, invp, dat, xfer, + startoff, UIO_SYSSPACE, IO_NODELOCKED, + curthread->td_ucred, incred, &aresid, + curthread); + VOP_UNLOCK(invp, 0); + /* + * Linux considers a range that exceeds EOF to + * be an error, so we will too. + */ + if (error == 0 && aresid > 0) + error = EINVAL; + if (error == 0) { + /* + * Skip the write for holes past the initial EOF + * of the output file, unless this is the last + * write of the output file at EOF. + */ + readzeros = cantseek ? mem_iszero(dat, xfer) : + false; + if (!cantseek || *outoffp < va.va_size || + xfer == len || !readzeros) + error = vn_write_outvp(outvp, dat, + *outoffp, xfer, blksize, + readzeros && xfer == len && + *outoffp >= va.va_size, outcred); + if (error == 0) { + *inoffp += xfer; + startoff += xfer; + *outoffp += xfer; + copylen -= xfer; + len -= xfer; + } + } + xfer = blksize; + } + } +out: + *lenp = savlen - len; + free(dat, M_TEMP); + return (error); +} Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Thu Jul 25 03:55:05 2019 (r350314) +++ head/sys/kern/vnode_if.src Thu Jul 25 05:46:16 2019 (r350315) @@ -718,6 +718,22 @@ vop_fdatasync { }; +%% copy_file_range invp U U U +%% copy_file_range outvp U U U + +vop_copy_file_range { + IN struct vnode *invp; + INOUT off_t *inoffp; + IN struct vnode *outvp; + INOUT off_t *outoffp; + INOUT size_t *lenp; + IN unsigned int flags; + IN struct ucred *incred; + IN struct ucred *outcred; + IN struct thread *fsizetd; +}; + + # The VOPs below are spares at the end of the table to allow new VOPs to be # added in stable branches without breaking the KBI. New VOPs in HEAD should # be added above these spares. When merging a new VOP to a stable branch, Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Thu Jul 25 03:55:05 2019 (r350314) +++ head/sys/sys/syscallsubr.h Thu Jul 25 05:46:16 2019 (r350315) @@ -94,6 +94,8 @@ int kern_clock_settime(struct thread *td, clockid_t cl int kern_close(struct thread *td, int fd); int kern_connectat(struct thread *td, int dirfd, int fd, struct sockaddr *sa); +int kern_copy_file_range(struct thread *td, int infd, off_t *inoffp, + int outfd, off_t *outoffp, size_t len, unsigned int flags); int kern_cpuset_getaffinity(struct thread *td, cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *maskp); int kern_cpuset_setaffinity(struct thread *td, cpulevel_t level, Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Thu Jul 25 03:55:05 2019 (r350314) +++ head/sys/sys/vnode.h Thu Jul 25 05:46:16 2019 (r350315) @@ -667,9 +667,17 @@ int vn_bmap_seekhole(struct vnode *vp, u_long cmd, off struct ucred *cred); int vn_close(struct vnode *vp, int flags, struct ucred *file_cred, struct thread *td); +int vn_copy_file_range(struct vnode *invp, off_t *inoffp, + struct vnode *outvp, off_t *outoffp, size_t *lenp, + unsigned int flags, struct ucred *incred, struct ucred *outcred, + struct thread *fsize_td); void vn_finished_write(struct mount *mp); void vn_finished_secondary_write(struct mount *mp); int vn_fsync_buf(struct vnode *vp, int waitfor); +int vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, + struct vnode *outvp, off_t *outoffp, size_t *lenp, + unsigned int flags, struct ucred *incred, struct ucred *outcred, + struct thread *fsize_td); int vn_isdisk(struct vnode *vp, int *errp); int _vn_lock(struct vnode *vp, int flags, char *file, int line); #define vn_lock(vp, flags) _vn_lock(vp, flags, __FILE__, __LINE__) From owner-svn-src-all@freebsd.org Thu Jul 25 05:55: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 D3487C3768; Thu, 25 Jul 2019 05:55:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 B56466A219; Thu, 25 Jul 2019 05:55:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71BB72251C; Thu, 25 Jul 2019 05:55:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6P5tv7n082845; Thu, 25 Jul 2019 05:55:57 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6P5tuKZ082840; Thu, 25 Jul 2019 05:55:56 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201907250555.x6P5tuKZ082840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 25 Jul 2019 05:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350316 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 350316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B56466A219 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_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: Thu, 25 Jul 2019 05:55:57 -0000 Author: rmacklem Date: Thu Jul 25 05:55:55 2019 New Revision: 350316 URL: https://svnweb.freebsd.org/changeset/base/350316 Log: Update the generated syscall files for copy_file_range(2) added by r350315. Modified: head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/sysproto.h Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Thu Jul 25 05:46:16 2019 (r350315) +++ head/sys/kern/init_sysent.c Thu Jul 25 05:55:55 2019 (r350316) @@ -618,4 +618,5 @@ struct sysent sysent[] = { { AS(fhlinkat_args), (sy_call_t *)sys_fhlinkat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 566 = fhlinkat */ { AS(fhreadlink_args), (sy_call_t *)sys_fhreadlink, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 567 = fhreadlink */ { AS(funlinkat_args), (sy_call_t *)sys_funlinkat, AUE_UNLINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 568 = funlinkat */ + { AS(copy_file_range_args), (sy_call_t *)sys_copy_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 569 = copy_file_range */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Thu Jul 25 05:46:16 2019 (r350315) +++ head/sys/kern/syscalls.c Thu Jul 25 05:55:55 2019 (r350316) @@ -575,4 +575,5 @@ const char *syscallnames[] = { "fhlinkat", /* 566 = fhlinkat */ "fhreadlink", /* 567 = fhreadlink */ "funlinkat", /* 568 = funlinkat */ + "copy_file_range", /* 569 = copy_file_range */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Thu Jul 25 05:46:16 2019 (r350315) +++ head/sys/kern/systrace_args.c Thu Jul 25 05:55:55 2019 (r350316) @@ -3312,6 +3312,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 4; break; } + /* copy_file_range */ + case 569: { + struct copy_file_range_args *p = params; + iarg[0] = p->infd; /* int */ + uarg[1] = (intptr_t) p->inoffp; /* off_t * */ + iarg[2] = p->outfd; /* int */ + uarg[3] = (intptr_t) p->outoffp; /* off_t * */ + uarg[4] = p->len; /* size_t */ + uarg[5] = p->flags; /* unsigned int */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8839,6 +8851,31 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* copy_file_range */ + case 569: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "userland off_t *"; + break; + case 2: + p = "int"; + break; + case 3: + p = "userland off_t *"; + break; + case 4: + p = "size_t"; + break; + case 5: + p = "unsigned int"; + break; + default: + break; + }; + break; default: break; }; @@ -10739,6 +10776,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * case 568: if (ndx == 0 || ndx == 1) p = "int"; + break; + /* copy_file_range */ + case 569: + if (ndx == 0 || ndx == 1) + p = "ssize_t"; break; default: break; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Thu Jul 25 05:46:16 2019 (r350315) +++ head/sys/sys/syscall.h Thu Jul 25 05:55:55 2019 (r350316) @@ -504,4 +504,5 @@ #define SYS_fhlinkat 566 #define SYS_fhreadlink 567 #define SYS_funlinkat 568 -#define SYS_MAXSYSCALL 569 +#define SYS_copy_file_range 569 +#define SYS_MAXSYSCALL 570 Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Thu Jul 25 05:46:16 2019 (r350315) +++ head/sys/sys/sysproto.h Thu Jul 25 05:55:55 2019 (r350316) @@ -1796,6 +1796,14 @@ struct funlinkat_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; +struct copy_file_range_args { + char infd_l_[PADL_(int)]; int infd; char infd_r_[PADR_(int)]; + char inoffp_l_[PADL_(off_t *)]; off_t * inoffp; char inoffp_r_[PADR_(off_t *)]; + char outfd_l_[PADL_(int)]; int outfd; char outfd_r_[PADR_(int)]; + char outoffp_l_[PADL_(off_t *)]; off_t * outoffp; char outoffp_r_[PADR_(off_t *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2181,6 +2189,7 @@ int sys_fhlink(struct thread *, struct fhlink_args *); int sys_fhlinkat(struct thread *, struct fhlinkat_args *); int sys_fhreadlink(struct thread *, struct fhreadlink_args *); int sys_funlinkat(struct thread *, struct funlinkat_args *); +int sys_copy_file_range(struct thread *, struct copy_file_range_args *); #ifdef COMPAT_43 @@ -3088,6 +3097,7 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #define SYS_AUE_fhlinkat AUE_NULL #define SYS_AUE_fhreadlink AUE_NULL #define SYS_AUE_funlinkat AUE_UNLINKAT +#define SYS_AUE_copy_file_range AUE_NULL #undef PAD_ #undef PADL_ From owner-svn-src-all@freebsd.org Thu Jul 25 06:05: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 4F5C9C398C; Thu, 25 Jul 2019 06:05:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 2D3C56A847; Thu, 25 Jul 2019 06:05:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB819226E1; Thu, 25 Jul 2019 06:05:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6P65ncp088834; Thu, 25 Jul 2019 06:05:49 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6P65nRk088831; Thu, 25 Jul 2019 06:05:49 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201907250605.x6P65nRk088831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 25 Jul 2019 06:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350317 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 350317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D3C56A847 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_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: Thu, 25 Jul 2019 06:05:50 -0000 Author: rmacklem Date: Thu Jul 25 06:05:49 2019 New Revision: 350317 URL: https://svnweb.freebsd.org/changeset/base/350317 Log: Add libc support for the copy_file_range(2) syscall added by r350315. copy_file_range.2 is a new man page (content change). Reviewed by: kib, asomers Relnotes: yes Differential Revision: https://reviews.freebsd.org/D20584 Added: head/lib/libc/sys/copy_file_range.2 (contents, props changed) Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Thu Jul 25 05:55:55 2019 (r350316) +++ head/lib/libc/sys/Makefile.inc Thu Jul 25 06:05:49 2019 (r350317) @@ -175,6 +175,7 @@ MAN+= abort2.2 \ closefrom.2 \ connect.2 \ connectat.2 \ + copy_file_range.2 \ cpuset.2 \ cpuset_getaffinity.2 \ cpuset_getdomain.2 \ Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Thu Jul 25 05:55:55 2019 (r350316) +++ head/lib/libc/sys/Symbol.map Thu Jul 25 06:05:49 2019 (r350317) @@ -402,6 +402,7 @@ FBSD_1.5 { }; FBSD_1.6 { + copy_file_range; fhlink; fhlinkat; fhreadlink; Added: head/lib/libc/sys/copy_file_range.2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/copy_file_range.2 Thu Jul 25 06:05:49 2019 (r350317) @@ -0,0 +1,191 @@ +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2019 Rick Macklem +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 24, 2019 +.Dt COPY_FILE_RANGE 2 +.Os +.Sh NAME +.Nm copy_file_range +.Nd kernel copy of a byte range from one file to another +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In unistd.h +.Ft ssize_t +.Fo copy_file_range +.Fa "int infd" +.Fa "off_t *inoffp" +.Fa "int outfd" +.Fa "off_t *outoffp" +.Fa "size_t len" +.Fa "unsigned int flags" +.Fc +.Sh DESCRIPTION +The +.Fn copy_file_range +system call +copies up to +.Fa len +bytes from +.Fa infd +to +.Fa outfd +in the kernel. +It may do this using a file system specific technique if +.Fa infd +and +.Fa outfd +are on the same file system. +The +.Fa infd +argument must be opened for reading and the +.Fa outfd +argument must be opened for writing, but not +.Dv O_APPEND . +If +.Fa inoffp +or +.Fa outoffp +is +.Dv NULL , +the file offset for +.Fa infd +or +.Fa outfd +respectively will be used and updated by +the number of bytes copied. +If +.Fa inoffp +or +.Fa outoffp +is not +.Dv NULL , +the byte offset pointed to by +.Fa inoffp +or +.Fa outoffp +respectively will be used/updated and the file offset for +.Fa infd +or +.Fa outfd +respectively will not be affected. +The +.Fa flags +argument must be 0. +.Pp +This system call attempts to maintain holes in the output file for +the byte range being copied. +However, this does not always work well. +It is recommended that sparse files be copied in a loop using +.Xr lseek 2 +with +.Dv SEEK_HOLE , +.Dv SEEK_DATA +arguments and this system call for the +data ranges found. +.Pp +.Sh RETURN VALUES +If it succeeds, the call returns the number of bytes copied, which can be less +than +.Fa len . +.Fn copy_file_range +should be used in a loop until copying of the desired byte range has been +completed. +If an error has occurred, a \-1 is returned and the error code is placed in +the global variable +.Va errno . +.Sh ERRORS +The +.Fn copy_file_range +system call +will fail if: +.Bl -tag -width Er +.It Bq Er EBADF +If +.Fa +infd +is not open for reading or +.Fa +outfd +is not open for writing, or opened for writing with +.Dv O_APPEND , +or if +.Fa infd +and +.Fa outfd +refer to the same file. +.It Bq Er EFBIG +If the copy exceeds the process's file size limit or the maximum file size +for the file system +.Fa outfd +resides on. +.It Bq Er EINTR +A signal interrupted the system call +before it could be completed. +This may happen for files on some NFS mounts. +When this happens, the values pointed to by +.Fa inoffp +and +.Fa outoffp +are reset to the initial values for the system call. +.It Bq Er EINVAL +If the initial offset for +.Fa infd +plus +.Fa len +exceeds EOF for +.Fa infd +or +.Fa +flags +is not zero. +.It Bq Er EIO +An I/O error occurred while reading/writing the files. +.It Bq Er EISDIR +If either +.Fa infd +or +.Fa outfd +refers to a directory. +.It Bq Er ENOSPC +File system that stores +.Fa outfd +is full. +.El +.Sh SEE ALSO +.Xr lseek 2 +.Sh STANDARDS +The +.Fn copy_file_range +system call is expected to be compatible with the Linux system call of +the same name. +.Sh HISTORY +The +.Fn copy_file_range +function appeared in +.Fx 13.0 . From owner-svn-src-all@freebsd.org Thu Jul 25 06:10: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 16616C3AF8; Thu, 25 Jul 2019 06:10:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 DBDCE6AB1B; Thu, 25 Jul 2019 06:10:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B819D226F7; Thu, 25 Jul 2019 06:10:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6P6AijE089767; Thu, 25 Jul 2019 06:10:44 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6P6AiNe089766; Thu, 25 Jul 2019 06:10:44 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201907250610.x6P6AiNe089766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 25 Jul 2019 06:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350318 - head/include X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 350318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DBDCE6AB1B 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.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, 25 Jul 2019 06:10:45 -0000 Author: rmacklem Date: Thu Jul 25 06:10:44 2019 New Revision: 350318 URL: https://svnweb.freebsd.org/changeset/base/350318 Log: Add an entry for copy_file_range(2) to unistd.h. copy_file_range(2) is a Linux compatible syscall created by r350315. Reviewed by: kib, asomers Relnotes: yes Differential Revision: https://reviews.freebsd.org/D20584 Modified: head/include/unistd.h Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Thu Jul 25 06:05:49 2019 (r350317) +++ head/include/unistd.h Thu Jul 25 06:10:44 2019 (r350318) @@ -494,6 +494,7 @@ struct crypt_data { int acct(const char *); int async_daemon(void); int check_utility_compat(const char *); +ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned int); const char * crypt_get_format(void); char *crypt_r(const char *, const char *, struct crypt_data *); From owner-svn-src-all@freebsd.org Thu Jul 25 06:20: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 ED23BC3D48; Thu, 25 Jul 2019 06:20:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 D05ED6B0A9; Thu, 25 Jul 2019 06:20:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9148228CD; Thu, 25 Jul 2019 06:20:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6P6K0SI094728; Thu, 25 Jul 2019 06:20:00 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6P6K05p094727; Thu, 25 Jul 2019 06:20:00 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201907250620.x6P6K05p094727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 25 Jul 2019 06:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350319 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 350319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D05ED6B0A9 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.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: Thu, 25 Jul 2019 06:20:01 -0000 Author: rmacklem Date: Thu Jul 25 06:20:00 2019 New Revision: 350319 URL: https://svnweb.freebsd.org/changeset/base/350319 Log: Create a man page for VOP_COPY_FILE_RANGE(9). r350315 created a Linux compatible copy_file_range(2) syscall. It uses a VOP method called VOP_COPY_FILE_RANGE so that file systems, such as the NFSv4.2 client can do file system specific copying. For NFSv4.2, this allows the copying to be done locally on the NFS server, avoiding transferring the data across the wire twice. This is a new man page (content changed). Reviewed by: kib, asomers Relnotes: yes Differential Revision: https://reviews.freebsd.org/D20584 Added: head/share/man/man9/VOP_COPY_FILE_RANGE.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jul 25 06:10:44 2019 (r350318) +++ head/share/man/man9/Makefile Thu Jul 25 06:20:00 2019 (r350319) @@ -397,6 +397,7 @@ MAN= accept_filter.9 \ VOP_ATTRIB.9 \ VOP_BMAP.9 \ VOP_BWRITE.9 \ + VOP_COPY_FILE_RANGE.9 \ VOP_CREATE.9 \ VOP_FSYNC.9 \ VOP_GETACL.9 \ Added: head/share/man/man9/VOP_COPY_FILE_RANGE.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/VOP_COPY_FILE_RANGE.9 Thu Jul 25 06:20:00 2019 (r350319) @@ -0,0 +1,124 @@ +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2019 Rick Macklem +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 24, 2019 +.Dt VOP_COPY_FILE_RANGE 9 +.Os +.Sh NAME +.Nm VOP_COPY_FILE_RANGE +.Nd copy a byte range from one regular file to another within a file system +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fo VOP_COPY_FILE_RANGE +.Fa "struct vnode *invp" +.Fa "off_t *inoff" +.Fa "struct vnode *outvp" +.Fa "off_t *outoff" +.Fa "size_t *len" +.Fa "unsigned int flags" +.Fa "struct ucred *incred" +.Fa "struct ucred *outcred" +.Fa "struct thread *fsize_td" +.Sh DESCRIPTION +This entry point copies a byte range from one regular file to another within a +file system. +.Pp +The arguments are: +.Bl -tag -width ioflag +.It Fa invp +The vnode of the input file. +.It Fa inoff +A pointer to the file offset for the input file. +.It Fa outvp +The vnode of the output file. +.It Fa outoff +A pointer to the file offset for the output file. +.It Fa len +A pointer to the number of bytes to be copied. +.It Fa flags +Flags, should be set to 0 for now. +.It Fa incred +The credentials used to read +.Fa invp . +.It Fa outcred +The credentials used to write +.Fa outvp . +.It Fa fsize_td +The thread pointer to be passed to vn_rlimit_fsize(). +This will be +.Dv NULL +for a server thread without limits, such as for the NFS +server or +.Dv curthread +otherwise. +.El +.Pp +On entry and on return, the +.Fa inoff +and +.Fa outoff +arguments point to the locations of the file offsets. +These file offsets should be updated by the number of bytes copied. +The +.Fa len +argument points to the location that stores the number of bytes +to be copied. +It should be reduced by the number of bytes copied, which implies that +the value pointed to by +.Fa len +will normally be zero for a non-error return. +However, a copy of less bytes than requested is permitted. +.Sh LOCKS +The vnode are unlocked on entry and must be unlocked on return. +The byte ranges for both +.Fa invp +and +.Fa outvp +should be range locked when this call is done. +.Sh RETURN VALUES +Zero is returned on success, otherwise an error code is returned. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EFBIG +If the copy exceeds the process's file size limit or the maximum file size +for the file system +.Fa invp +and +.Fa outvp +reside on. +.It Bq Er EINTR +A signal interrupted the VOP call before it could be completed. +.It Bq Er EIO +An I/O error occurred while reading/writing the files. +.It Bq Er ENOSPC +The file system is full. +.El +.Sh SEE ALSO +.Xr vn_rdwr 9 , +.Xr vnode 9 From owner-svn-src-all@freebsd.org Thu Jul 25 06:35: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 7D098C41F1; Thu, 25 Jul 2019 06:35:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 5E37A6BAC3; Thu, 25 Jul 2019 06:35:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 367A022C44; Thu, 25 Jul 2019 06:35:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6P6ZMG9006651; Thu, 25 Jul 2019 06:35:22 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6P6ZMlG006650; Thu, 25 Jul 2019 06:35:22 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201907250635.x6P6ZMlG006650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 25 Jul 2019 06:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350320 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 350320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E37A6BAC3 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]; 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, 25 Jul 2019 06:35:22 -0000 Author: rmacklem Date: Thu Jul 25 06:35:21 2019 New Revision: 350320 URL: https://svnweb.freebsd.org/changeset/base/350320 Log: Update the generated syscall.mk for copy_file_range(2). I missed this file for commit r350316. Modified: head/sys/sys/syscall.mk Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Thu Jul 25 06:20:00 2019 (r350319) +++ head/sys/sys/syscall.mk Thu Jul 25 06:35:21 2019 (r350320) @@ -409,4 +409,5 @@ MIASM = \ fhlink.o \ fhlinkat.o \ fhreadlink.o \ + copy_file_range.o \ funlinkat.o From owner-svn-src-all@freebsd.org Thu Jul 25 06:48: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 6FE11C4467; Thu, 25 Jul 2019 06:48:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 4E9CF6C0CB; Thu, 25 Jul 2019 06:48:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27CD122E26; Thu, 25 Jul 2019 06:48:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6P6mUhO012508; Thu, 25 Jul 2019 06:48:30 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6P6mUCR012507; Thu, 25 Jul 2019 06:48:30 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201907250648.x6P6mUCR012507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 25 Jul 2019 06:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350321 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 350321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E9CF6C0CB 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.919,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, 25 Jul 2019 06:48:31 -0000 Author: rmacklem Date: Thu Jul 25 06:48:30 2019 New Revision: 350321 URL: https://svnweb.freebsd.org/changeset/base/350321 Log: r350320 committed the wrong version of generated syscall.mk. This commit is for the correct version. (The incorrect one had the order of the last two entries reversed, due to my testing with copy_file_range at 568 instead of 569.) This misordering should not have been a problem, but is now fixed. Modified: head/sys/sys/syscall.mk Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Thu Jul 25 06:35:21 2019 (r350320) +++ head/sys/sys/syscall.mk Thu Jul 25 06:48:30 2019 (r350321) @@ -409,5 +409,5 @@ MIASM = \ fhlink.o \ fhlinkat.o \ fhreadlink.o \ - copy_file_range.o \ - funlinkat.o + funlinkat.o \ + copy_file_range.o From owner-svn-src-all@freebsd.org Thu Jul 25 07:57: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 8A3EAC56BC; Thu, 25 Jul 2019 07:57:02 +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 6C5696E6B4; Thu, 25 Jul 2019 07:57:02 +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 40AB223A95; Thu, 25 Jul 2019 07:57:02 +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 x6P7v2BP053383; Thu, 25 Jul 2019 07:57:02 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6P7v2Xv053382; Thu, 25 Jul 2019 07:57:02 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201907250757.x6P7v2Xv053382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 25 Jul 2019 07:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350322 - head X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C5696E6B4 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.953,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, 25 Jul 2019 07:57:02 -0000 Author: lwhsu Date: Thu Jul 25 07:57:01 2019 New Revision: 350322 URL: https://svnweb.freebsd.org/changeset/base/350322 Log: Workaround the build failure on platforms have lib32 after r350301 Error message: make[5]: make[5]: don't know how to make /usr/obj/usr/src/amd64.amd64/obj-lib32/tmp/sys/netinet/in.h. Stop make[5]: stopped in /usr/src/lib/libsysdecode Sponsored by: The FreeBSD Foundation Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Thu Jul 25 06:48:30 2019 (r350321) +++ head/Makefile.libcompat Thu Jul 25 07:57:01 2019 (r350322) @@ -186,6 +186,7 @@ build${libcompat}: .PHONY .endif mkdir -p ${WORLDTMP} ln -sf ${.CURDIR}/sys ${WORLDTMP} + ln -sf ${.CURDIR}/sys ${LIBCOMPATTMP} .for _t in ${_obj} includes .for _dir in ${_LC_INCDIRS} ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATWMAKE} MK_INCLUDES=yes \ From owner-svn-src-all@freebsd.org Thu Jul 25 13:27: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 BCEE6A4B95; Thu, 25 Jul 2019 13:27:22 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 DCEE182C6E; Thu, 25 Jul 2019 13:27:21 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk1-x730.google.com with SMTP id a27so36396865qkk.5; Thu, 25 Jul 2019 06:27:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to; bh=X/SBIySjs+27ME5tZJPj/rRxGRMrqSBma0PHc4lT2S0=; b=jYihUa/tuZe3gPJRJsxC86J/dq4s8VcQE2SUkDPmvyD5aEzCQzPUIqkS8jnuJO3E37 CspuvKDSoK22EKdbQcavGKyzfKytaJw4qZLjPZ2mvPDQ2ofVfMjnlWRunjSbCr3VW7UU xvfy5MI8a5dyGqKQw0G1VgWtz+kWmT/P6P2ut/h3jhbyj5jQfnuBKkWemIMi/e+7ArYQ +qaChT5Ga9Nt0Q5ZK07FWvQLt1jj+0iM/178PM4MrOcbitWtQPNtDI9ZlYYcl9OX0Ks6 jrOZ+CJX0URBicNiJZfEcxtgsN+38GsgXpI27PW0JygzyXuo5IhcS5y9iXGzJIPhKOvo PYLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to; bh=X/SBIySjs+27ME5tZJPj/rRxGRMrqSBma0PHc4lT2S0=; b=MvW6pvDRTlCXH7HT+8ksBrncqoPABYCpu9iPs6/FT6Ov4dpBrDGP38DKYFF09mSatb bPkMJGB6kOSHVsT5zkEYIUW29B5wju7l+hFjK+iC32d08vjDilwgVqXOuKGnfjD7pUF7 HWzxpyAxbscLYWjMZDACaXNGZu+UKLKtUU94FkmoNe3H6o2/MbT7onRI8ocsvbbPkui7 PdTdWk2+8e+cPziFAtwciMmSzCw88P5oxwDR5ejZ7SM98zRvT2YubYF3CxF1bgU0BXkd +nnuqTjSxCMl2lmlfBy5N+0ormo7i9s7ssMAwyAFzCMVEhV6D1U/MYbLTxaPR51fD8Bv xDKQ== X-Gm-Message-State: APjAAAXrhp41l/n8czsWnHfK8B4hsUEZXlgG+kReNYbXJhW80wN+9Zms hdojlJCiUgKy6+vHlB0MKvybeeJd X-Google-Smtp-Source: APXvYqy3dCPpRadaBMKV4KVSlZ6lZm8eFZLlJqF4R2Pmvnz44xZBu6DVJfMihGKIJZG5nrrculLDPQ== X-Received: by 2002:ae9:ee14:: with SMTP id i20mr52891876qkg.428.1564061241061; Thu, 25 Jul 2019 06:27:21 -0700 (PDT) Received: from mbp.home ([2804:f1c:800:fc00:3ca5:8f67:2b13:24e7]) by smtp.gmail.com with ESMTPSA id d25sm20222243qko.96.2019.07.25.06.27.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jul 2019 06:27:19 -0700 (PDT) Sender: Renato Botelho Subject: Re: svn commit: r349976 - head To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201907131648.x6DGmRc4090395@repo.freebsd.org> From: Renato Botelho Openpgp: preference=signencrypt Autocrypt: addr=garga@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAG0LFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+iQFXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/ULkBDQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABiQE8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: Date: Thu, 25 Jul 2019 10:27:15 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201907131648.x6DGmRc4090395@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ZUwLwEwpkm2LUEDwYaGu47v3RM4YDnA5S" X-Rspamd-Queue-Id: DCEE182C6E X-Spamd-Bar: -------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=jYihUa/t; spf=pass (mx1.freebsd.org: domain of gargabsd@gmail.com designates 2607:f8b0:4864:20::730 as permitted sender) smtp.mailfrom=gargabsd@gmail.com X-Spamd-Result: default: False [-8.26 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; HAS_ATTACHMENT(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[garga@FreeBSD.org,gargabsd@gmail.com]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[garga@FreeBSD.org,gargabsd@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; TAGGED_FROM(0.00)[]; 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.20)[multipart/signed,multipart/mixed,text/plain]; DMARC_NA(0.00)[FreeBSD.org]; IP_SCORE(-3.00)[ip: (-9.44), ipnet: 2607:f8b0::/32(-3.08), asn: 15169(-2.43), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[0.3.7.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: Thu, 25 Jul 2019 13:27:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ZUwLwEwpkm2LUEDwYaGu47v3RM4YDnA5S Content-Type: multipart/mixed; boundary="DTfhUXHHxHeZL8sKL7ovSFtbSNzUoGCgZ"; protected-headers="v1" From: Renato Botelho To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r349976 - head References: <201907131648.x6DGmRc4090395@repo.freebsd.org> In-Reply-To: <201907131648.x6DGmRc4090395@repo.freebsd.org> --DTfhUXHHxHeZL8sKL7ovSFtbSNzUoGCgZ Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 13/07/19 13:48, Ian Lepore wrote: > Author: ian > Date: Sat Jul 13 16:48:27 2019 > New Revision: 349976 > URL: https://svnweb.freebsd.org/changeset/base/349976 >=20 > Log: > Add an entry mentioning the permission/mode change to daily accountin= g files. >=20 > Modified: > head/UPDATING >=20 > Modified: head/UPDATING > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/UPDATING Sat Jul 13 16:32:19 2019 (r349975) > +++ head/UPDATING Sat Jul 13 16:48:27 2019 (r349976) > @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > =20 > +20190713: > + Default permissions on the /var/account/acct file (and copies of i= t rotated=20 > + by periodic daily scripts) are changed from 0644 to 0640 because t= he file=20 > + contains sensitive information that should not be world-readable. = If the=20 > + /var/account directory must be created by rc.d/accounting, the mod= e used is=20 > + now 0750. Admins who use the accounting feature are encouraged to= change=20 > + the mode of an existing /var/account directory to 0750 or 0700. =20 Block is indented with 4 spaces instead of tabs --=20 Renato Botelho --DTfhUXHHxHeZL8sKL7ovSFtbSNzUoGCgZ-- --ZUwLwEwpkm2LUEDwYaGu47v3RM4YDnA5S Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAl05rjRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM3 MTg4QjM0Q0FBQzlGQkM5Nzk5M0NCQjVCOUUwNEMzOTY2Qjg2MUEACgkQW54Ew5Zr hhrkGwf8DQstHIKlEQ9BB8HIBDjwRC6kMcxHOr/eU+IjJi4Rd9op2mG5opfeZ3KI b9UkLPyfalnxVYmqOwlmvvXQK/ok5r8T4rY28wf3kV+xyNfFE5oZ6XrgeOvb3G8Q V+jPR4yyNF++bjhVtAP4fSSo9T35iXGKqF5RsiSpWgv3o96hOb7fx8X1wyLR9rpF fFQ5bKf+uFuBsA+kruKJEBp5i2+92PTT2x61kvuENLinqnF/MVUtdvUQ4RuwN1th PIGYjqE/VAIvZbr/JsQYow2DDpxs7fXjiA5H2zCA8KJgDG6fQG6hl1LNMjq+8nzE JErPgoDvwek3pY3nOTAm9/OrLMscJQ== =5B5C -----END PGP SIGNATURE----- --ZUwLwEwpkm2LUEDwYaGu47v3RM4YDnA5S-- From owner-svn-src-all@freebsd.org Thu Jul 25 15:27: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 27AB2A7249; Thu, 25 Jul 2019 15:27:06 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 08889873AA; Thu, 25 Jul 2019 15:27:06 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2EFEB26; Thu, 25 Jul 2019 15:27:05 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6PFR5ug017029; Thu, 25 Jul 2019 15:27:05 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PFR59p017028; Thu, 25 Jul 2019 15:27:05 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201907251527.x6PFR59p017028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Thu, 25 Jul 2019 15:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350323 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 350323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 08889873AA 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_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: Thu, 25 Jul 2019 15:27:06 -0000 Author: luporl Date: Thu Jul 25 15:27:05 2019 New Revision: 350323 URL: https://svnweb.freebsd.org/changeset/base/350323 Log: powerpc: Improve pvo allocation code Added allocation retry loop in alloc_pvo_entry(), to wait for memory to become available if the caller specifies the M_WAITOK flag. Also, the loop in moa64_enter() was removed, as moea64_pvo_enter() never returns ENOMEM. It is alloc_pvo_entry() memory allocation that can fail and must be retried. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D21035 Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Jul 25 07:57:01 2019 (r350322) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Jul 25 15:27:05 2019 (r350323) @@ -373,24 +373,28 @@ vm_page_to_pvoh(vm_page_t m) } static struct pvo_entry * -alloc_pvo_entry(int bootstrap) +alloc_pvo_entry(int bootstrap, int flags) { struct pvo_entry *pvo; + KASSERT(bootstrap || (flags & M_WAITOK) || (flags & M_NOWAIT), + ("Either M_WAITOK or M_NOWAIT flag must be specified " + "when bootstrap is 0")); + KASSERT(!bootstrap || !(flags & M_WAITOK), + ("M_WAITOK can't be used with bootstrap")); + if (!moea64_initialized || bootstrap) { if (moea64_bpvo_pool_index >= moea64_bpvo_pool_size) { panic("moea64_enter: bpvo pool exhausted, %d, %d, %zd", - moea64_bpvo_pool_index, moea64_bpvo_pool_size, + moea64_bpvo_pool_index, moea64_bpvo_pool_size, moea64_bpvo_pool_size * sizeof(struct pvo_entry)); } pvo = &moea64_bpvo_pool[ atomic_fetchadd_int(&moea64_bpvo_pool_index, 1)]; bzero(pvo, sizeof(*pvo)); pvo->pvo_vaddr = PVO_BOOTSTRAP; - } else { - pvo = uma_zalloc(moea64_pvo_zone, M_NOWAIT); - bzero(pvo, sizeof(*pvo)); - } + } else + pvo = uma_zalloc(moea64_pvo_zone, flags | M_ZERO); return (pvo); } @@ -658,7 +662,7 @@ moea64_setup_direct_map(mmu_t mmup, vm_offset_t kernel pregions[i].mr_size; pa += moea64_large_page_size) { pte_lo = LPTE_M; - pvo = alloc_pvo_entry(1 /* bootstrap */); + pvo = alloc_pvo_entry(1 /* bootstrap */, 0); pvo->pvo_vaddr |= PVO_WIRED | PVO_LARGE; init_pvo_entry(pvo, kernel_pmap, PHYS_TO_DMAP(pa)); @@ -1399,7 +1403,9 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, v if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m)) VM_OBJECT_ASSERT_LOCKED(m->object); - pvo = alloc_pvo_entry(0); + pvo = alloc_pvo_entry(0, M_NOWAIT); + if (pvo == NULL) + return (KERN_RESOURCE_SHORTAGE); pvo->pvo_pmap = NULL; /* to be filled in later */ pvo->pvo_pte.prot = prot; @@ -1415,61 +1421,53 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, v pvo_head = &m->md.mdpg_pvoh; pvo->pvo_vaddr |= PVO_MANAGED; } - - for (;;) { - PV_PAGE_LOCK(m); - PMAP_LOCK(pmap); - if (pvo->pvo_pmap == NULL) - init_pvo_entry(pvo, pmap, va); - if (prot & VM_PROT_WRITE) - if (pmap_bootstrapped && - (m->oflags & VPO_UNMANAGED) == 0) - vm_page_aflag_set(m, PGA_WRITEABLE); - error = moea64_pvo_enter(mmu, pvo, pvo_head, &oldpvo); - if (error == EEXIST) { - if (oldpvo->pvo_vaddr == pvo->pvo_vaddr && - oldpvo->pvo_pte.pa == pvo->pvo_pte.pa && - oldpvo->pvo_pte.prot == prot) { - /* Identical mapping already exists */ - error = 0; + PV_PAGE_LOCK(m); + PMAP_LOCK(pmap); + if (pvo->pvo_pmap == NULL) + init_pvo_entry(pvo, pmap, va); + if (prot & VM_PROT_WRITE) + if (pmap_bootstrapped && + (m->oflags & VPO_UNMANAGED) == 0) + vm_page_aflag_set(m, PGA_WRITEABLE); - /* If not in page table, reinsert it */ - if (MOEA64_PTE_SYNCH(mmu, oldpvo) < 0) { - STAT_MOEA64(moea64_pte_overflow--); - MOEA64_PTE_INSERT(mmu, oldpvo); - } + error = moea64_pvo_enter(mmu, pvo, pvo_head, &oldpvo); + if (error == EEXIST) { + if (oldpvo->pvo_vaddr == pvo->pvo_vaddr && + oldpvo->pvo_pte.pa == pvo->pvo_pte.pa && + oldpvo->pvo_pte.prot == prot) { + /* Identical mapping already exists */ + error = 0; - /* Then just clean up and go home */ - PV_PAGE_UNLOCK(m); - PMAP_UNLOCK(pmap); - free_pvo_entry(pvo); - break; + /* If not in page table, reinsert it */ + if (MOEA64_PTE_SYNCH(mmu, oldpvo) < 0) { + STAT_MOEA64(moea64_pte_overflow--); + MOEA64_PTE_INSERT(mmu, oldpvo); } + /* Then just clean up and go home */ + PV_PAGE_UNLOCK(m); + PMAP_UNLOCK(pmap); + free_pvo_entry(pvo); + goto out; + } else { /* Otherwise, need to kill it first */ KASSERT(oldpvo->pvo_pmap == pmap, ("pmap of old " "mapping does not match new mapping")); moea64_pvo_remove_from_pmap(mmu, oldpvo); moea64_pvo_enter(mmu, pvo, pvo_head, NULL); } - PV_PAGE_UNLOCK(m); - PMAP_UNLOCK(pmap); + } + PV_PAGE_UNLOCK(m); + PMAP_UNLOCK(pmap); - /* Free any dead pages */ - if (error == EEXIST) { - moea64_pvo_remove_from_page(mmu, oldpvo); - free_pvo_entry(oldpvo); - } - - if (error != ENOMEM) - break; - if ((flags & PMAP_ENTER_NOSLEEP) != 0) - return (KERN_RESOURCE_SHORTAGE); - VM_OBJECT_ASSERT_UNLOCKED(m->object); - vm_wait(NULL); + /* Free any dead pages */ + if (error == EEXIST) { + moea64_pvo_remove_from_page(mmu, oldpvo); + free_pvo_entry(oldpvo); } +out: /* * Flush the page from the instruction cache if this page is * mapped executable and cacheable. @@ -1632,7 +1630,7 @@ moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes va = VM_PAGE_TO_PHYS(m); - pvo = alloc_pvo_entry(1 /* bootstrap */); + pvo = alloc_pvo_entry(1 /* bootstrap */, 0); pvo->pvo_pte.prot = VM_PROT_READ | VM_PROT_WRITE; pvo->pvo_pte.pa = VM_PAGE_TO_PHYS(m) | LPTE_M; @@ -1864,7 +1862,7 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_t va, vm_paddr int error; struct pvo_entry *pvo, *oldpvo; - pvo = alloc_pvo_entry(0); + pvo = alloc_pvo_entry(0, M_WAITOK); pvo->pvo_pte.prot = VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE; pvo->pvo_pte.pa = (pa & ~ADDR_POFF) | moea64_calc_wimg(pa, ma); pvo->pvo_vaddr |= PVO_WIRED; From owner-svn-src-all@freebsd.org Thu Jul 25 15:31: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 6A588A7353; Thu, 25 Jul 2019 15:31:16 +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 4B37B87714; Thu, 25 Jul 2019 15:31:16 +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 26F6AB77; Thu, 25 Jul 2019 15:31:16 +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 x6PFVGfI019499; Thu, 25 Jul 2019 15:31:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PFVGmx019498; Thu, 25 Jul 2019 15:31:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201907251531.x6PFVGmx019498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 25 Jul 2019 15:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350324 - head X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4B37B87714 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.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: Thu, 25 Jul 2019 15:31:16 -0000 Author: ian Date: Thu Jul 25 15:31:15 2019 New Revision: 350324 URL: https://svnweb.freebsd.org/changeset/base/350324 Log: Fix indentation (spaces->tab). Reported by: garga@ Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jul 25 15:27:05 2019 (r350323) +++ head/UPDATING Thu Jul 25 15:31:15 2019 (r350324) @@ -27,12 +27,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20190713: - Default permissions on the /var/account/acct file (and copies of it rotated - by periodic daily scripts) are changed from 0644 to 0640 because the file - contains sensitive information that should not be world-readable. If the - /var/account directory must be created by rc.d/accounting, the mode used is - now 0750. Admins who use the accounting feature are encouraged to change - the mode of an existing /var/account directory to 0750 or 0700. + Default permissions on the /var/account/acct file (and copies of it rotated + by periodic daily scripts) are changed from 0644 to 0640 because the file + contains sensitive information that should not be world-readable. If the + /var/account directory must be created by rc.d/accounting, the mode used is + now 0750. Admins who use the accounting feature are encouraged to change + the mode of an existing /var/account directory to 0750 or 0700. 20190620: Entropy collection and the /dev/random device are no longer optional From owner-svn-src-all@freebsd.org Thu Jul 25 15:32: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 E8FE5A7515 for ; Thu, 25 Jul 2019 15:32:25 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (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 7284287B05 for ; Thu, 25 Jul 2019 15:32:25 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1564068738; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=f98mCSrMAau86OLgsSX+DEV00emDfy65QS/t7M4InXggvdY6Pw53NeIE1h21iZrDPi//nDQtH6HFv mgOI28DT9VXaus8tnfLRf0hV4afBPCLFxYYQGswZGcRQ5ogeN7ofBNxE8ExDAG9Xt591ZjFFTYCDV5 N2gAQNutLel8DnPL+2wd6IbrklHEstmuWWY5gT7OJLUXSWdXE4dMFpICXnG8GxAK0xZ51PKmeWky80 5YjMvV0vhsqbc2xAihLsSD2EXroMfgYaQH9GFRuL1WiYD4hJDGIvCveDYaKk99/k2PhkWryhVMSKTr rCVilhpaVc3fl9OGNyQvfDmGIyxjKjA== 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:to:from:subject:message-id:dkim-signature:from; bh=9TEqOMlXAgZVEdRBzdobe3DPmHEg7Qdw0sjzWw6YpN8=; b=al2fLuY+Bu2BaR/ua678GXFacqebssiFR2W5PYavMMgkpA+Wqxe5COlMI+MiaWMwA+P98Dq2pHwar G/J/GrIClL6a59+iNx5o0pV8ZlWxtSAJsqNfkD2oplAh7ja+Zx1GVGetRWBfKZabdPKppx819lCHhh wbRg0a7eDwuVEWRzehhGu1EIoeqcU+vqY1/iOOM20vEOw8DmegMdGlATooQdErudO+hLcLwJOFkXCD yvLF7dStbcs/Ie5dLk7ZltZrtntC+QNimjyPDvmEAprrXCO2mnKMWtMR98/PQDqoNg6x+x0dnnyMMl uTXofe3rXdKrUhkAY/Qan1g7XY46QTQ== ARC-Authentication-Results: i=1; outbound4.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:to:from:subject:message-id:from; bh=9TEqOMlXAgZVEdRBzdobe3DPmHEg7Qdw0sjzWw6YpN8=; b=HAEFGyObmUkSEhbIg3uckuS1iDxVf+YX7e7ZCyGd4OZT+EfJpk6Oxw/uWMFggXPX0+6jodZlOIMcW c0Lr0PIhGp2Vs1jRVkniBs/IMSS2kT7lsYbmDcNOMkLruGjhjJhhn+InDrN2eMZD5Q7isWkobJHt0Q krhx+pmaZVIF7hlJIHwqlkuWZ9Qy+C6KTIMhXr+9CuuJYy+0sjmmZ5GnI76lqptuTV5kOrHdL/3kKb e3mk3BRFeLvYMORCURE+R0r5tAzE4UZRyfiecwzmX/ML/y5BUaavSY8sTkXlypg5/6zpL3A9Yjh8IB ZQZnvNMdyQGr32aYRbgoQs4PLhEpwCw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 61b7b4a0-aef1-11e9-b670-c3119635ad0a 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 outbound4.ore.mailhop.org (Halon) with ESMTPSA id 61b7b4a0-aef1-11e9-b670-c3119635ad0a; Thu, 25 Jul 2019 15:32:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x6PFWFRW073383; Thu, 25 Jul 2019 09:32:15 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <62945ba288b96e431b5053167ab8c23f192bcbed.camel@freebsd.org> Subject: Re: svn commit: r349976 - head From: Ian Lepore To: Renato Botelho , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 25 Jul 2019 09:32:15 -0600 In-Reply-To: References: <201907131648.x6DGmRc4090395@repo.freebsd.org> 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: 7284287B05 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.148.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, 25 Jul 2019 15:32:26 -0000 On Thu, 2019-07-25 at 10:27 -0300, Renato Botelho wrote: > On 13/07/19 13:48, Ian Lepore wrote: > > Author: ian > > Date: Sat Jul 13 16:48:27 2019 > > New Revision: 349976 > > URL: https://svnweb.freebsd.org/changeset/base/349976 > > > > Log: > > Add an entry mentioning the permission/mode change to daily > > accounting files. > > > > Modified: > > head/UPDATING > > > > Modified: head/UPDATING > > =================================================================== > > =========== > > --- head/UPDATING Sat Jul 13 16:32:19 2019 (r349975) > > +++ head/UPDATING Sat Jul 13 16:48:27 2019 (r349976) > > @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS > > SLOW: > > disable the most expensive debugging functionality run > > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > > > +20190713: > > + Default permissions on the /var/account/acct file (and copies > > of it rotated > > + by periodic daily scripts) are changed from 0644 to 0640 > > because the file > > + contains sensitive information that should not be world- > > readable. If the > > + /var/account directory must be created by rc.d/accounting, the > > mode used is > > + now 0750. Admins who use the accounting feature are > > encouraged to change > > + the mode of an existing /var/account directory to 0750 or > > 0700. > > Block is indented with 4 spaces instead of tabs > Doh! Must've still had my editor set for the $work coding standards. Fixed in r350324. Thanks! -- Ian From owner-svn-src-all@freebsd.org Thu Jul 25 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 A5673A7826; Thu, 25 Jul 2019 15:43:16 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 863A18829D; Thu, 25 Jul 2019 15:43:16 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C0BEEC7; Thu, 25 Jul 2019 15:43:16 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6PFhGIG028707; Thu, 25 Jul 2019 15:43:16 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PFhGiT028706; Thu, 25 Jul 2019 15:43:16 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201907251543.x6PFhGiT028706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Thu, 25 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: r350325 - in head: lib/libc/sys share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: bjk X-SVN-Commit-Paths: in head: lib/libc/sys share/man/man9 X-SVN-Commit-Revision: 350325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 863A18829D 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.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: Thu, 25 Jul 2019 15:43:16 -0000 Author: bjk (doc committer) Date: Thu Jul 25 15:43:15 2019 New Revision: 350325 URL: https://svnweb.freebsd.org/changeset/base/350325 Log: Fix grammar nit in copy_file_range docs Bytes are countable, so we have fewer of them, not less of them. Modified: head/lib/libc/sys/copy_file_range.2 head/share/man/man9/VOP_COPY_FILE_RANGE.9 Modified: head/lib/libc/sys/copy_file_range.2 ============================================================================== --- head/lib/libc/sys/copy_file_range.2 Thu Jul 25 15:31:15 2019 (r350324) +++ head/lib/libc/sys/copy_file_range.2 Thu Jul 25 15:43:15 2019 (r350325) @@ -110,7 +110,7 @@ arguments and this system call for the data ranges found. .Pp .Sh RETURN VALUES -If it succeeds, the call returns the number of bytes copied, which can be less +If it succeeds, the call returns the number of bytes copied, which can be fewer than .Fa len . .Fn copy_file_range Modified: head/share/man/man9/VOP_COPY_FILE_RANGE.9 ============================================================================== --- head/share/man/man9/VOP_COPY_FILE_RANGE.9 Thu Jul 25 15:31:15 2019 (r350324) +++ head/share/man/man9/VOP_COPY_FILE_RANGE.9 Thu Jul 25 15:43:15 2019 (r350325) @@ -93,7 +93,7 @@ It should be reduced by the number of bytes copied, wh the value pointed to by .Fa len will normally be zero for a non-error return. -However, a copy of less bytes than requested is permitted. +However, a copy of fewer bytes than requested is permitted. .Sh LOCKS The vnode are unlocked on entry and must be unlocked on return. The byte ranges for both From owner-svn-src-all@freebsd.org Thu Jul 25 16:46: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 5F2D1A8C88 for ; Thu, 25 Jul 2019 16:46:11 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (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 C20C98A790 for ; Thu, 25 Jul 2019 16:46:09 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x743.google.com with SMTP id d79so36890446qke.11 for ; Thu, 25 Jul 2019 09:46:09 -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=ajC4ZEUau6mzxRhmOThp55SkQuBmuQLo7sBOHljipXU=; b=Xhw4eRV8C9P6pPN1zJ86xXOcYgJiOKOJYuZ+UNWvHGq+b2S2segbWxB6o90lRKNRqu M19V/COehbKPnwdYqemEXcQ7RQdji3bLlx7U5dF0Op3XwNtas3+Jt2nMorCzOCr1yYPf 8SGaIZk3dc4VO9v1AdPZHg8D8vX8j3DSuQ/6tHwV3C+yVEYTxxL0bzM7RIBtgVAfcBA+ Ab5WBLGJjiSdKbaa87+KKKJXg4BlTAU6qcJGgPXjgPrmvuD5mTW89SPqpWrzye7D27be dUuJaWBigoUDYRD+0nHaHl6Zk1gqV5OSkMM/vYDAtvcCIM0JJY7kylZ+n30WhNkx9kcH FSdg== 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=ajC4ZEUau6mzxRhmOThp55SkQuBmuQLo7sBOHljipXU=; b=nxZQAeaIFZFRmAFUXMAZQkulm6fvCbUTp6R+8BxnnYF7W66jmcDFQ2iWYRefe0AQ5y eVtZ8tSIEDUpYw29PdJE7leBA01pTuF08HMGFgpXsvIPdfphsG+WRCeoKZef7T+4O2i3 JRtpd8WFOrOVG2W/KQqtPZPxTJyGMIYSn5eeQsmMwilFa2LY/+Aw0ZtoUtvJ9qhGmJZC vmpHOyRihP85v4p6ulrT+XKf/9WVrPQ2g1YoYzCopDA7cbc5zgX9a0u3BEkXXHsntWRp tIxoUMBuhzfiluiDNYf8Ab54nwU8qqv3gcCf5Wrbicdy7T+Plnu2eYLYikgYbecV8Hck LZ8A== X-Gm-Message-State: APjAAAVy+onqkectKU8FBwvwZUHVlywja3y7FedPhUisNz3inMUP7dnU XByGKq0waNLZtqGI4KT+vkOggyWgOSbEmQ== X-Google-Smtp-Source: APXvYqxqkS18jS4Y2TYZX01ensDVWydseZ1qs7ffRUFuj4jXYJYPMcMjerttQ1WXaigk4VzNPQudfQ== X-Received: by 2002:a37:6085:: with SMTP id u127mr60446865qkb.25.1564073168818; Thu, 25 Jul 2019 09:46:08 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.108]) by smtp.gmail.com with ESMTPSA id h19sm19121535qto.3.2019.07.25.09.46.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 09:46:08 -0700 (PDT) Date: Thu, 25 Jul 2019 12:46:07 -0400 From: Shawn Webb To: Rick Macklem Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350315 - in head/sys: kern sys Message-ID: <20190725164607.zpa7w2pgrnahaxz4@mutt-hbsd> References: <201907250546.x6P5kHWq076756@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="veokz6vwuek33re7" Content-Disposition: inline In-Reply-To: <201907250546.x6P5kHWq076756@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: C20C98A790 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=Xhw4eRV8; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::743 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-5.58 / 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]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,aspmx2.googlemail.com,alt2.aspmx.l.google.com,aspmx3.googlemail.com]; NEURAL_HAM_SHORT(-0.88)[-0.881,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.59)[ip: (2.64), ipnet: 2607:f8b0::/32(-3.08), asn: 15169(-2.43), country: US(-0.05)]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; URIBL_BLOCKED(0.00)[hardenedbsd.org.multi.uribl.com]; 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.7.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: Thu, 25 Jul 2019 16:46:11 -0000 --veokz6vwuek33re7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Rick, On Thu, Jul 25, 2019 at 05:46:17AM +0000, Rick Macklem wrote: > Author: rmacklem > Date: Thu Jul 25 05:46:16 2019 > New Revision: 350315 > URL: https://svnweb.freebsd.org/changeset/base/350315 >=20 > Log: > Add kernel support for a Linux compatible copy_file_range(2) syscall. > =20 > This patch adds support to the kernel for a Linux compatible > copy_file_range(2) syscall and the related VOP_COPY_FILE_RANGE(9). > This syscall/VOP can be used by the NFSv4.2 client to implement the > Copy operation against an NFSv4.2 server to do file copies locally on > the server. > The vn_generic_copy_file_range() function in this patch can be used > by the NFSv4.2 server to implement the Copy operation. > Fuse may also me able to use the VOP_COPY_FILE_RANGE() method. > =20 > vn_generic_copy_file_range() attempts to maintain holes in the output > file in the range to be copied, but may fail to do so if the input and > output files are on different file systems with different _PC_MIN_HOLE_= SIZE > values. > =20 > Separate commits will be done for the generated syscall files and userl= and > changes. A commit for a compat32 syscall will be done later. > =20 > Reviewed by: kib, asomers (plus comments by brooks, jilles) > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D20584 >=20 > Modified: > head/sys/kern/syscalls.master > head/sys/kern/vfs_default.c > head/sys/kern/vfs_syscalls.c > head/sys/kern/vfs_vnops.c > head/sys/kern/vnode_if.src > head/sys/sys/syscallsubr.h > head/sys/sys/vnode.h >=20 > Modified: head/sys/kern/syscalls.master > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/syscalls.master Thu Jul 25 03:55:05 2019 (r350314) > +++ head/sys/kern/syscalls.master Thu Jul 25 05:46:16 2019 (r350315) > @@ -3175,6 +3175,16 @@ > int flag > ); > } > +569 AUE_NULL STD { > + ssize_t copy_file_range( > + int infd, > + _Inout_opt_ off_t *inoffp, > + int outfd, > + _Inout_opt_ off_t *outoffp, > + size_t len, > + unsigned int flags > + ); > + } > =20 > ; Please copy any additions and changes to the following compatability t= ables: > ; sys/compat/freebsd32/syscalls.master >=20 > Modified: head/sys/kern/vfs_default.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/vfs_default.c Thu Jul 25 03:55:05 2019 (r350314) > +++ head/sys/kern/vfs_default.c Thu Jul 25 05:46:16 2019 (r350315) > @@ -83,6 +83,7 @@ static int dirent_exists(struct vnode *vp, const char= =20 > static int vop_stdis_text(struct vop_is_text_args *ap); > static int vop_stdunset_text(struct vop_unset_text_args *ap); > static int vop_stdadd_writecount(struct vop_add_writecount_args *ap); > +static int vop_stdcopy_file_range(struct vop_copy_file_range_args *ap); > static int vop_stdfdatasync(struct vop_fdatasync_args *ap); > static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); > =20 > @@ -140,6 +141,7 @@ struct vop_vector default_vnodeops =3D { > .vop_set_text =3D vop_stdset_text, > .vop_unset_text =3D vop_stdunset_text, > .vop_add_writecount =3D vop_stdadd_writecount, > + .vop_copy_file_range =3D vop_stdcopy_file_range, > }; > =20 > /* > @@ -1210,6 +1212,17 @@ vfs_stdnosync (mp, waitfor) > { > =20 > return (0); > +} > + > +static int > +vop_stdcopy_file_range(struct vop_copy_file_range_args *ap) > +{ > + int error; > + > + error =3D vn_generic_copy_file_range(ap->a_invp, ap->a_inoffp, > + ap->a_outvp, ap->a_outoffp, ap->a_lenp, ap->a_flags, ap->a_incred, > + ap->a_outcred, ap->a_fsizetd); > + return (error); > } > =20 > int >=20 > Modified: head/sys/kern/vfs_syscalls.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/vfs_syscalls.c Thu Jul 25 03:55:05 2019 (r350314) > +++ head/sys/kern/vfs_syscalls.c Thu Jul 25 05:46:16 2019 (r350315) > @@ -4814,3 +4814,122 @@ sys_posix_fadvise(struct thread *td, struct posix= _fadv > uap->advice); > return (kern_posix_error(td, error)); > } > + > +int > +kern_copy_file_range(struct thread *td, int infd, off_t *inoffp, int out= fd, > + off_t *outoffp, size_t len, unsigned int flags) > +{ > + struct file *infp, *outfp; > + struct vnode *invp, *outvp; > + int error; > + size_t retlen; > + void *rl_rcookie, *rl_wcookie; > + off_t savinoff, savoutoff; > + > + infp =3D outfp =3D NULL; > + rl_rcookie =3D rl_wcookie =3D NULL; > + savinoff =3D -1; > + error =3D 0; > + retlen =3D 0; > + > + if (flags !=3D 0) { > + error =3D EINVAL; > + goto out; > + } > + if (len > SSIZE_MAX) > + /* > + * Although the len argument is size_t, the return argument > + * is ssize_t (which is signed). Therefore a size that won't > + * fit in ssize_t can't be returned. > + */ > + len =3D SSIZE_MAX; > + > + /* Get the file structures for the file descriptors. */ > + error =3D fget_read(td, infd, &cap_read_rights, &infp); > + if (error !=3D 0) > + goto out; > + error =3D fget_write(td, outfd, &cap_write_rights, &outfp); > + if (error !=3D 0) > + goto out; > + > + /* Set the offset pointers to the correct place. */ > + if (inoffp =3D=3D NULL) > + inoffp =3D &infp->f_offset; > + if (outoffp =3D=3D NULL) > + outoffp =3D &outfp->f_offset; > + savinoff =3D *inoffp; > + savoutoff =3D *outoffp; Should these two lines, saving the old inoffp and outoffp, be moved before the two conditionals above? Thanks, --=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 --veokz6vwuek33re7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl053MkACgkQ/y5nonf4 4fr54Q/+PfcJIexfFFDXCQy43PkVrYpTXmNy6vHHf/c8wjgKespkEc9chaQlTWdi HifnyWrxlH+zwSH2+1vLlmhh9GVywUGOoXCUQK5NY+EkQ0QrSBOubA/htGDWuBun GF2GI8o2Fu+cXuy9CkbfwPbSqgv0Bb4VjKkB7v/99A1OcVnbBeZ0grir/xQznazJ GevbVV6SamdDirCECnlbFleapMCwxVJbO+3WpVrygf5JNvAaP0/mCOYgrJIi2wdz HZm+McS/9+k5rk+3lNilYQTIRS9/3zH+3epYOk3r3+9naV3IuuvNHGFvcFTxFlJ4 oOxp1mpu06qu2tsGxihfv26givlFAzxkUjboWUdNQ20MAIRs/qMpxpnr+RpQgV/o UAWtWtct+QhKtK5nY1GwQcYMboseeI+US8l+Qg9/vAuLi+EBCwmBM73Jh0nCBAc+ Ug8RJDb2rUUV2d9kE7updEJkYfWambX7RUXWRKKAtivsFxFzFW5s8izWDrwE6I0l 6OIn9DLtVwZwmlkSlKv71uipuvxcvLpzPoEaWENKhSJF4e4gBRyNF98b10Ea4zx3 X13NE2Y7VNI20+IYuayJ7GpOH4OqnfzaphEtJShvQhFNDK8QbjZSADkMLucRaSOI xCGgyg08PBAvl+XTNa25P1KsXlFoRDTUFi2Nu54TJKPtsN+aoyU= =KYRD -----END PGP SIGNATURE----- --veokz6vwuek33re7-- From owner-svn-src-all@freebsd.org Thu Jul 25 16:49: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 CAA68A8D2A; Thu, 25 Jul 2019 16:49:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 7C82D8A985; Thu, 25 Jul 2019 16:49:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 287C0888B; Thu, 25 Jul 2019 16:49:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-wm1-f51.google.com with SMTP id l2so45337469wmg.0; Thu, 25 Jul 2019 09:49:13 -0700 (PDT) X-Gm-Message-State: APjAAAVufpnQctdcs4vSKIIUBGqrJX2nH/e6WZexVvhuCuZrjw9o+FsS Io5odt3dkQiCX++2q8N6MF36RaK52MFDXGEhBhc= X-Google-Smtp-Source: APXvYqyTipxcHMlygfJCId0nvMzOkYnc+90zTxcpHUDsNLBjmhvRLA41IVVw6fGwWWuwlOgLuWyosPcXUd4t+pMu6wA= X-Received: by 2002:a05:600c:389:: with SMTP id w9mr54900791wmd.139.1564073352135; Thu, 25 Jul 2019 09:49:12 -0700 (PDT) MIME-Version: 1.0 References: <201907250546.x6P5kHWq076756@repo.freebsd.org> <20190725164607.zpa7w2pgrnahaxz4@mutt-hbsd> In-Reply-To: <20190725164607.zpa7w2pgrnahaxz4@mutt-hbsd> From: Kyle Evans Date: Thu, 25 Jul 2019 11:48:39 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r350315 - in head/sys: kern sys To: Shawn Webb Cc: Rick Macklem , svn-src-head , svn-src-all , src-committers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7C82D8A985 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.960,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: Thu, 25 Jul 2019 16:49:13 -0000 On Thu, Jul 25, 2019 at 11:46 AM Shawn Webb wrote: > > Hey Rick, > > On Thu, Jul 25, 2019 at 05:46:17AM +0000, Rick Macklem wrote: > > Author: rmacklem > > Date: Thu Jul 25 05:46:16 2019 > > New Revision: 350315 > > URL: https://svnweb.freebsd.org/changeset/base/350315 > > > > Log: > > Add kernel support for a Linux compatible copy_file_range(2) syscall. > > > > This patch adds support to the kernel for a Linux compatible > > copy_file_range(2) syscall and the related VOP_COPY_FILE_RANGE(9). > > This syscall/VOP can be used by the NFSv4.2 client to implement the > > Copy operation against an NFSv4.2 server to do file copies locally on > > the server. > > The vn_generic_copy_file_range() function in this patch can be used > > by the NFSv4.2 server to implement the Copy operation. > > Fuse may also me able to use the VOP_COPY_FILE_RANGE() method. > > > > vn_generic_copy_file_range() attempts to maintain holes in the output > > file in the range to be copied, but may fail to do so if the input and > > output files are on different file systems with different _PC_MIN_HOLE_SIZE > > values. > > > > Separate commits will be done for the generated syscall files and userland > > changes. A commit for a compat32 syscall will be done later. > > > > Reviewed by: kib, asomers (plus comments by brooks, jilles) > > Relnotes: yes > > Differential Revision: https://reviews.freebsd.org/D20584 > > > > Modified: > > head/sys/kern/syscalls.master > > head/sys/kern/vfs_default.c > > head/sys/kern/vfs_syscalls.c > > head/sys/kern/vfs_vnops.c > > head/sys/kern/vnode_if.src > > head/sys/sys/syscallsubr.h > > head/sys/sys/vnode.h > > > > Modified: head/sys/kern/syscalls.master > > ============================================================================== > > --- head/sys/kern/syscalls.master Thu Jul 25 03:55:05 2019 (r350314) > > +++ head/sys/kern/syscalls.master Thu Jul 25 05:46:16 2019 (r350315) > > @@ -3175,6 +3175,16 @@ > > int flag > > ); > > } > > +569 AUE_NULL STD { > > + ssize_t copy_file_range( > > + int infd, > > + _Inout_opt_ off_t *inoffp, > > + int outfd, > > + _Inout_opt_ off_t *outoffp, > > + size_t len, > > + unsigned int flags > > + ); > > + } > > > > ; Please copy any additions and changes to the following compatability tables: > > ; sys/compat/freebsd32/syscalls.master > > > > Modified: head/sys/kern/vfs_default.c > > ============================================================================== > > --- head/sys/kern/vfs_default.c Thu Jul 25 03:55:05 2019 (r350314) > > +++ head/sys/kern/vfs_default.c Thu Jul 25 05:46:16 2019 (r350315) > > @@ -83,6 +83,7 @@ static int dirent_exists(struct vnode *vp, const char > > static int vop_stdis_text(struct vop_is_text_args *ap); > > static int vop_stdunset_text(struct vop_unset_text_args *ap); > > static int vop_stdadd_writecount(struct vop_add_writecount_args *ap); > > +static int vop_stdcopy_file_range(struct vop_copy_file_range_args *ap); > > static int vop_stdfdatasync(struct vop_fdatasync_args *ap); > > static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); > > > > @@ -140,6 +141,7 @@ struct vop_vector default_vnodeops = { > > .vop_set_text = vop_stdset_text, > > .vop_unset_text = vop_stdunset_text, > > .vop_add_writecount = vop_stdadd_writecount, > > + .vop_copy_file_range = vop_stdcopy_file_range, > > }; > > > > /* > > @@ -1210,6 +1212,17 @@ vfs_stdnosync (mp, waitfor) > > { > > > > return (0); > > +} > > + > > +static int > > +vop_stdcopy_file_range(struct vop_copy_file_range_args *ap) > > +{ > > + int error; > > + > > + error = vn_generic_copy_file_range(ap->a_invp, ap->a_inoffp, > > + ap->a_outvp, ap->a_outoffp, ap->a_lenp, ap->a_flags, ap->a_incred, > > + ap->a_outcred, ap->a_fsizetd); > > + return (error); > > } > > > > int > > > > Modified: head/sys/kern/vfs_syscalls.c > > ============================================================================== > > --- head/sys/kern/vfs_syscalls.c Thu Jul 25 03:55:05 2019 (r350314) > > +++ head/sys/kern/vfs_syscalls.c Thu Jul 25 05:46:16 2019 (r350315) > > @@ -4814,3 +4814,122 @@ sys_posix_fadvise(struct thread *td, struct posix_fadv > > uap->advice); > > return (kern_posix_error(td, error)); > > } > > + > > +int > > +kern_copy_file_range(struct thread *td, int infd, off_t *inoffp, int outfd, > > + off_t *outoffp, size_t len, unsigned int flags) > > +{ > > + struct file *infp, *outfp; > > + struct vnode *invp, *outvp; > > + int error; > > + size_t retlen; > > + void *rl_rcookie, *rl_wcookie; > > + off_t savinoff, savoutoff; > > + > > + infp = outfp = NULL; > > + rl_rcookie = rl_wcookie = NULL; > > + savinoff = -1; > > + error = 0; > > + retlen = 0; > > + > > + if (flags != 0) { > > + error = EINVAL; > > + goto out; > > + } > > + if (len > SSIZE_MAX) > > + /* > > + * Although the len argument is size_t, the return argument > > + * is ssize_t (which is signed). Therefore a size that won't > > + * fit in ssize_t can't be returned. > > + */ > > + len = SSIZE_MAX; > > + > > + /* Get the file structures for the file descriptors. */ > > + error = fget_read(td, infd, &cap_read_rights, &infp); > > + if (error != 0) > > + goto out; > > + error = fget_write(td, outfd, &cap_write_rights, &outfp); > > + if (error != 0) > > + goto out; > > + > > + /* Set the offset pointers to the correct place. */ > > + if (inoffp == NULL) > > + inoffp = &infp->f_offset; > > + if (outoffp == NULL) > > + outoffp = &outfp->f_offset; > > + savinoff = *inoffp; > > + savoutoff = *outoffp; > > Should these two lines, saving the old inoffp and outoffp, be moved > before the two conditionals above? > Dereferencing potentially NULL pointers like that seems like a scary proposition; I think this reads most correctly given the context. From owner-svn-src-all@freebsd.org Thu Jul 25 16:52: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 B514AA8F09 for ; Thu, 25 Jul 2019 16:52:01 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (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 2B9DA8AD38 for ; Thu, 25 Jul 2019 16:52:01 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x743.google.com with SMTP id d15so36919391qkl.4 for ; Thu, 25 Jul 2019 09:52:01 -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=dWW93oLb+m5qC+W+c9J1aPwS1Hn24+hAvGGcws5Va3A=; b=OB7FpbC+3EnvZRmul9cUKCo/kl6yfUx5P0k6e0M7pzStat9W6wNyRzAk4VZ6OWjY1K k1cHaSrEbgi/3sF1T5C+soxlBx4xkla5DlM/yw6rXmNYm3od5efUB4nigVCEOg9psQhk UAAzToL7rX7pOmgnuG8hymrWtKV1gHPm/Ld62C4FQU3yZtsjPzJXDR2+x+BLQSS1j948 iSjY8ZJGY7DitMDSpDlGIQUNHPagcKcFxB4dyF2CkEXGzWhgsogzNGrLCNpr4R+wyzKZ 3WZRJL8WIMmIHXVIprLOu4onODvbqlQLJ30mFPkrlXJdUuVYCYmzqQr0Igi1T9zJ36yt IQFw== 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=dWW93oLb+m5qC+W+c9J1aPwS1Hn24+hAvGGcws5Va3A=; b=RPsFt98XgHstCWR5yJj834ZGp1WFH0XhRL9zesxhFHYn0mWMc+fomp11srCO1AJiQ/ KsUD4rWlCzL0e3wWQpE8hSDPg7HYWoufgsGj7Bmp6KlqBMyc9QWnZehB4NxyO+PzYWiw OmrCaXZrK/Ospo1gSFbVl/fqJsgajHLfTYfD1Lvb+Sns/xxVFD0S7w1OcCaSThDJBOPL sQCgwXQ9Bn3wDvkQaPWNjDew1qd/P7JK8VBg2eCr08Gc2gl9hgA8pLsuw7tZHATHAquE 6k4ctTEL5fZgIlXzGKGfxx3/ubNf7JNlADlB/o2l+91H1DI4z+9g4+/mLMtFfOjQWx42 iE6g== X-Gm-Message-State: APjAAAW+KuYmNM8MIO4G/UsF8+TBWSSyCJwyc1gvkWAbigoTz/Fc0fBe HG3dRcehnynHs9UAhFIm/EA9lQ== X-Google-Smtp-Source: APXvYqzcWjuaCqI+Gmzf4e+iGl5iMZJdb+6MRbkyuKMf7OxKVb7NNj52I9yRKEIZGuWHG7inTe+DAQ== X-Received: by 2002:ae9:e50b:: with SMTP id w11mr57832120qkf.419.1564073520602; Thu, 25 Jul 2019 09:52:00 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.108]) by smtp.gmail.com with ESMTPSA id r40sm30954116qtk.2.2019.07.25.09.51.59 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 09:51:59 -0700 (PDT) Date: Thu, 25 Jul 2019 12:51:59 -0400 From: Shawn Webb To: Kyle Evans Cc: Rick Macklem , svn-src-head , svn-src-all , src-committers Subject: Re: svn commit: r350315 - in head/sys: kern sys Message-ID: <20190725165159.y3zhaafdkrundew2@mutt-hbsd> References: <201907250546.x6P5kHWq076756@repo.freebsd.org> <20190725164607.zpa7w2pgrnahaxz4@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sugm4n5urmhr6ogw" Content-Disposition: inline In-Reply-To: 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: 2B9DA8AD38 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=OB7FpbC+; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::743 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-5.56 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; NEURAL_HAM_SHORT(-0.86)[-0.861,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.59)[ip: (2.60), ipnet: 2607:f8b0::/32(-3.08), asn: 15169(-2.43), country: US(-0.05)]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; URIBL_BLOCKED(0.00)[hardenedbsd.org.multi.uribl.com]; 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.7.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: Thu, 25 Jul 2019 16:52:01 -0000 --sugm4n5urmhr6ogw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 25, 2019 at 11:48:39AM -0500, Kyle Evans wrote: > On Thu, Jul 25, 2019 at 11:46 AM Shawn Webb = wrote: > > > > Hey Rick, > > > > On Thu, Jul 25, 2019 at 05:46:17AM +0000, Rick Macklem wrote: > > > Author: rmacklem > > > Date: Thu Jul 25 05:46:16 2019 > > > New Revision: 350315 > > > URL: https://svnweb.freebsd.org/changeset/base/350315 > > > > > > Log: > > > Add kernel support for a Linux compatible copy_file_range(2) syscal= l. > > > > > > This patch adds support to the kernel for a Linux compatible > > > copy_file_range(2) syscall and the related VOP_COPY_FILE_RANGE(9). > > > This syscall/VOP can be used by the NFSv4.2 client to implement the > > > Copy operation against an NFSv4.2 server to do file copies locally = on > > > the server. > > > The vn_generic_copy_file_range() function in this patch can be used > > > by the NFSv4.2 server to implement the Copy operation. > > > Fuse may also me able to use the VOP_COPY_FILE_RANGE() method. > > > > > > vn_generic_copy_file_range() attempts to maintain holes in the outp= ut > > > file in the range to be copied, but may fail to do so if the input = and > > > output files are on different file systems with different _PC_MIN_H= OLE_SIZE > > > values. > > > > > > Separate commits will be done for the generated syscall files and u= serland > > > changes. A commit for a compat32 syscall will be done later. > > > > > > Reviewed by: kib, asomers (plus comments by brooks, jilles) > > > Relnotes: yes > > > Differential Revision: https://reviews.freebsd.org/D20584 > > > > > > Modified: > > > head/sys/kern/syscalls.master > > > head/sys/kern/vfs_default.c > > > head/sys/kern/vfs_syscalls.c > > > head/sys/kern/vfs_vnops.c > > > head/sys/kern/vnode_if.src > > > head/sys/sys/syscallsubr.h > > > head/sys/sys/vnode.h > > > > > > Modified: head/sys/kern/syscalls.master > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/sys/kern/syscalls.master Thu Jul 25 03:55:05 2019 = (r350314) > > > +++ head/sys/kern/syscalls.master Thu Jul 25 05:46:16 2019 = (r350315) > > > @@ -3175,6 +3175,16 @@ > > > int flag > > > ); > > > } > > > +569 AUE_NULL STD { > > > + ssize_t copy_file_range( > > > + int infd, > > > + _Inout_opt_ off_t *inoffp, > > > + int outfd, > > > + _Inout_opt_ off_t *outoffp, > > > + size_t len, > > > + unsigned int flags > > > + ); > > > + } > > > > > > ; Please copy any additions and changes to the following compatabili= ty tables: > > > ; sys/compat/freebsd32/syscalls.master > > > > > > Modified: head/sys/kern/vfs_default.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/sys/kern/vfs_default.c Thu Jul 25 03:55:05 2019 = (r350314) > > > +++ head/sys/kern/vfs_default.c Thu Jul 25 05:46:16 2019 = (r350315) > > > @@ -83,6 +83,7 @@ static int dirent_exists(struct vnode *vp, const c= har > > > static int vop_stdis_text(struct vop_is_text_args *ap); > > > static int vop_stdunset_text(struct vop_unset_text_args *ap); > > > static int vop_stdadd_writecount(struct vop_add_writecount_args *ap); > > > +static int vop_stdcopy_file_range(struct vop_copy_file_range_args *a= p); > > > static int vop_stdfdatasync(struct vop_fdatasync_args *ap); > > > static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); > > > > > > @@ -140,6 +141,7 @@ struct vop_vector default_vnodeops =3D { > > > .vop_set_text =3D vop_stdset_text, > > > .vop_unset_text =3D vop_stdunset_text, > > > .vop_add_writecount =3D vop_stdadd_writecount, > > > + .vop_copy_file_range =3D vop_stdcopy_file_range, > > > }; > > > > > > /* > > > @@ -1210,6 +1212,17 @@ vfs_stdnosync (mp, waitfor) > > > { > > > > > > return (0); > > > +} > > > + > > > +static int > > > +vop_stdcopy_file_range(struct vop_copy_file_range_args *ap) > > > +{ > > > + int error; > > > + > > > + error =3D vn_generic_copy_file_range(ap->a_invp, ap->a_inoffp, > > > + ap->a_outvp, ap->a_outoffp, ap->a_lenp, ap->a_flags, ap->a_= incred, > > > + ap->a_outcred, ap->a_fsizetd); > > > + return (error); > > > } > > > > > > int > > > > > > Modified: head/sys/kern/vfs_syscalls.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/sys/kern/vfs_syscalls.c Thu Jul 25 03:55:05 2019 = (r350314) > > > +++ head/sys/kern/vfs_syscalls.c Thu Jul 25 05:46:16 2019 = (r350315) > > > @@ -4814,3 +4814,122 @@ sys_posix_fadvise(struct thread *td, struct p= osix_fadv > > > uap->advice); > > > return (kern_posix_error(td, error)); > > > } > > > + > > > +int > > > +kern_copy_file_range(struct thread *td, int infd, off_t *inoffp, int= outfd, > > > + off_t *outoffp, size_t len, unsigned int flags) > > > +{ > > > + struct file *infp, *outfp; > > > + struct vnode *invp, *outvp; > > > + int error; > > > + size_t retlen; > > > + void *rl_rcookie, *rl_wcookie; > > > + off_t savinoff, savoutoff; > > > + > > > + infp =3D outfp =3D NULL; > > > + rl_rcookie =3D rl_wcookie =3D NULL; > > > + savinoff =3D -1; > > > + error =3D 0; > > > + retlen =3D 0; > > > + > > > + if (flags !=3D 0) { > > > + error =3D EINVAL; > > > + goto out; > > > + } > > > + if (len > SSIZE_MAX) > > > + /* > > > + * Although the len argument is size_t, the return argu= ment > > > + * is ssize_t (which is signed). Therefore a size that= won't > > > + * fit in ssize_t can't be returned. > > > + */ > > > + len =3D SSIZE_MAX; > > > + > > > + /* Get the file structures for the file descriptors. */ > > > + error =3D fget_read(td, infd, &cap_read_rights, &infp); > > > + if (error !=3D 0) > > > + goto out; > > > + error =3D fget_write(td, outfd, &cap_write_rights, &outfp); > > > + if (error !=3D 0) > > > + goto out; > > > + > > > + /* Set the offset pointers to the correct place. */ > > > + if (inoffp =3D=3D NULL) > > > + inoffp =3D &infp->f_offset; > > > + if (outoffp =3D=3D NULL) > > > + outoffp =3D &outfp->f_offset; > > > + savinoff =3D *inoffp; > > > + savoutoff =3D *outoffp; > > > > Should these two lines, saving the old inoffp and outoffp, be moved > > before the two conditionals above? > > >=20 > Dereferencing potentially NULL pointers like that seems like a scary > proposition; I think this reads most correctly given the context. Ah, good catch! I missed reading the dereference. Thanks, --=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 --sugm4n5urmhr6ogw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl053i4ACgkQ/y5nonf4 4fpiOg//dxMJ0ROFTnnFFQCmdqNGOAxxV6YOi5MToKu4lE2+eVY6uyoXok1IZ0ay 60orsBakPvo38CrtRNjLo1fgkm14GyHo4c4THGY7T9sPPcYL88hBNSuHs1eMMzOW qSlcwLcpBvRE4xOuAMuHWXF7xLj7iUEnhVYmhaZDYH+sWszElLZ8I7DRctSaF22e S6tkwoQRq1yj0rY/4mTlYxeBvnAyQCWijLxyjllKjVT+aXUI4m01pDRIMFd8O4Me D7cbVHRXyTiwC+SkrfKK0QWbPr+GFdaF7IHyI/Nka/LRCNJatctV0Dw6L6WzUmZP 2w9cBFTSDSfQb2yAesbgHtnotVeHJJNilJQn8QAoZLUd7gl5aPhkHgWhijQcXeA6 G32kpwt80DCEji0UxGK9q5tFEjVe3Jz8BKzPo+QS3+BX5Cv2K+2XLJi+LAbfIN8H E4x7nvmIg/UY7oU/yP2tEB6yKlZjDJr4i1tF8ss7YhXaBAYxFXcv/gm4RJ++141U sxYJsOGmTG/hOqCHh/BADx3sgjVCUn12fnNMBCDfooSpfVbNxII3DN9Fi6N7zPCG 2No8Q0AczdECvA2XYprXGCkODs8Qy05gyf5pxjMIXIky4tiKV4OiQodjuLIXem+M Dywx3w3aHIkAeQ7Grp+I6RYRAk/9rah4b3tid+rNpadeVIMzC1Y= =NzFq -----END PGP SIGNATURE----- --sugm4n5urmhr6ogw-- From owner-svn-src-all@freebsd.org Thu Jul 25 17:10: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 214D0A9589; Thu, 25 Jul 2019 17:10:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 C20998B8C2; Thu, 25 Jul 2019 17:10:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90C561D3F; Thu, 25 Jul 2019 17:10:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6PHAIIe075457; Thu, 25 Jul 2019 17:10:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PHAIqX075455; Thu, 25 Jul 2019 17:10:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907251710.x6PHAIqX075455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 25 Jul 2019 17:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350327 - in head: . lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . lib/libsysdecode X-SVN-Commit-Revision: 350327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C20998B8C2 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.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: Thu, 25 Jul 2019 17:10:19 -0000 Author: emaste Date: Thu Jul 25 17:10:17 2019 New Revision: 350327 URL: https://svnweb.freebsd.org/changeset/base/350327 Log: libsysdecode: use the proper include directory Reported by: cy Reviewed by: lwhsu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21068 Modified: head/Makefile.libcompat head/lib/libsysdecode/Makefile Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Thu Jul 25 16:22:37 2019 (r350326) +++ head/Makefile.libcompat Thu Jul 25 17:10:17 2019 (r350327) @@ -186,7 +186,6 @@ build${libcompat}: .PHONY .endif mkdir -p ${WORLDTMP} ln -sf ${.CURDIR}/sys ${WORLDTMP} - ln -sf ${.CURDIR}/sys ${LIBCOMPATTMP} .for _t in ${_obj} includes .for _dir in ${_LC_INCDIRS} ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATWMAKE} MK_INCLUDES=yes \ Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Thu Jul 25 16:22:37 2019 (r350326) +++ head/lib/libsysdecode/Makefile Thu Jul 25 17:10:17 2019 (r350327) @@ -123,9 +123,10 @@ CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} DEPENDOBJS+= tables.h -tables.h: mktables ${SYSROOT}/sys/netinet/in.h ${SYSROOT}/sys/netinet/tcp.h \ - ${SYSROOT}/sys/netinet6/in6.h - sh ${.CURDIR}/mktables ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} ${.TARGET}.tmp && \ +incdir=${SYSROOT:U${DESTDIR}}${INCLUDEDIR} +tables.h: mktables ${incdir}/netinet/in.h ${incdir}/netinet/tcp.h \ + ${incdir}/netinet6/in6.h + sh ${.CURDIR}/mktables ${incdir} ${.TARGET}.tmp && \ mv -f ${.TARGET}.tmp ${.TARGET} # mkioctls runs find(1) for headers so needs to rebuild every time. This used From owner-svn-src-all@freebsd.org Thu Jul 25 17:20:46 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 1937BA98F3; Thu, 25 Jul 2019 17:20:46 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) 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 18CBF8BFE4; Thu, 25 Jul 2019 17:20:45 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f47.google.com with SMTP id z3so98939068iog.0; Thu, 25 Jul 2019 10:20:45 -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; bh=cYQ5BlIfFuJuj2AnLH3Ua8MtilrJh7ejzZSvFz8XHPk=; b=HbXVHP6u2KB+Vu/+KoNiqU8sgFxIrZDa4bVc0jPAIQ55rXqffSLBU6ilqb1/ZjqUtG 2ayn/PQ0I/Xi06cCKEcheyg67F3G/avWrrJPN02uBeWA/uZSgliv5n32kMRnB7LaX3hB QKYg6jxBlSEDBWGNpY9cWnZgK5AIRbr54cfniP7N6k5DKsbAVfnk2zrfEBox7YZtyotK O77C8eHSp6ADEoEagpUgZCC84ifstKPJEUtG/H2DDu1BIEEoSBlOFPib6bCwcOub9hzB MBS6E1GIDHTr9V2BLq0/k0G7Y75oJMlBvY47VSl/Kj25K3GrIO1xAi2AjULetPzdyVFg nyJw== X-Gm-Message-State: APjAAAXDtNlC53oD3J9iUfB+u+eCE3jKCI3UHMxISAamPLN5ESM/E+G1 JTuKgShgfB0bkBD/vIPmFWQkaIcyPQe+xNSgByyy/quF X-Google-Smtp-Source: APXvYqzUmOs6bh0/pl79XJeXz0NPPF0t+phOEFSvR0FVp4+zdbNBlLhSmbNUFbtBdrCwcIbUiSpoyG1jEv4HkdiyKYA= X-Received: by 2002:a6b:6d07:: with SMTP id a7mr18289875iod.254.1564075242970; Thu, 25 Jul 2019 10:20:42 -0700 (PDT) MIME-Version: 1.0 References: <201907251710.x6PHAIqX075455@repo.freebsd.org> In-Reply-To: <201907251710.x6PHAIqX075455@repo.freebsd.org> From: Ed Maste Date: Thu, 25 Jul 2019 11:41:00 -0400 Message-ID: Subject: Re: svn commit: r350327 - in head: . lib/libsysdecode To: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 18CBF8BFE4 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.47 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-5.38 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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(-2.44)[ip: (-6.27), ipnet: 209.85.128.0/17(-3.42), asn: 15169(-2.43), country: US(-0.05)]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; RCVD_IN_DNSWL_NONE(0.00)[47.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; MIME_TRACE(0.00)[0:+]; 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)[emaste@freebsd.org,carpeddiem@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: Thu, 25 Jul 2019 17:20:46 -0000 On Thu, 25 Jul 2019 at 13:10, Ed Maste wrote: > > Author: emaste > Date: Thu Jul 25 17:10:17 2019 > New Revision: 350327 > URL: https://svnweb.freebsd.org/changeset/base/350327 > > Log: > libsysdecode: use the proper include directory I forgot to mention in the commit message that this reverts lwhsu's initial workaround (r350322). From owner-svn-src-all@freebsd.org Thu Jul 25 17:30: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 7768FA9A27; Thu, 25 Jul 2019 17:30:21 +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 578408C6E0; Thu, 25 Jul 2019 17:30:21 +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 2AC7220C5; Thu, 25 Jul 2019 17:30:21 +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 x6PHUL5i087427; Thu, 25 Jul 2019 17:30:21 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PHUJ5a087420; Thu, 25 Jul 2019 17:30:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907251730.x6PHUJ5a087420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 25 Jul 2019 17:30: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: r350328 - in stable/11/contrib/netbsd-tests/lib/libc: gen stdio sys X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/11/contrib/netbsd-tests/lib/libc: gen stdio sys X-SVN-Commit-Revision: 350328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 578408C6E0 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.954,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, 25 Jul 2019 17:30:21 -0000 Author: brooks Date: Thu Jul 25 17:30:19 2019 New Revision: 350328 URL: https://svnweb.freebsd.org/changeset/base/350328 Log: MFC r350067: 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: stable/11/contrib/netbsd-tests/lib/libc/gen/t_ftok.c stable/11/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_access.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_stat.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_write.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/gen/t_ftok.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/gen/t_ftok.c Thu Jul 25 17:10:17 2019 (r350327) +++ stable/11/contrib/netbsd-tests/lib/libc/gen/t_ftok.c Thu Jul 25 17:30:19 2019 (r350328) @@ -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: stable/11/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c Thu Jul 25 17:10:17 2019 (r350327) +++ stable/11/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c Thu Jul 25 17:30:19 2019 (r350328) @@ -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: stable/11/contrib/netbsd-tests/lib/libc/sys/t_access.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/sys/t_access.c Thu Jul 25 17:10:17 2019 (r350327) +++ stable/11/contrib/netbsd-tests/lib/libc/sys/t_access.c Thu Jul 25 17:30:19 2019 (r350328) @@ -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: stable/11/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c Thu Jul 25 17:10:17 2019 (r350327) +++ stable/11/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c Thu Jul 25 17:30:19 2019 (r350328) @@ -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: stable/11/contrib/netbsd-tests/lib/libc/sys/t_stat.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/sys/t_stat.c Thu Jul 25 17:10:17 2019 (r350327) +++ stable/11/contrib/netbsd-tests/lib/libc/sys/t_stat.c Thu Jul 25 17:30:19 2019 (r350328) @@ -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: stable/11/contrib/netbsd-tests/lib/libc/sys/t_write.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/sys/t_write.c Thu Jul 25 17:10:17 2019 (r350327) +++ stable/11/contrib/netbsd-tests/lib/libc/sys/t_write.c Thu Jul 25 17:30:19 2019 (r350328) @@ -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 Thu Jul 25 17: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 9615AA9C5B; Thu, 25 Jul 2019 17:33:45 +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 7466D8CB4A; Thu, 25 Jul 2019 17:33:45 +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 4D1772295; Thu, 25 Jul 2019 17:33:45 +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 x6PHXj9F093046; Thu, 25 Jul 2019 17:33:45 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PHXjr1093045; Thu, 25 Jul 2019 17:33:45 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907251733.x6PHXjr1093045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 25 Jul 2019 17:33:45 +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: r350329 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 350329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7466D8CB4A 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.951,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, 25 Jul 2019 17:33:45 -0000 Author: brooks Date: Thu Jul 25 17:33:44 2019 New Revision: 350329 URL: https://svnweb.freebsd.org/changeset/base/350329 Log: MFC r350116: 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: stable/12/lib/libc/gen/setmode.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/setmode.3 ============================================================================== --- stable/12/lib/libc/gen/setmode.3 Thu Jul 25 17:30:19 2019 (r350328) +++ stable/12/lib/libc/gen/setmode.3 Thu Jul 25 17:33:44 2019 (r350329) @@ -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 25 18:15: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 34C02AAC94; Thu, 25 Jul 2019 18:15:44 +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 172928E7A3; Thu, 25 Jul 2019 18:15:44 +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 E5CAA29C9; Thu, 25 Jul 2019 18:15: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 x6PIFhXW016564; Thu, 25 Jul 2019 18:15:43 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PIFhKn016563; Thu, 25 Jul 2019 18:15:43 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907251815.x6PIFhKn016563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 25 Jul 2019 18:15: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: r350330 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 350330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 172928E7A3 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.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: Thu, 25 Jul 2019 18:15:44 -0000 Author: brooks Date: Thu Jul 25 18:15:43 2019 New Revision: 350330 URL: https://svnweb.freebsd.org/changeset/base/350330 Log: MFC r350116: 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: stable/11/lib/libc/gen/setmode.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/setmode.3 ============================================================================== --- stable/11/lib/libc/gen/setmode.3 Thu Jul 25 17:33:44 2019 (r350329) +++ stable/11/lib/libc/gen/setmode.3 Thu Jul 25 18:15:43 2019 (r350330) @@ -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 25 18:48: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 4D527AB8AA; Thu, 25 Jul 2019 18:48:33 +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 3AF598FFD6; Thu, 25 Jul 2019 18:48:33 +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 E78DD2F2A; Thu, 25 Jul 2019 18:48:32 +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 x6PImW05034513; Thu, 25 Jul 2019 18:48:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PImVsN034508; Thu, 25 Jul 2019 18:48:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201907251848.x6PImVsN034508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 25 Jul 2019 18:48:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350331 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/sys X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/sys X-SVN-Commit-Revision: 350331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3AF598FFD6 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.971,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, 25 Jul 2019 18:48:33 -0000 Author: mav Date: Thu Jul 25 18:48:31 2019 New Revision: 350331 URL: https://svnweb.freebsd.org/changeset/base/350331 Log: Make `camcontrol sanitize` support also ATA devices. ATA sanitize is functionally identical to SCSI, just uses different initiation commands and status reporting mechanism. While there, make kernel better handle sanitize commands and statuses. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sys/cam/ata/ata_all.c head/sys/cam/scsi/scsi_all.c head/sys/sys/ata.h Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Thu Jul 25 18:15:43 2019 (r350330) +++ head/sbin/camcontrol/camcontrol.8 Thu Jul 25 18:48:31 2019 (r350331) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 22, 2019 +.Dd July 25, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -1276,13 +1276,11 @@ will not be asked about the timeout if a timeout is sp command line. .El .It Ic sanitize -Issue the -.Tn SCSI -SANITIZE command to the named device. +Issue the SANITIZE command to the named device. .Pp .Em WARNING! WARNING! WARNING! .Pp -ALL data in the cache and on the disk will be destroyed or made inaccessible. +ALL data on the disk will be destroyed or made inaccessible. Recovery of the data is not possible. Use extreme caution when issuing this command. .Pp Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Jul 25 18:15:43 2019 (r350330) +++ head/sbin/camcontrol/camcontrol.c Thu Jul 25 18:48:31 2019 (r350331) @@ -347,7 +347,7 @@ static int ratecontrol(struct cam_device *device, int static int scsiformat(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout); -static int scsisanitize(struct cam_device *device, int argc, char **argv, +static int sanitize(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout); static int scsireportluns(struct cam_device *device, int argc, char **argv, @@ -1743,6 +1743,19 @@ atacapprint(struct ata_params *parm) } else { printf("no\n"); } + printf("Sanitize "); + if (parm->multi & ATA_SUPPORT_SANITIZE) { + printf("yes\t\t%s%s%s\n", + parm->multi & ATA_SUPPORT_BLOCK_ERASE_EXT ? "block, " : "", + parm->multi & ATA_SUPPORT_OVERWRITE_EXT ? "overwrite, " : "", + parm->multi & ATA_SUPPORT_CRYPTO_SCRAMBLE_EXT ? "crypto" : ""); + printf("Sanitize - commands allowed %s\n", + parm->multi & ATA_SUPPORT_SANITIZE_ALLOWED ? "yes" : "no"); + printf("Sanitize - antifreeze lock %s\n", + parm->multi & ATA_SUPPORT_ANTIFREEZE_LOCK_EXT ? "yes" : "no"); + } else { + printf("no\n"); + } } static int @@ -1989,6 +2002,11 @@ ata_do_cmd(struct cam_device *device, union ccb *ccb, res->lba_high_exp = res_pass16->lba_high_exp; res->sector_count = res_pass16->sector_count; res->sector_count_exp = res_pass16->sector_count_exp; + ccb->ccb_h.status &= ~CAM_STATUS_MASK; + if (res->status & ATA_STATUS_ERROR) + ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR; + else + ccb->ccb_h.status |= CAM_REQ_CMP; } return (error); @@ -2479,12 +2497,6 @@ ata_do_identify(struct cam_device *device, int retry_c error = 0; } - if (arglist & CAM_ARG_VERBOSE) { - fprintf(stdout, "%s%d: Raw identify data:\n", - device->device_name, device->dev_unit_num); - dump_data(ptr, sizeof(struct ata_params)); - } - /* check for invalid (all zero) response */ if (error != 0) { warnx("Invalid identify response detected"); @@ -2515,6 +2527,12 @@ ataidentify(struct cam_device *device, int retry_count return (1); } + if (arglist & CAM_ARG_VERBOSE) { + printf("%s%d: Raw identify data:\n", + device->device_name, device->dev_unit_num); + dump_data((void*)ident_buf, sizeof(struct ata_params)); + } + if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) { if (ata_read_native_max(device, retry_count, timeout, ccb, ident_buf, &hpasize) != 0) { @@ -6744,15 +6762,184 @@ scsiformat_bailout: } static int -scsisanitize(struct cam_device *device, int argc, char **argv, +sanitize_wait_ata(struct cam_device *device, union ccb *ccb, int quiet) +{ + struct ata_res *res; + int retval; + cam_status status; + u_int val, perc; + + do { + retval = ata_do_cmd(device, + ccb, + /*retries*/1, + /*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_SANITIZE, + /*features*/0x00, /* SANITIZE STATUS EXT */ + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/10000, + /*is48bit*/1); + if (retval < 0) { + warn("error sending CAMIOCOMMAND ioctl"); + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + return (1); + } + + status = ccb->ccb_h.status & CAM_STATUS_MASK; + if (status == CAM_REQ_CMP) { + res = &ccb->ataio.res; + if (res->sector_count_exp & 0x40) { + if (quiet == 0) { + val = (res->lba_mid << 8) + res->lba_low; + perc = 10000 * val; + fprintf(stdout, + "Sanitizing: %u.%02u%% (%d/%d)\r", + (perc / (0x10000 * 100)), + ((perc / 0x10000) % 100), + val, 0x10000); + fflush(stdout); + } + sleep(1); + } else if ((res->sector_count_exp & 0x80) == 0) { + warnx("Sanitize complete with an error. "); + return (1); + } else + break; + + } else if (status != CAM_REQ_CMP && status != CAM_REQUEUE_REQ) { + warnx("Unexpected CAM status %#x", status); + if (arglist & CAM_ARG_VERBOSE) + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + return (1); + } + } while (1); + return (0); +} + +static int +sanitize_wait_scsi(struct cam_device *device, union ccb *ccb, int task_attr, int quiet) +{ + int warnings = 0, retval; + cam_status status; + u_int val, perc; + + do { + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); + + /* + * There's really no need to do error recovery or + * retries here, since we're just going to sit in a + * loop and wait for the device to finish sanitizing. + */ + scsi_test_unit_ready(&ccb->csio, + /* retries */ 0, + /* cbfcnp */ NULL, + /* tag_action */ task_attr, + /* sense_len */ SSD_FULL_SIZE, + /* timeout */ 5000); + + /* Disable freezing the device queue */ + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + + retval = cam_send_ccb(device, ccb); + + /* + * If we get an error from the ioctl, bail out. SCSI + * errors are expected. + */ + if (retval < 0) { + warn("error sending CAMIOCOMMAND ioctl"); + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + return (1); + } + + status = ccb->ccb_h.status & CAM_STATUS_MASK; + if ((status == CAM_SCSI_STATUS_ERROR) && + ((ccb->ccb_h.status & CAM_AUTOSNS_VALID) != 0)) { + struct scsi_sense_data *sense; + int error_code, sense_key, asc, ascq; + + sense = &ccb->csio.sense_data; + scsi_extract_sense_len(sense, ccb->csio.sense_len - + ccb->csio.sense_resid, &error_code, &sense_key, + &asc, &ascq, /*show_errors*/ 1); + + /* + * According to the SCSI-3 spec, a drive that is in the + * middle of a sanitize should return NOT READY with an + * ASC of "logical unit not ready, sanitize in + * progress". The sense key specific bytes will then + * be a progress indicator. + */ + if ((sense_key == SSD_KEY_NOT_READY) + && (asc == 0x04) && (ascq == 0x1b)) { + uint8_t sks[3]; + + if ((scsi_get_sks(sense, ccb->csio.sense_len - + ccb->csio.sense_resid, sks) == 0) + && (quiet == 0)) { + val = scsi_2btoul(&sks[1]); + perc = 10000 * val; + fprintf(stdout, + "Sanitizing: %u.%02u%% (%d/%d)\r", + (perc / (0x10000 * 100)), + ((perc / 0x10000) % 100), + val, 0x10000); + fflush(stdout); + } else if ((quiet == 0) && (++warnings <= 1)) { + warnx("Unexpected SCSI Sense Key " + "Specific value returned " + "during sanitize:"); + scsi_sense_print(device, &ccb->csio, + stderr); + warnx("Unable to print status " + "information, but sanitze will " + "proceed."); + warnx("will exit when sanitize is " + "complete"); + } + sleep(1); + } else { + warnx("Unexpected SCSI error during sanitize"); + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + return (1); + } + + } else if (status != CAM_REQ_CMP && status != CAM_REQUEUE_REQ) { + warnx("Unexpected CAM status %#x", status); + if (arglist & CAM_ARG_VERBOSE) + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + return (1); + } + } while ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP); + return (0); +} + +static int +sanitize(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; u_int8_t action = 0; int c; int ycount = 0, quiet = 0; - int error = 0, retval = 0; - int use_timeout = 10800 * 1000; + int error = 0; + int use_timeout; int immediate = 1; int invert = 0; int passes = 0; @@ -6761,14 +6948,25 @@ scsisanitize(struct cam_device *device, int argc, char const char *pattern = NULL; u_int8_t *data_ptr = NULL; u_int32_t dxfer_len = 0; - u_int8_t byte2 = 0; - int num_warnings = 0; + uint8_t byte2; + uint16_t feature, count; + uint64_t lba; int reportonly = 0; + camcontrol_devtype dt; + /* + * Get the device type, request no I/O be done to do this. + */ + error = get_device_type(device, -1, 0, 0, &dt); + if (error != 0 || (unsigned)dt > CC_DT_UNKNOWN) { + warnx("sanitize: can't get device type"); + return (1); + } + ccb = cam_getccb(device); if (ccb == NULL) { - warnx("scsisanitize: error allocating ccb"); + warnx("sanitize: error allocating ccb"); return (1); } @@ -6789,7 +6987,7 @@ scsisanitize(struct cam_device *device, int argc, char warnx("invalid service operation \"%s\"", optarg); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } break; case 'c': @@ -6797,7 +6995,7 @@ scsisanitize(struct cam_device *device, int argc, char if (passes < 1 || passes > 31) { warnx("invalid passes value %d", passes); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } break; case 'I': @@ -6816,7 +7014,9 @@ scsisanitize(struct cam_device *device, int argc, char reportonly = 1; break; case 'w': - immediate = 0; + /* ATA supports only immediate commands. */ + if (dt == CC_DT_SCSI) + immediate = 0; break; case 'y': ycount++; @@ -6830,7 +7030,7 @@ scsisanitize(struct cam_device *device, int argc, char if (action == 0) { warnx("an action is required"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } else if (action == SSZ_SERVICE_ACTION_OVERWRITE) { struct scsi_sanitize_parameter_list *pl; struct stat sb; @@ -6839,43 +7039,43 @@ scsisanitize(struct cam_device *device, int argc, char if (pattern == NULL) { warnx("overwrite action requires -P argument"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } fd = open(pattern, O_RDONLY); if (fd < 0) { warn("cannot open pattern file %s", pattern); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } if (fstat(fd, &sb) < 0) { warn("cannot stat pattern file %s", pattern); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } sz = sb.st_size; if (sz > SSZPL_MAX_PATTERN_LENGTH) { warnx("pattern file size exceeds maximum value %d", SSZPL_MAX_PATTERN_LENGTH); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } dxfer_len = sizeof(*pl) + sz; data_ptr = calloc(1, dxfer_len); if (data_ptr == NULL) { warnx("cannot allocate parameter list buffer"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } amt = read(fd, data_ptr + sizeof(*pl), sz); if (amt < 0) { warn("cannot read pattern file"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } else if (amt != sz) { warnx("short pattern file read"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } pl = (struct scsi_sanitize_parameter_list *)data_ptr; @@ -6901,7 +7101,7 @@ scsisanitize(struct cam_device *device, int argc, char warnx("%s argument only valid with overwrite " "operation", arg); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } } @@ -6909,26 +7109,41 @@ scsisanitize(struct cam_device *device, int argc, char fprintf(stdout, "You are about to REMOVE ALL DATA from the " "following device:\n"); - error = scsidoinquiry(device, argc, argv, combinedopt, - task_attr, retry_count, timeout); + if (dt == CC_DT_SCSI) { + error = scsidoinquiry(device, argc, argv, combinedopt, + task_attr, retry_count, timeout); + } else if (dt == CC_DT_ATA || dt == CC_DT_SATL) { + struct ata_params *ident_buf; + error = ata_do_identify(device, retry_count, timeout, + ccb, &ident_buf); + if (error == 0) { + printf("%s%d: ", device->device_name, + device->dev_unit_num); + ata_print_ident(ident_buf); + free(ident_buf); + } + } else + error = 1; if (error != 0) { - warnx("scsisanitize: error sending inquiry"); - goto scsisanitize_bailout; + warnx("sanitize: error sending inquiry"); + goto sanitize_bailout; } } if (ycount == 0) { if (!get_confirmation()) { error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } } if (timeout != 0) use_timeout = timeout; + else + use_timeout = (immediate ? 10 : 10800) * 1000; - if (quiet == 0) { + if (immediate == 0 && quiet == 0) { fprintf(stdout, "Current sanitize timeout is %d seconds\n", use_timeout / 1000); } @@ -6938,8 +7153,7 @@ scsisanitize(struct cam_device *device, int argc, char * timeout on the command line, ask them if they want the current * timeout. */ - if ((ycount == 0) - && (timeout == 0)) { + if (immediate == 0 && ycount == 0 && timeout == 0) { char str[1024]; int new_timeout = 0; @@ -6959,33 +7173,76 @@ scsisanitize(struct cam_device *device, int argc, char } } - byte2 = action; - if (ause != 0) - byte2 |= SSZ_UNRESTRICTED_EXIT; - if (immediate != 0) - byte2 |= SSZ_IMMED; + if (dt == CC_DT_SCSI) { + byte2 = action; + if (ause != 0) + byte2 |= SSZ_UNRESTRICTED_EXIT; + if (immediate != 0) + byte2 |= SSZ_IMMED; + scsi_sanitize(&ccb->csio, + /* retries */ retry_count, + /* cbfcnp */ NULL, + /* tag_action */ task_attr, + /* byte2 */ byte2, + /* control */ 0, + /* data_ptr */ data_ptr, + /* dxfer_len */ dxfer_len, + /* sense_len */ SSD_FULL_SIZE, + /* timeout */ use_timeout); - scsi_sanitize(&ccb->csio, - /* retries */ retry_count, - /* cbfcnp */ NULL, - /* tag_action */ task_attr, - /* byte2 */ byte2, - /* control */ 0, - /* data_ptr */ data_ptr, - /* dxfer_len */ dxfer_len, - /* sense_len */ SSD_FULL_SIZE, - /* timeout */ use_timeout); + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (arglist & CAM_ARG_ERR_RECOVER) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + if (cam_send_ccb(device, ccb) < 0) { + warn("error sending sanitize command"); + error = 1; + goto sanitize_bailout; + } + } else if (dt == CC_DT_ATA || dt == CC_DT_SATL) { + if (action == SSZ_SERVICE_ACTION_OVERWRITE) { + feature = 0x14; /* OVERWRITE EXT */ + lba = 0x4F5700000000 | scsi_4btoul(data_ptr + 4); + count = (passes == 0) ? 1 : (passes >= 16) ? 0 : passes; + if (invert) + count |= 0x80; /* INVERT PATTERN */ + if (ause) + count |= 0x10; /* FAILURE MODE */ + } else if (action == SSZ_SERVICE_ACTION_BLOCK_ERASE) { + feature = 0x12; /* BLOCK ERASE EXT */ + lba = 0x0000426B4572; + count = 0; + if (ause) + count |= 0x10; /* FAILURE MODE */ + } else if (action == SSZ_SERVICE_ACTION_CRYPTO_ERASE) { + feature = 0x11; /* CRYPTO SCRAMBLE EXT */ + lba = 0x000043727970; + count = 0; + if (ause) + count |= 0x10; /* FAILURE MODE */ + } else if (action == SSZ_SERVICE_ACTION_EXIT_MODE_FAILURE) { + feature = 0x00; /* SANITIZE STATUS EXT */ + lba = 0; + count = 1; /* CLEAR SANITIZE OPERATION FAILED */ + } else { + error = 1; + goto sanitize_bailout; + } - /* Disable freezing the device queue */ - ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; - - if (arglist & CAM_ARG_ERR_RECOVER) - ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; - - if (cam_send_ccb(device, ccb) < 0) { - warn("error sending sanitize command"); - error = 1; - goto scsisanitize_bailout; + 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_SANITIZE, + /*features*/feature, + /*lba*/lba, + /*sector_count*/count, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/ use_timeout, + /*is48bit*/1); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -7013,7 +7270,7 @@ scsisanitize(struct cam_device *device, int argc, char CAM_EPF_ALL, stderr); } error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } /* @@ -7026,124 +7283,20 @@ scsisanitize(struct cam_device *device, int argc, char if (quiet == 0) { fprintf(stdout, "Sanitize Complete\n"); } - goto scsisanitize_bailout; + goto sanitize_bailout; } doreport: - do { - cam_status status; + if (dt == CC_DT_SCSI) { + error = sanitize_wait_scsi(device, ccb, task_attr, quiet); + } else if (dt == CC_DT_ATA || dt == CC_DT_SATL) { + error = sanitize_wait_ata(device, ccb, quiet); + } else + error = 1; + if (error == 0 && quiet == 0) + fprintf(stdout, "Sanitize Complete \n"); - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - - /* - * There's really no need to do error recovery or - * retries here, since we're just going to sit in a - * loop and wait for the device to finish sanitizing. - */ - scsi_test_unit_ready(&ccb->csio, - /* retries */ 0, - /* cbfcnp */ NULL, - /* tag_action */ task_attr, - /* sense_len */ SSD_FULL_SIZE, - /* timeout */ 5000); - - /* Disable freezing the device queue */ - ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; - - retval = cam_send_ccb(device, ccb); - - /* - * If we get an error from the ioctl, bail out. SCSI - * errors are expected. - */ - if (retval < 0) { - warn("error sending CAMIOCOMMAND ioctl"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - error = 1; - goto scsisanitize_bailout; - } - - status = ccb->ccb_h.status & CAM_STATUS_MASK; - - if ((status != CAM_REQ_CMP) - && (status == CAM_SCSI_STATUS_ERROR) - && ((ccb->ccb_h.status & CAM_AUTOSNS_VALID) != 0)) { - struct scsi_sense_data *sense; - int error_code, sense_key, asc, ascq; - - sense = &ccb->csio.sense_data; - scsi_extract_sense_len(sense, ccb->csio.sense_len - - ccb->csio.sense_resid, &error_code, &sense_key, - &asc, &ascq, /*show_errors*/ 1); - - /* - * According to the SCSI-3 spec, a drive that is in the - * middle of a sanitize should return NOT READY with an - * ASC of "logical unit not ready, sanitize in - * progress". The sense key specific bytes will then - * be a progress indicator. - */ - if ((sense_key == SSD_KEY_NOT_READY) - && (asc == 0x04) && (ascq == 0x1b)) { - uint8_t sks[3]; - - if ((scsi_get_sks(sense, ccb->csio.sense_len - - ccb->csio.sense_resid, sks) == 0) - && (quiet == 0)) { - int val; - u_int64_t percentage; - - val = scsi_2btoul(&sks[1]); - percentage = 10000 * val; - - fprintf(stdout, - "\rSanitizing: %ju.%02u %% " - "(%d/%d) done", - (uintmax_t)(percentage / - (0x10000 * 100)), - (unsigned)((percentage / - 0x10000) % 100), - val, 0x10000); - fflush(stdout); - } else if ((quiet == 0) - && (++num_warnings <= 1)) { - warnx("Unexpected SCSI Sense Key " - "Specific value returned " - "during sanitize:"); - scsi_sense_print(device, &ccb->csio, - stderr); - warnx("Unable to print status " - "information, but sanitze will " - "proceed."); - warnx("will exit when sanitize is " - "complete"); - } - sleep(1); - } else { - warnx("Unexpected SCSI error during sanitize"); - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - error = 1; - goto scsisanitize_bailout; - } - - } else if (status != CAM_REQ_CMP) { - warnx("Unexpected CAM status %#x", status); - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - error = 1; - goto scsisanitize_bailout; - } - } while((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP); - - if (quiet == 0) - fprintf(stdout, "\nSanitize Complete\n"); - -scsisanitize_bailout: +sanitize_bailout: if (fd >= 0) close(fd); if (data_ptr != NULL) @@ -10520,9 +10673,8 @@ main(int argc, char **argv) timeout); break; case CAM_CMD_SANITIZE: - error = scsisanitize(cam_dev, argc, argv, - combinedopt, task_attr, - retry_count, timeout); + error = sanitize(cam_dev, argc, argv, combinedopt, task_attr, + retry_count, timeout); break; case CAM_CMD_PERSIST: error = scsipersist(cam_dev, argc, argv, combinedopt, Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Thu Jul 25 18:15:43 2019 (r350330) +++ head/sys/cam/ata/ata_all.c Thu Jul 25 18:48:31 2019 (r350331) @@ -215,7 +215,16 @@ ata_op_string(struct ata_cmd *cmd) return ("SMART"); case 0xb1: return ("DEVICE CONFIGURATION"); case 0xb2: return ("SET_SECTOR_CONFIGURATION_EXT"); - case 0xb4: return ("SANITIZE_DEVICE"); + case 0xb4: + switch(cmd->features) { + case 0x00: return ("SANITIZE_STATUS_EXT"); + case 0x11: return ("CRYPTO_SCRAMBLE_EXT"); + case 0x12: return ("BLOCK_ERASE_EXT"); + case 0x14: return ("OVERWRITE_EXT"); + case 0x20: return ("SANITIZE_FREEZE_LOCK_EXT"); + case 0x40: return ("SANITIZE_ANTIFREEZE_LOCK_EXT"); + } + return ("SANITIZE_DEVICE"); case 0xc0: return ("CFA_ERASE"); case 0xc4: return ("READ_MUL"); case 0xc5: return ("WRITE_MUL"); Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu Jul 25 18:15:43 2019 (r350330) +++ head/sys/cam/scsi/scsi_all.c Thu Jul 25 18:48:31 2019 (r350331) @@ -379,7 +379,7 @@ static struct op_table_entry scsi_op_codes[] = { { 0x40, D | T | L | P | W | R | O | M | S | C, "CHANGE DEFINITION" }, /* 41 O WRITE SAME(10) */ { 0x41, D, "WRITE SAME(10)" }, - /* 42 O UNMAP */ + /* 42 O UNMAP */ { 0x42, D, "UNMAP" }, /* 42 O READ SUB-CHANNEL */ { 0x42, R, "READ SUB-CHANNEL" }, @@ -394,7 +394,8 @@ static struct op_table_entry scsi_op_codes[] = { { 0x46, R, "GET CONFIGURATION" }, /* 47 O PLAY AUDIO MSF */ { 0x47, R, "PLAY AUDIO MSF" }, - /* 48 */ + /* 48 O SANITIZE */ + { 0x48, D, "SANITIZE" }, /* 49 */ /* 4A M GET EVENT STATUS NOTIFICATION */ { 0x4A, R, "GET EVENT STATUS NOTIFICATION" }, @@ -1162,7 +1163,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x04, 0x1A, SS_RDEF, /* XXX TBD */ "Logical unit not ready, START/STOP UNIT command in progress") }, /* D B */ - { SST(0x04, 0x1B, SS_RDEF, /* XXX TBD */ + { SST(0x04, 0x1B, SS_WAIT | EBUSY, "Logical unit not ready, sanitize in progress") }, /* DT MAEB */ { SST(0x04, 0x1C, SS_START | SSQ_DECREMENT_COUNT | ENXIO, @@ -1453,7 +1454,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x11, 0x14, SS_RDEF, /* XXX TBD */ "Read error - LBA marked bad by application client") }, /* D */ - { SST(0x11, 0x15, SS_RDEF, /* XXX TBD */ + { SST(0x11, 0x15, SS_FATAL | EIO, "Write after sanitize required") }, /* D W O BK */ { SST(0x12, 0x00, SS_RDEF, @@ -2064,7 +2065,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x31, 0x02, SS_RDEF, /* XXX TBD */ "Zoned formatting failed due to spare linking") }, /* D B */ - { SST(0x31, 0x03, SS_RDEF, /* XXX TBD */ + { SST(0x31, 0x03, SS_FATAL | EIO, "SANITIZE command failed") }, /* D W O BK */ { SST(0x32, 0x00, SS_RDEF, Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Thu Jul 25 18:15:43 2019 (r350330) +++ head/sys/sys/ata.h Thu Jul 25 18:48:31 2019 (r350331) @@ -97,6 +97,8 @@ struct ata_params { #define ATA_SUPPORT_OVERWRITE_EXT 0x4000 #define ATA_SUPPORT_CRYPTO_SCRAMBLE_EXT 0x2000 #define ATA_SUPPORT_SANITIZE 0x1000 +#define ATA_SUPPORT_SANITIZE_ALLOWED 0x0800 +#define ATA_SUPPORT_ANTIFREEZE_LOCK_EXT 0x0400 #define ATA_MULTI_VALID 0x0100 /*060*/ u_int16_t lba_size_1; @@ -454,6 +456,7 @@ struct ata_params { #define ATA_ATAPI_IDENTIFY 0xa1 /* get ATAPI params*/ #define ATA_SERVICE 0xa2 /* service command */ #define ATA_SMART_CMD 0xb0 /* SMART command */ +#define ATA_SANITIZE 0xb4 /* sanitize device */ #define ATA_CFA_ERASE 0xc0 /* CFA erase */ #define ATA_READ_MUL 0xc4 /* read multi */ #define ATA_WRITE_MUL 0xc5 /* write multi */ From owner-svn-src-all@freebsd.org Thu Jul 25 20:01: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 475FFAD18D; Thu, 25 Jul 2019 20:01:25 +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 2ADE392DF3; Thu, 25 Jul 2019 20:01:25 +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 C3A573F5E; Thu, 25 Jul 2019 20:01:24 +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 x6PK1OG9076056; Thu, 25 Jul 2019 20:01:24 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PK1ODW076055; Thu, 25 Jul 2019 20:01:24 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907252001.x6PK1ODW076055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 25 Jul 2019 20:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350332 - stable/12/lib/libc/tests/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/lib/libc/tests/gen X-SVN-Commit-Revision: 350332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2ADE392DF3 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.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: Thu, 25 Jul 2019 20:01:25 -0000 Author: brooks Date: Thu Jul 25 20:01:24 2019 New Revision: 350332 URL: https://svnweb.freebsd.org/changeset/base/350332 Log: MFC r350117: Include a mode when creating files with openat(). Reviewed by: asomers Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20989 Modified: stable/12/lib/libc/tests/gen/dir2_test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/tests/gen/dir2_test.c ============================================================================== --- stable/12/lib/libc/tests/gen/dir2_test.c Thu Jul 25 18:48:31 2019 (r350331) +++ stable/12/lib/libc/tests/gen/dir2_test.c Thu Jul 25 20:01:24 2019 (r350332) @@ -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 25 20:11: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 5A768AD550; Thu, 25 Jul 2019 20:11:06 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) (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 1CF9A9336C; Thu, 25 Jul 2019 20:11:05 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-ot1-f54.google.com with SMTP id r21so46935272otq.6; Thu, 25 Jul 2019 13:11:05 -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=jZbO4UoQu6IdwXmPMykTg5tyyfiCuooLcH+15Suenl0=; b=QGESQ5LDaq68FuftDTs8I3vAW0U6UP5ZTVz8H6e0I3e079IRTUXv6wvdZGEtjgEJQQ wwwwpv0YNSd3OryMRtU1niYnJ6ARIWxctDVs/0tGbAj1FbMjkagLP3/15q5mCJ79W/sL AZv9eJnN97qplJvPTdU6OznvC+Q4V+PZlsP1o3ZGceptz4cekchODSCOt3Az6w9K1FT8 3HUpPv/8qi2fXLRH8WJHM95fjs30xTcAS1s0AmkIT0voy+LhWJ0HIXNT4ZCKw+7U+NFa N+NPc/j8aq3KmxUG/0bMYepKy/QPCLNApJWJmUOvo/CNGlXJPyT0mUXlBUmZ04eiyEBJ 4Ygw== X-Gm-Message-State: APjAAAVeyIGbdQxWC+jqhUdur1k0GW71pBKFBv1kropHAz+d7murTwqV KaD8BsGLfJhV7nC7ISt7M5R2qEysEcKoIQDK7UY2fg== X-Google-Smtp-Source: APXvYqw7wsuj6kj3tzBXmUd6g+ryLYwk9IhPCdG/PtAMfzRIfVYB07BYrNwISOGJN/kVmN03oAS9dbO0n8zgOTbmEMo= X-Received: by 2002:a9d:61c9:: with SMTP id h9mr2168778otk.102.1564083652420; Thu, 25 Jul 2019 12:40:52 -0700 (PDT) MIME-Version: 1.0 References: <201907251848.x6PImVsN034508@repo.freebsd.org> In-Reply-To: <201907251848.x6PImVsN034508@repo.freebsd.org> From: Edward Napierala Date: Thu, 25 Jul 2019 20:40:38 +0100 Message-ID: Subject: Re: svn commit: r350331 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/sys To: Alexander Motin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 1CF9A9336C X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of etnapierala@gmail.com designates 209.85.210.54 as permitted sender) smtp.mailfrom=etnapierala@gmail.com X-Spamd-Result: default: False [-4.15 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RWL_MAILSPIKE_GOOD(0.00)[54.210.85.209.rep.mailspike.net : 127.0.0.18]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.25)[ip: (-0.33), ipnet: 209.85.128.0/17(-3.42), asn: 15169(-2.44), country: US(-0.05)]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.90)[-0.899,0]; RCVD_IN_DNSWL_NONE(0.00)[54.210.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[trasz@freebsd.org,etnapierala@gmail.com]; MIME_TRACE(0.00)[0:+]; 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)[trasz@freebsd.org,etnapierala@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: Thu, 25 Jul 2019 20:11:06 -0000 On Thu, 25 Jul 2019 at 19:48, Alexander Motin wrote: > > Author: mav > Date: Thu Jul 25 18:48:31 2019 > New Revision: 350331 > URL: https://svnweb.freebsd.org/changeset/base/350331 > > Log: > Make `camcontrol sanitize` support also ATA devices. > > ATA sanitize is functionally identical to SCSI, just uses different > initiation commands and status reporting mechanism. > > While there, make kernel better handle sanitize commands and statuses. > > MFC after: 2 weeks > Sponsored by: iXsystems, Inc. Relnotes: yes? From owner-svn-src-all@freebsd.org Thu Jul 25 20:14: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 571B1AD732; Thu, 25 Jul 2019 20:14:53 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) (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 8964F9376C; Thu, 25 Jul 2019 20:14:52 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yb1-xb35.google.com with SMTP id d9so12478892ybf.3; Thu, 25 Jul 2019 13:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mHw8X/NDqgHGkY2f7BhW9P7lsDrVAJHIA/OlLYDGtKw=; b=eakzfKvrAbX4JSk/sG6NouyEh4O2F11nZ/N0CIwWgiFREHhJqqSTnB4CsADqDkh5km BlrCPR7/VsXQNoJJrUNnQ59iw36xsCSxzoBs+VvSNVoIm/aXpJhZvumrbfPT5GjiFzbo K2HiojhMSDrDlXsQpFRnFunIniLFtYn/BbMrVN/xlyNxr89+KAYroDTNacguhypDb5fr +gHYrW+pR4+SPtdvd9T96s/amp16DsXC9llLv/ncuOk80s7zSy3UTNp/Gl8klfpMLm+V 1ZhWpAIef0f3ak7XlXRlBPEOw9Q0u44IAmVNbcIpTcCHqDBhPq9l7hTERfaBjKLiQC15 0QgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=mHw8X/NDqgHGkY2f7BhW9P7lsDrVAJHIA/OlLYDGtKw=; b=OyzrxjLm5kb10XPgEs02JP2lker3M6u/2KeCA4a7s40zD6FFUWnQ0/P4FLQo9FLBbG 1sCvpdZtCIvRXbyyrN+/F6ksPL9i9Ys1yEv3oGjcH/6LTf4YPltdav55BY5Bb2nNSJs6 rWKd6j4Mz3Dur7Uz3VVr+dZyaajfnD85dPibnD1SV25Nz0iqr6JhEHRXh3To35H7pSBG qpXFmqXRXILwOG3GA75ZSce5DhW+274xy8gN4BW1IvQTFCJFJn2cbaj9SvO76m3MAfwL /yqvNzFP/M3zXMkNO9WMWhq5goVjnnoQUIH4h4AZhUtgjdnO2+45hcOtoYPtlU101npl wAtw== X-Gm-Message-State: APjAAAXndp0gOPwgyvPCZKhcV49FzYFViJFfVpCSkqavBPcFi2NrT1p7 iotKwVDk1sQ7AJRKX/BHtO/RgCS1 X-Google-Smtp-Source: APXvYqwn2ehG3muoLCjv9uDSFhJ3Dq/Y0W0BfZzWNtbhP1h8gx8NtwIHfZzXfIzqpGuppu/Vqy4/4w== X-Received: by 2002:a25:26cf:: with SMTP id m198mr54593586ybm.381.1564085691431; Thu, 25 Jul 2019 13:14:51 -0700 (PDT) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id d127sm11581796ywb.27.2019.07.25.13.14.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jul 2019 13:14:50 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r350331 - in head: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/sys To: Edward Napierala Cc: src-committers , svn-src-all , svn-src-head References: <201907251848.x6PImVsN034508@repo.freebsd.org> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg== Message-ID: <4a44f15e-f3c2-c53d-8a86-35398bf9c4c0@FreeBSD.org> Date: Thu, 25 Jul 2019 16:14:50 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 8964F9376C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=eakzfKvr; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::b35 as permitted sender) smtp.mailfrom=mavbsd@gmail.com X-Spamd-Result: default: False [-6.19 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-3.01)[ip: (-9.48), ipnet: 2607:f8b0::/32(-3.09), asn: 15169(-2.44), country: US(-0.05)]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[5.3.b.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]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; MID_RHS_MATCH_FROM(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: Thu, 25 Jul 2019 20:14:53 -0000 On 25.07.2019 15:40, Edward Napierala wrote: > On Thu, 25 Jul 2019 at 19:48, Alexander Motin wrote: >> >> Author: mav >> Date: Thu Jul 25 18:48:31 2019 >> New Revision: 350331 >> URL: https://svnweb.freebsd.org/changeset/base/350331 >> >> Log: >> Make `camcontrol sanitize` support also ATA devices. >> >> ATA sanitize is functionally identical to SCSI, just uses different >> initiation commands and status reporting mechanism. >> >> While there, make kernel better handle sanitize commands and statuses. >> >> MFC after: 2 weeks >> Sponsored by: iXsystems, Inc. > > Relnotes: yes? Ah. Sure. Why not. -- Alexander Motin From owner-svn-src-all@freebsd.org Thu Jul 25 20: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 6EBABADA13; Thu, 25 Jul 2019 20:26:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 4D9AE93DBE; Thu, 25 Jul 2019 20:26:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27E7B43BE; Thu, 25 Jul 2019 20:26: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 x6PKQM5B092731; Thu, 25 Jul 2019 20:26:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PKQMIk092730; Thu, 25 Jul 2019 20:26:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907252026.x6PKQMIk092730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 25 Jul 2019 20:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350333 - 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: 350333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D9AE93DBE 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.964,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, 25 Jul 2019 20:26:22 -0000 Author: imp Date: Thu Jul 25 20:26:21 2019 New Revision: 350333 URL: https://svnweb.freebsd.org/changeset/base/350333 Log: Widen the type for to. The timeout field in the CAPS register is defined to be 8 bits, so its type was uint8_t. We recently started adding 1 to it to cope with rogue devices that listed 0 timeout time (which is impossible). However, in so doing, other devices that list 0xff (for a 2 minute timeout) were broken when adding 1 overflowed. Widen the type to be uint32_t like its source register to avoid the issue. Reported by: bapt@ Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Jul 25 20:01:24 2019 (r350332) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Jul 25 20:26:21 2019 (r350333) @@ -1227,7 +1227,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, de struct make_dev_args md_args; uint32_t cap_lo; uint32_t cap_hi; - uint8_t to; + uint32_t to; uint8_t dstrd; uint8_t mpsmin; int status, timeout_period; From owner-svn-src-all@freebsd.org Thu Jul 25 20:34: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 31A1CADDBA; Thu, 25 Jul 2019 20:34: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 142E8943B8; Thu, 25 Jul 2019 20:34: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 E1377458D; Thu, 25 Jul 2019 20:34: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 x6PKYoBd098532; Thu, 25 Jul 2019 20:34:50 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PKYoKE098531; Thu, 25 Jul 2019 20:34:50 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907252034.x6PKYoKE098531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 25 Jul 2019 20:34: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: r350334 - stable/11/lib/libc/tests/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/lib/libc/tests/gen X-SVN-Commit-Revision: 350334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 142E8943B8 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.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: Thu, 25 Jul 2019 20:34:51 -0000 Author: brooks Date: Thu Jul 25 20:34:50 2019 New Revision: 350334 URL: https://svnweb.freebsd.org/changeset/base/350334 Log: MFC r350117: Include a mode when creating files with openat(). Reviewed by: asomers Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20989 Modified: stable/11/lib/libc/tests/gen/dir2_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/tests/gen/dir2_test.c ============================================================================== --- stable/11/lib/libc/tests/gen/dir2_test.c Thu Jul 25 20:26:21 2019 (r350333) +++ stable/11/lib/libc/tests/gen/dir2_test.c Thu Jul 25 20:34:50 2019 (r350334) @@ -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 25 22:02: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 5A3BDAF932; Thu, 25 Jul 2019 22:02:56 +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 3D58997873; Thu, 25 Jul 2019 22:02:56 +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 17FA355BB; Thu, 25 Jul 2019 22:02:56 +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 x6PM2tJx051928; Thu, 25 Jul 2019 22:02:55 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PM2t0i051925; Thu, 25 Jul 2019 22:02:55 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201907252202.x6PM2t0i051925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 25 Jul 2019 22:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350335 - in head/sys: amd64/amd64 arm64/arm64 i386/i386 riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm64/arm64 i386/i386 riscv/riscv X-SVN-Commit-Revision: 350335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D58997873 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.89)[-0.893,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, 25 Jul 2019 22:02:56 -0000 Author: alc Date: Thu Jul 25 22:02:55 2019 New Revision: 350335 URL: https://svnweb.freebsd.org/changeset/base/350335 Log: Simplify the handling of superpages in pmap_clear_modify(). Specifically, if a demotion succeeds, then all of the 4KB page mappings within the superpage-sized region must be valid, so there is no point in testing the validity of the 4KB page mapping that is going to be write protected. Deindent the nearby code. Reviewed by: kib, markj Tested by: pho (amd64, i386) X-MFC after: r350004 (this change depends on arm64 dirty bit emulation) Differential Revision: https://reviews.freebsd.org/D21027 Modified: head/sys/amd64/amd64/pmap.c head/sys/arm64/arm64/pmap.c head/sys/i386/i386/pmap.c head/sys/riscv/riscv/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jul 25 20:34:50 2019 (r350334) +++ head/sys/amd64/amd64/pmap.c Thu Jul 25 22:02:55 2019 (r350335) @@ -7574,7 +7574,7 @@ pmap_clear_modify(vm_page_t m) pmap_t pmap; pv_entry_t next_pv, pv; pd_entry_t oldpde, *pde; - pt_entry_t oldpte, *pte, PG_M, PG_RW, PG_V; + pt_entry_t *pte, PG_M, PG_RW; struct rwlock *lock; vm_offset_t va; int md_gen, pvh_gen; @@ -7610,33 +7610,23 @@ restart: } } PG_M = pmap_modified_bit(pmap); - PG_V = pmap_valid_bit(pmap); PG_RW = pmap_rw_bit(pmap); va = pv->pv_va; pde = pmap_pde(pmap, va); oldpde = *pde; - if ((oldpde & PG_RW) != 0) { - if (pmap_demote_pde_locked(pmap, pde, va, &lock)) { - if ((oldpde & PG_W) == 0) { - /* - * Write protect the mapping to a - * single page so that a subsequent - * write access may repromote. - */ - va += VM_PAGE_TO_PHYS(m) - (oldpde & - PG_PS_FRAME); - pte = pmap_pde_to_pte(pde, va); - oldpte = *pte; - if ((oldpte & PG_V) != 0) { - while (!atomic_cmpset_long(pte, - oldpte, - oldpte & ~(PG_M | PG_RW))) - oldpte = *pte; - vm_page_dirty(m); - pmap_invalidate_page(pmap, va); - } - } - } + /* If oldpde has PG_RW set, then it also has PG_M set. */ + if ((oldpde & PG_RW) != 0 && + pmap_demote_pde_locked(pmap, pde, va, &lock) && + (oldpde & PG_W) == 0) { + /* + * Write protect the mapping to a single page so that + * a subsequent write access may repromote. + */ + va += VM_PAGE_TO_PHYS(m) - (oldpde & PG_PS_FRAME); + pte = pmap_pde_to_pte(pde, va); + atomic_clear_long(pte, PG_M | PG_RW); + vm_page_dirty(m); + pmap_invalidate_page(pmap, va); } PMAP_UNLOCK(pmap); } Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Jul 25 20:34:50 2019 (r350334) +++ head/sys/arm64/arm64/pmap.c Thu Jul 25 22:02:55 2019 (r350335) @@ -4889,28 +4889,22 @@ 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); - } - } - } + /* If oldl2 has ATTR_SW_DBM set, then it is also dirty. */ + if ((oldl2 & ATTR_SW_DBM) != 0 && + pmap_demote_l2_locked(pmap, l2, va, &lock) && + (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); + 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); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jul 25 20:34:50 2019 (r350334) +++ head/sys/i386/i386/pmap.c Thu Jul 25 22:02:55 2019 (r350335) @@ -5280,7 +5280,7 @@ __CONCAT(PMTYPE, clear_modify)(vm_page_t m) pv_entry_t next_pv, pv; pmap_t pmap; pd_entry_t oldpde, *pde; - pt_entry_t oldpte, *pte; + pt_entry_t *pte; vm_offset_t va; KASSERT((m->oflags & VPO_UNMANAGED) == 0, @@ -5307,34 +5307,24 @@ __CONCAT(PMTYPE, clear_modify)(vm_page_t m) PMAP_LOCK(pmap); pde = pmap_pde(pmap, va); oldpde = *pde; - if ((oldpde & PG_RW) != 0) { - if (pmap_demote_pde(pmap, pde, va)) { - if ((oldpde & PG_W) == 0) { - /* - * Write protect the mapping to a - * single page so that a subsequent - * write access may repromote. - */ - va += VM_PAGE_TO_PHYS(m) - (oldpde & - PG_PS_FRAME); - pte = pmap_pte_quick(pmap, va); - oldpte = *pte; - if ((oldpte & PG_V) != 0) { - /* - * Regardless of whether a pte is 32 or 64 bits - * in size, PG_RW and PG_M are among the least - * significant 32 bits. - */ - while (!atomic_cmpset_int((u_int *)pte, - oldpte, - oldpte & ~(PG_M | PG_RW))) - oldpte = *pte; - vm_page_dirty(m); - pmap_invalidate_page_int(pmap, - va); - } - } - } + /* If oldpde has PG_RW set, then it also has PG_M set. */ + if ((oldpde & PG_RW) != 0 && + pmap_demote_pde(pmap, pde, va) && + (oldpde & PG_W) == 0) { + /* + * Write protect the mapping to a single page so that + * a subsequent write access may repromote. + */ + va += VM_PAGE_TO_PHYS(m) - (oldpde & PG_PS_FRAME); + pte = pmap_pte_quick(pmap, va); + /* + * Regardless of whether a pte is 32 or 64 bits + * in size, PG_RW and PG_M are among the least + * significant 32 bits. + */ + atomic_clear_int((u_int *)pte, PG_M | PG_RW); + vm_page_dirty(m); + pmap_invalidate_page_int(pmap, va); } PMAP_UNLOCK(pmap); } Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Jul 25 20:34:50 2019 (r350334) +++ head/sys/riscv/riscv/pmap.c Thu Jul 25 22:02:55 2019 (r350335) @@ -4105,7 +4105,7 @@ pmap_clear_modify(vm_page_t m) pmap_t pmap; pv_entry_t next_pv, pv; pd_entry_t *l2, oldl2; - pt_entry_t *l3, oldl3; + pt_entry_t *l3; vm_offset_t va; int md_gen, pvh_gen; @@ -4143,28 +4143,19 @@ restart: va = pv->pv_va; l2 = pmap_l2(pmap, va); oldl2 = pmap_load(l2); - if ((oldl2 & PTE_W) != 0) { - if (pmap_demote_l2_locked(pmap, l2, va, &lock)) { - if ((oldl2 & PTE_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) - - PTE_TO_PHYS(oldl2); - l3 = pmap_l2_to_l3(l2, va); - oldl3 = pmap_load(l3); - if ((oldl3 & PTE_V) != 0) { - while (!atomic_fcmpset_long(l3, - &oldl3, oldl3 & ~(PTE_D | - PTE_W))) - cpu_spinwait(); - vm_page_dirty(m); - pmap_invalidate_page(pmap, va); - } - } - } + /* If oldl2 has PTE_W set, then it also has PTE_D set. */ + if ((oldl2 & PTE_W) != 0 && + pmap_demote_l2_locked(pmap, l2, va, &lock) && + (oldl2 & PTE_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) - PTE_TO_PHYS(oldl2); + l3 = pmap_l2_to_l3(l2, va); + pmap_clear_bits(l3, PTE_D | PTE_W); + vm_page_dirty(m); + pmap_invalidate_page(pmap, va); } PMAP_UNLOCK(pmap); } From owner-svn-src-all@freebsd.org Thu Jul 25 22:23: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 B5848B008C; Thu, 25 Jul 2019 22:23:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 98C4E68563; Thu, 25 Jul 2019 22:23:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 749B75963; Thu, 25 Jul 2019 22:23:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6PMNZoq063417; Thu, 25 Jul 2019 22:23:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6PMNY9d063415; Thu, 25 Jul 2019 22:23:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201907252223.x6PMNY9d063415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 25 Jul 2019 22:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350336 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 350336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 98C4E68563 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.89)[-0.894,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, 25 Jul 2019 22:23:35 -0000 Author: kevans Date: Thu Jul 25 22:23:34 2019 New Revision: 350336 URL: https://svnweb.freebsd.org/changeset/base/350336 Log: if_tuntap(4): Add TUNGIFNAME This effectively just moves TAPGIFNAME into common ioctl territory. MFC after: 3 days Modified: head/sys/net/if_tap.h head/sys/net/if_tun.h head/sys/net/if_tuntap.c Modified: head/sys/net/if_tap.h ============================================================================== --- head/sys/net/if_tap.h Thu Jul 25 22:02:55 2019 (r350335) +++ head/sys/net/if_tap.h Thu Jul 25 22:23:34 2019 (r350336) @@ -55,7 +55,7 @@ #define TAPGDEBUG TUNGDEBUG #define TAPSIFINFO TUNSIFINFO #define TAPGIFINFO TUNGIFINFO -#define TAPGIFNAME _IOR('t', 93, struct ifreq) +#define TAPGIFNAME TUNGIFNAME /* VMware ioctl's */ #define VMIO_SIOCSIFFLAGS _IOWINT('V', 0) Modified: head/sys/net/if_tun.h ============================================================================== --- head/sys/net/if_tun.h Thu Jul 25 22:02:55 2019 (r350335) +++ head/sys/net/if_tun.h Thu Jul 25 22:23:34 2019 (r350336) @@ -40,6 +40,7 @@ struct tuninfo { #define TUNSIFINFO _IOW('t', 91, struct tuninfo) #define TUNGIFINFO _IOR('t', 92, struct tuninfo) #define TUNSLMODE _IOW('t', 93, int) +#define TUNGIFNAME _IOR('t', 93, struct ifreq) #define TUNSIFMODE _IOW('t', 94, int) #define TUNSIFPID _IO('t', 95) #define TUNSIFHEAD _IOW('t', 96, int) Modified: head/sys/net/if_tuntap.c ============================================================================== --- head/sys/net/if_tuntap.c Thu Jul 25 22:02:55 2019 (r350335) +++ head/sys/net/if_tuntap.c Thu Jul 25 22:23:34 2019 (r350336) @@ -1235,12 +1235,6 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, i if (l2tun) { /* tap specific ioctls */ switch(cmd) { - case TAPGIFNAME: - ifrp = (struct ifreq *)data; - strlcpy(ifrp->ifr_name, TUN2IFP(tp)->if_xname, - IFNAMSIZ); - - return (0); /* VMware/VMnet port ioctl's */ #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD4) @@ -1337,6 +1331,11 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, i } switch (cmd) { + case TUNGIFNAME: + ifrp = (struct ifreq *)data; + strlcpy(ifrp->ifr_name, TUN2IFP(tp)->if_xname, IFNAMSIZ); + + return (0); case TUNSIFINFO: tunp = (struct tuninfo *)data; if (TUN2IFP(tp)->if_type != tunp->type) From owner-svn-src-all@freebsd.org Fri Jul 26 01:35: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 C407BB2E6A; Fri, 26 Jul 2019 01:35:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 A31D16F58F; Fri, 26 Jul 2019 01:35:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 781827AFA; Fri, 26 Jul 2019 01:35:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6Q1Z7Mb074766; Fri, 26 Jul 2019 01:35:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q1Z7gk074764; Fri, 26 Jul 2019 01:35:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201907260135.x6Q1Z7gk074764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 26 Jul 2019 01:35:07 +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: r350338 - in stable: 11/sbin/bectl 11/stand/libsa/zfs 12/sbin/bectl X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sbin/bectl 11/stand/libsa/zfs 12/sbin/bectl X-SVN-Commit-Revision: 350338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A31D16F58F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.915,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, 26 Jul 2019 01:35:07 -0000 Author: kevans Date: Fri Jul 26 01:35:06 2019 New Revision: 350338 URL: https://svnweb.freebsd.org/changeset/base/350338 Log: MFC r348328: bectl(8): Address Coverity complaints CID 1400451: case 0 is missing a break/return and falling through to the default case. waitpid(0, ...) makes little sense in the child, we likely wanted to terminate immediately. CID 1400453: size argument uses sizeof(char **) instead of sizeof(char *) and is assigned to a char **; sizeof's match but "this isn't a portable assumption". CID: 1400451, 1400453 Modified: stable/11/sbin/bectl/bectl_jail.c stable/11/stand/libsa/zfs/zfs.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sbin/bectl/bectl_jail.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sbin/bectl/bectl_jail.c ============================================================================== --- stable/11/sbin/bectl/bectl_jail.c Fri Jul 26 00:27:47 2019 (r350337) +++ stable/11/sbin/bectl/bectl_jail.c Fri Jul 26 01:35:06 2019 (r350338) @@ -155,7 +155,7 @@ build_jailcmd(char ***argvp, bool interactive, int arg nargv += argc; } - jargv = *argvp = calloc(nargv, sizeof(jargv)); + jargv = *argvp = calloc(nargv, sizeof(*jargv)); if (jargv == NULL) err(2, "calloc"); @@ -346,6 +346,7 @@ bectl_cmd_jail(int argc, char *argv[]) case 0: execv("/usr/sbin/jail", jargv); fprintf(stderr, "bectl jail: failed to execute\n"); + return (1); default: waitpid(pid, NULL, 0); } Modified: stable/11/stand/libsa/zfs/zfs.c ============================================================================== --- stable/11/stand/libsa/zfs/zfs.c Fri Jul 26 00:27:47 2019 (r350337) +++ stable/11/stand/libsa/zfs/zfs.c Fri Jul 26 01:35:06 2019 (r350338) @@ -578,11 +578,10 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid pa.fd = open(devname, O_RDONLY); if (pa.fd == -1) return (ENXIO); - /* - * We will not probe the whole disk, we can not boot from such - * disks and some systems will misreport the disk sizes and will - * hang while accessing the disk. - */ + /* Probe the whole disk */ + ret = zfs_probe(pa.fd, pool_guid); + if (ret == 0) + return (0); if (archsw.arch_getdev((void **)&dev, devname, NULL) == 0) { int partition = dev->d_partition; int slice = dev->d_slice; From owner-svn-src-all@freebsd.org Fri Jul 26 01:35: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 10EB3B2E6F; Fri, 26 Jul 2019 01:35:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 E6B966F590; Fri, 26 Jul 2019 01:35:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C12E27AFB; Fri, 26 Jul 2019 01:35:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6Q1Z7Du074772; Fri, 26 Jul 2019 01:35:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q1Z7u3074771; Fri, 26 Jul 2019 01:35:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201907260135.x6Q1Z7u3074771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 26 Jul 2019 01:35: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: r350338 - in stable: 11/sbin/bectl 11/stand/libsa/zfs 12/sbin/bectl X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sbin/bectl 11/stand/libsa/zfs 12/sbin/bectl X-SVN-Commit-Revision: 350338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E6B966F590 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.915,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, 26 Jul 2019 01:35:08 -0000 Author: kevans Date: Fri Jul 26 01:35:06 2019 New Revision: 350338 URL: https://svnweb.freebsd.org/changeset/base/350338 Log: MFC r348328: bectl(8): Address Coverity complaints CID 1400451: case 0 is missing a break/return and falling through to the default case. waitpid(0, ...) makes little sense in the child, we likely wanted to terminate immediately. CID 1400453: size argument uses sizeof(char **) instead of sizeof(char *) and is assigned to a char **; sizeof's match but "this isn't a portable assumption". CID: 1400451, 1400453 Modified: stable/12/sbin/bectl/bectl_jail.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sbin/bectl/bectl_jail.c stable/11/stand/libsa/zfs/zfs.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sbin/bectl/bectl_jail.c ============================================================================== --- stable/12/sbin/bectl/bectl_jail.c Fri Jul 26 00:27:47 2019 (r350337) +++ stable/12/sbin/bectl/bectl_jail.c Fri Jul 26 01:35:06 2019 (r350338) @@ -155,7 +155,7 @@ build_jailcmd(char ***argvp, bool interactive, int arg nargv += argc; } - jargv = *argvp = calloc(nargv, sizeof(jargv)); + jargv = *argvp = calloc(nargv, sizeof(*jargv)); if (jargv == NULL) err(2, "calloc"); @@ -346,6 +346,7 @@ bectl_cmd_jail(int argc, char *argv[]) case 0: execv("/usr/sbin/jail", jargv); fprintf(stderr, "bectl jail: failed to execute\n"); + return (1); default: waitpid(pid, NULL, 0); } From owner-svn-src-all@freebsd.org Fri Jul 26 01:38: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 41C66B2FCB; Fri, 26 Jul 2019 01:38:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 239EC6F87D; Fri, 26 Jul 2019 01:38:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13AE77AFC; Fri, 26 Jul 2019 01:38:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6Q1cOoj074978; Fri, 26 Jul 2019 01:38:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q1cOWp074976; Fri, 26 Jul 2019 01:38:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201907260138.x6Q1cOWp074976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 26 Jul 2019 01:38: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: r350339 - in stable/11: sbin/bectl stand/libsa/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: sbin/bectl stand/libsa/zfs X-SVN-Commit-Revision: 350339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 239EC6F87D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.915,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, 26 Jul 2019 01:38:25 -0000 Author: kevans Date: Fri Jul 26 01:38:24 2019 New Revision: 350339 URL: https://svnweb.freebsd.org/changeset/base/350339 Log: Partial revert r350338: stable/11 part The stand/libsa changes were not supposed to ride along with this revision; backing out the stable/11 part and re-applying the MFC. Pointy hat: kevans Modified: stable/11/sbin/bectl/bectl_jail.c stable/11/stand/libsa/zfs/zfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/bectl/bectl_jail.c ============================================================================== --- stable/11/sbin/bectl/bectl_jail.c Fri Jul 26 01:35:06 2019 (r350338) +++ stable/11/sbin/bectl/bectl_jail.c Fri Jul 26 01:38:24 2019 (r350339) @@ -155,7 +155,7 @@ build_jailcmd(char ***argvp, bool interactive, int arg nargv += argc; } - jargv = *argvp = calloc(nargv, sizeof(*jargv)); + jargv = *argvp = calloc(nargv, sizeof(jargv)); if (jargv == NULL) err(2, "calloc"); @@ -346,7 +346,6 @@ bectl_cmd_jail(int argc, char *argv[]) case 0: execv("/usr/sbin/jail", jargv); fprintf(stderr, "bectl jail: failed to execute\n"); - return (1); default: waitpid(pid, NULL, 0); } Modified: stable/11/stand/libsa/zfs/zfs.c ============================================================================== --- stable/11/stand/libsa/zfs/zfs.c Fri Jul 26 01:35:06 2019 (r350338) +++ stable/11/stand/libsa/zfs/zfs.c Fri Jul 26 01:38:24 2019 (r350339) @@ -578,10 +578,11 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid pa.fd = open(devname, O_RDONLY); if (pa.fd == -1) return (ENXIO); - /* Probe the whole disk */ - ret = zfs_probe(pa.fd, pool_guid); - if (ret == 0) - return (0); + /* + * We will not probe the whole disk, we can not boot from such + * disks and some systems will misreport the disk sizes and will + * hang while accessing the disk. + */ if (archsw.arch_getdev((void **)&dev, devname, NULL) == 0) { int partition = dev->d_partition; int slice = dev->d_slice; From owner-svn-src-all@freebsd.org Fri Jul 26 01:42: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 887D7B31AF; Fri, 26 Jul 2019 01:42:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 664226FC83; Fri, 26 Jul 2019 01:42:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35C617CC1; Fri, 26 Jul 2019 01:42:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6Q1gPrF080829; Fri, 26 Jul 2019 01:42:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q1gPpF080828; Fri, 26 Jul 2019 01:42:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201907260142.x6Q1gPpF080828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 26 Jul 2019 01:42:25 +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: r350340 - stable/11/sbin/bectl X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sbin/bectl X-SVN-Commit-Revision: 350340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 664226FC83 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.915,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, 26 Jul 2019 01:42:25 -0000 Author: kevans Date: Fri Jul 26 01:42:24 2019 New Revision: 350340 URL: https://svnweb.freebsd.org/changeset/base/350340 Log: MFC r348328: bectl(8): Address Coverity complaints CID 1400451: case 0 is missing a break/return and falling through to the default case. waitpid(0, ...) makes little sense in the child, we likely wanted to terminate immediately. CID 1400453: size argument uses sizeof(char **) instead of sizeof(char *) and is assigned to a char **; sizeof's match but "this isn't a portable assumption". CID: 1400451, 1400453 Modified: stable/11/sbin/bectl/bectl_jail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/bectl/bectl_jail.c ============================================================================== --- stable/11/sbin/bectl/bectl_jail.c Fri Jul 26 01:38:24 2019 (r350339) +++ stable/11/sbin/bectl/bectl_jail.c Fri Jul 26 01:42:24 2019 (r350340) @@ -155,7 +155,7 @@ build_jailcmd(char ***argvp, bool interactive, int arg nargv += argc; } - jargv = *argvp = calloc(nargv, sizeof(jargv)); + jargv = *argvp = calloc(nargv, sizeof(*jargv)); if (jargv == NULL) err(2, "calloc"); @@ -346,6 +346,7 @@ bectl_cmd_jail(int argc, char *argv[]) case 0: execv("/usr/sbin/jail", jargv); fprintf(stderr, "bectl jail: failed to execute\n"); + return (1); default: waitpid(pid, NULL, 0); } From owner-svn-src-all@freebsd.org Fri Jul 26 01: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 53BD9B3259; Fri, 26 Jul 2019 01:45:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 3617E6FE54; Fri, 26 Jul 2019 01:45:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02EE57CCC; Fri, 26 Jul 2019 01:45:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6Q1j0KK081044; Fri, 26 Jul 2019 01:45:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q1j00Z081043; Fri, 26 Jul 2019 01:45:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201907260145.x6Q1j00Z081043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 26 Jul 2019 01:45: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: r350341 - stable/12/stand/libsa/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/stand/libsa/zfs X-SVN-Commit-Revision: 350341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3617E6FE54 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.918,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, 26 Jul 2019 01:45:01 -0000 Author: kevans Date: Fri Jul 26 01:45:00 2019 New Revision: 350341 URL: https://svnweb.freebsd.org/changeset/base/350341 Log: MFC r344226, r344234: stand: zfs memory corruption bug r344226: Fix memory corruption bug introduced in r325310 The bug occurred when a bounce buffer was used and the requested read size was greater than the size of the bounce buffer. This commit also rewrites the read logic so that it is easier to systematically verify all alignment and size cases. r344234: It turns out r344226 narrowed the overrun bug but did not eliminate it entirely This commit fixes a remaining output buffer overrun in the single-sector case when there is a non-zero tail. Modified: stable/12/stand/libsa/zfs/zfs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/libsa/zfs/zfs.c ============================================================================== --- stable/12/stand/libsa/zfs/zfs.c Fri Jul 26 01:42:24 2019 (r350340) +++ stable/12/stand/libsa/zfs/zfs.c Fri Jul 26 01:45:00 2019 (r350341) @@ -363,51 +363,100 @@ static int vdev_read(vdev_t *vdev, void *priv, off_t offset, void *buf, size_t bytes) { int fd, ret; - size_t res, size, remainder, rb_size, blksz; - unsigned secsz; - off_t off; - char *bouncebuf, *rb_buf; + size_t res, head, tail, total_size, full_sec_size; + unsigned secsz, do_tail_read; + off_t start_sec; + char *outbuf, *bouncebuf; fd = (uintptr_t) priv; + outbuf = (char *) buf; bouncebuf = NULL; ret = ioctl(fd, DIOCGSECTORSIZE, &secsz); if (ret != 0) return (ret); - off = offset / secsz; - remainder = offset % secsz; - if (lseek(fd, off * secsz, SEEK_SET) == -1) - return (errno); + /* + * Handling reads of arbitrary offset and size - multi-sector case + * and single-sector case. + * + * Multi-sector Case + * (do_tail_read = true if tail > 0) + * + * |<----------------------total_size--------------------->| + * | | + * |<--head-->|<--------------bytes------------>|<--tail-->| + * | | | | + * | | |<~full_sec_size~>| | | + * +------------------+ +------------------+ + * | |0101010| . . . |0101011| | + * +------------------+ +------------------+ + * start_sec start_sec + n + * + * + * Single-sector Case + * (do_tail_read = false) + * + * |<------total_size = secsz----->| + * | | + * |<-head->|<---bytes--->|<-tail->| + * +-------------------------------+ + * | |0101010101010| | + * +-------------------------------+ + * start_sec + */ + start_sec = offset / secsz; + head = offset % secsz; + total_size = roundup2(head + bytes, secsz); + tail = total_size - (head + bytes); + do_tail_read = ((tail > 0) && (head + bytes > secsz)); + full_sec_size = total_size; + if (head > 0) + full_sec_size -= secsz; + if (do_tail_read) + full_sec_size -= secsz; - rb_buf = buf; - rb_size = bytes; - size = roundup2(bytes + remainder, secsz); - blksz = size; - if (remainder != 0 || size != bytes) { + /* Return of partial sector data requires a bounce buffer. */ + if ((head > 0) || do_tail_read) { bouncebuf = zfs_alloc(secsz); if (bouncebuf == NULL) { printf("vdev_read: out of memory\n"); return (ENOMEM); } - rb_buf = bouncebuf; - blksz = rb_size - remainder; } - while (bytes > 0) { - res = read(fd, rb_buf, rb_size); - if (res != rb_size) { + if (lseek(fd, start_sec * secsz, SEEK_SET) == -1) + return (errno); + + /* Partial data return from first sector */ + if (head > 0) { + res = read(fd, bouncebuf, secsz); + if (res != secsz) { ret = EIO; goto error; } - if (bytes < blksz) - blksz = bytes; - if (bouncebuf != NULL) - memcpy(buf, rb_buf + remainder, blksz); - buf = (void *)((uintptr_t)buf + blksz); - bytes -= blksz; - remainder = 0; - blksz = rb_size; + memcpy(outbuf, bouncebuf + head, min(secsz - head, bytes)); + outbuf += min(secsz - head, bytes); + } + + /* Full data return from read sectors */ + if (full_sec_size > 0) { + res = read(fd, outbuf, full_sec_size); + if (res != full_sec_size) { + ret = EIO; + goto error; + } + outbuf += full_sec_size; + } + + /* Partial data return from last sector */ + if (do_tail_read) { + res = read(fd, bouncebuf, secsz); + if (res != secsz) { + ret = EIO; + goto error; + } + memcpy(outbuf, bouncebuf, secsz - tail); } ret = 0; From owner-svn-src-all@freebsd.org Fri Jul 26 01:47: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 854D1B32E7; Fri, 26 Jul 2019 01:47:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 673E56FFE5; Fri, 26 Jul 2019 01:47:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A0C87CCE; Fri, 26 Jul 2019 01:47:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6Q1lLfT081199; Fri, 26 Jul 2019 01:47:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q1lLJf081198; Fri, 26 Jul 2019 01:47:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201907260147.x6Q1lLJf081198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 26 Jul 2019 01:47:21 +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: r350342 - in stable: 11/stand/libsa/zfs 12/stand/libsa/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/stand/libsa/zfs 12/stand/libsa/zfs X-SVN-Commit-Revision: 350342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 673E56FFE5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.915,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, 26 Jul 2019 01:47:21 -0000 Author: kevans Date: Fri Jul 26 01:47:20 2019 New Revision: 350342 URL: https://svnweb.freebsd.org/changeset/base/350342 Log: MFC r348471: stand: zfs: Free bouncebuf on error path in vdev_read r344226 inadvertently added this path in which we return from failure on an lseek and do not free bouncebuf on the way out. Modified: stable/11/stand/libsa/zfs/zfs.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/stand/libsa/zfs/zfs.c Directory Properties: stable/12/ (props changed) Modified: stable/11/stand/libsa/zfs/zfs.c ============================================================================== --- stable/11/stand/libsa/zfs/zfs.c Fri Jul 26 01:45:00 2019 (r350341) +++ stable/11/stand/libsa/zfs/zfs.c Fri Jul 26 01:47:20 2019 (r350342) @@ -425,8 +425,10 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void } } - if (lseek(fd, start_sec * secsz, SEEK_SET) == -1) - return (errno); + if (lseek(fd, start_sec * secsz, SEEK_SET) == -1) { + ret = errno; + goto error; + } /* Partial data return from first sector */ if (head > 0) { From owner-svn-src-all@freebsd.org Fri Jul 26 01:47: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 C7D44B32EB; Fri, 26 Jul 2019 01:47:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 AA8E16FFE6; Fri, 26 Jul 2019 01:47:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8623A7CCF; Fri, 26 Jul 2019 01:47:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6Q1lLku081205; Fri, 26 Jul 2019 01:47:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q1lL3G081204; Fri, 26 Jul 2019 01:47:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201907260147.x6Q1lL3G081204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 26 Jul 2019 01:47: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: r350342 - in stable: 11/stand/libsa/zfs 12/stand/libsa/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/stand/libsa/zfs 12/stand/libsa/zfs X-SVN-Commit-Revision: 350342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA8E16FFE6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.915,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, 26 Jul 2019 01:47:21 -0000 Author: kevans Date: Fri Jul 26 01:47:20 2019 New Revision: 350342 URL: https://svnweb.freebsd.org/changeset/base/350342 Log: MFC r348471: stand: zfs: Free bouncebuf on error path in vdev_read r344226 inadvertently added this path in which we return from failure on an lseek and do not free bouncebuf on the way out. Modified: stable/12/stand/libsa/zfs/zfs.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/stand/libsa/zfs/zfs.c Directory Properties: stable/11/ (props changed) Modified: stable/12/stand/libsa/zfs/zfs.c ============================================================================== --- stable/12/stand/libsa/zfs/zfs.c Fri Jul 26 01:45:00 2019 (r350341) +++ stable/12/stand/libsa/zfs/zfs.c Fri Jul 26 01:47:20 2019 (r350342) @@ -425,8 +425,10 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void } } - if (lseek(fd, start_sec * secsz, SEEK_SET) == -1) - return (errno); + if (lseek(fd, start_sec * secsz, SEEK_SET) == -1) { + ret = errno; + goto error; + } /* Partial data return from first sector */ if (head > 0) { From owner-svn-src-all@freebsd.org Fri Jul 26 01:49: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 DC2ECB3406; Fri, 26 Jul 2019 01:49:29 +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 BD85A70297; Fri, 26 Jul 2019 01:49:29 +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 9A0797CD1; Fri, 26 Jul 2019 01:49:29 +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 x6Q1nTX7081374; Fri, 26 Jul 2019 01:49:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q1nTZc081372; Fri, 26 Jul 2019 01:49:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201907260149.x6Q1nTZc081372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 26 Jul 2019 01:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350343 - in head/sys/cam: ctl scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/cam: ctl scsi X-SVN-Commit-Revision: 350343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BD85A70297 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.927,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, 26 Jul 2019 01:49:29 -0000 Author: mav Date: Fri Jul 26 01:49:28 2019 New Revision: 350343 URL: https://svnweb.freebsd.org/changeset/base/350343 Log: Add reporting of SCSI Feature Sets VPD page from SPC-5. CTL implements all defined feature sets except Drive Maintenance 2016, which is not very applicable to such a virtual device, and implemented only partially now. But may be it could be fixed later at least for completeness. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Jul 26 01:47:20 2019 (r350342) +++ head/sys/cam/ctl/ctl.c Fri Jul 26 01:49:28 2019 (r350343) @@ -448,10 +448,11 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, max_ports, CTLFLAG /* * Supported pages (0x00), Serial number (0x80), Device ID (0x83), * Extended INQUIRY Data (0x86), Mode Page Policy (0x87), - * SCSI Ports (0x88), Third-party Copy (0x8F), Block limits (0xB0), - * Block Device Characteristics (0xB1) and Logical Block Provisioning (0xB2) + * SCSI Ports (0x88), Third-party Copy (0x8F), SCSI Feature Sets (0x92), + * Block limits (0xB0), Block Device Characteristics (0xB1) and + * Logical Block Provisioning (0xB2) */ -#define SCSI_EVPD_NUM_SUPPORTED_PAGES 10 +#define SCSI_EVPD_NUM_SUPPORTED_PAGES 11 static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event, int param); @@ -489,6 +490,7 @@ static int ctl_inquiry_evpd_eid(struct ctl_scsiio *cts static int ctl_inquiry_evpd_mpp(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_scsi_ports(struct ctl_scsiio *ctsio, int alloc_len); +static int ctl_inquiry_evpd_sfs(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_bdc(struct ctl_scsiio *ctsio, int alloc_len); @@ -9318,6 +9320,8 @@ ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, i pages->page_list[p++] = SVPD_SCSI_PORTS; /* Third-party Copy */ pages->page_list[p++] = SVPD_SCSI_TPC; + /* SCSI Feature Sets */ + pages->page_list[p++] = SVPD_SCSI_SFS; if (lun != NULL && lun->be_lun->lun_type == T_DIRECT) { /* Block limits */ pages->page_list[p++] = SVPD_BLOCK_LIMITS; @@ -9699,6 +9703,58 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_scsiio *ctsio, } static int +ctl_inquiry_evpd_sfs(struct ctl_scsiio *ctsio, int alloc_len) +{ + struct ctl_lun *lun = CTL_LUN(ctsio); + struct scsi_vpd_sfs *sfs_ptr; + int sfs_page_size, n; + + sfs_page_size = sizeof(*sfs_ptr) + 5 * 2; + ctsio->kern_data_ptr = malloc(sfs_page_size, M_CTL, M_WAITOK | M_ZERO); + sfs_ptr = (struct scsi_vpd_sfs *)ctsio->kern_data_ptr; + ctsio->kern_sg_entries = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(sfs_page_size, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; + + /* + * The control device is always connected. The disk device, on the + * other hand, may not be online all the time. Need to change this + * to figure out whether the disk device is actually online or not. + */ + if (lun != NULL) + sfs_ptr->device = (SID_QUAL_LU_CONNECTED << 5) | + lun->be_lun->lun_type; + else + sfs_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; + + sfs_ptr->page_code = SVPD_SCSI_SFS; + n = 0; + /* Discovery 2016 */ + scsi_ulto2b(0x0001, &sfs_ptr->codes[2 * n++]); + if (lun != NULL && lun->be_lun->lun_type == T_DIRECT) { + /* SBC Base 2016 */ + scsi_ulto2b(0x0101, &sfs_ptr->codes[2 * n++]); + /* SBC Base 2010 */ + scsi_ulto2b(0x0102, &sfs_ptr->codes[2 * n++]); + if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { + /* Basic Provisioning 2016 */ + scsi_ulto2b(0x0103, &sfs_ptr->codes[2 * n++]); + } + /* Drive Maintenance 2016 */ + //scsi_ulto2b(0x0104, &sfs_ptr->codes[2 * n++]); + } + scsi_ulto2b(4 + 2 * n, sfs_ptr->page_length); + + ctl_set_success(ctsio); + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); +} + +static int ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len) { struct ctl_lun *lun = CTL_LUN(ctsio); @@ -9811,7 +9867,7 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio *ctsio, int all else i = 0; bdc_ptr->wab_wac_ff = (i & 0x0f); - bdc_ptr->flags = SVPD_FUAB | SVPD_VBULS; + bdc_ptr->flags = SVPD_RBWZ | SVPD_FUAB | SVPD_VBULS; ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -9903,6 +9959,9 @@ ctl_inquiry_evpd(struct ctl_scsiio *ctsio) break; case SVPD_SCSI_TPC: retval = ctl_inquiry_evpd_tpc(ctsio, alloc_len); + break; + case SVPD_SCSI_SFS: + retval = ctl_inquiry_evpd_sfs(ctsio, alloc_len); break; case SVPD_BLOCK_LIMITS: if (lun == NULL || lun->be_lun->lun_type != T_DIRECT) Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Fri Jul 26 01:47:20 2019 (r350342) +++ head/sys/cam/scsi/scsi_all.h Fri Jul 26 01:49:28 2019 (r350343) @@ -2763,6 +2763,19 @@ struct scsi_vpd_tpc }; /* + * SCSI Feature Sets VPD Page + */ +struct scsi_vpd_sfs +{ + uint8_t device; + uint8_t page_code; +#define SVPD_SCSI_SFS 0x92 + uint8_t page_length[2]; + uint8_t reserved[4]; + uint8_t codes[]; +}; + +/* * Block Device Characteristics VPD Page based on * T10/1799-D Revision 31 */ @@ -2803,11 +2816,15 @@ struct scsi_vpd_block_device_characteristics uint8_t flags; #define SVPD_VBULS 0x01 #define SVPD_FUAB 0x02 +#define SVPD_BOCS 0x04 +#define SVPD_RBWZ 0x08 #define SVPD_ZBC_NR 0x00 /* Not Reported */ #define SVPD_HAW_ZBC 0x10 /* Host Aware */ #define SVPD_DM_ZBC 0x20 /* Drive Managed */ #define SVPD_ZBC_MASK 0x30 /* Zoned mask */ - uint8_t reserved[55]; + uint8_t reserved[3]; + uint8_t depopulation_time[4]; + uint8_t reserved2[48]; }; #define SBDC_IS_PRESENT(bdc, length, field) \ From owner-svn-src-all@freebsd.org Fri Jul 26 01:49: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 458AAB345D; Fri, 26 Jul 2019 01:49:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 22362703E4; Fri, 26 Jul 2019 01:49:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF9D07CD2; Fri, 26 Jul 2019 01:49:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6Q1nwax081438; Fri, 26 Jul 2019 01:49:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q1nwD0081435; Fri, 26 Jul 2019 01:49:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201907260149.x6Q1nwD0081435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 26 Jul 2019 01:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350344 - in stable: 11/lib/libbe 11/sbin/bectl 11/sbin/bectl/tests 12/lib/libbe 12/sbin/bectl 12/sbin/bectl/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libbe 11/sbin/bectl 11/sbin/bectl/tests 12/lib/libbe 12/sbin/bectl 12/sbin/bectl/tests X-SVN-Commit-Revision: 350344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22362703E4 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.918,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, 26 Jul 2019 01:49:59 -0000 Author: kevans Date: Fri Jul 26 01:49:58 2019 New Revision: 350344 URL: https://svnweb.freebsd.org/changeset/base/350344 Log: MFC r349380, r349383, r349455: bectl(8)/libbe(3) fixes r349380: libbe(3): mount: the BE dataset is mounted at / Other parts of libbe(3) were fairly strict on the mountpoint property of the BE dataset, and be_mount was not much better. It was improved in r347027 to allow mountpoint=none for depth==0, but this bit was still sensitive to mountpoint != / and mountpoint != none. Given that other parts of libbe(3) no longer restrict the mountpoint property here, and the rest of the base system is generally OK and will assume that a BE is mounted at /, let's do the same. r349383: libbe(3): restructure be_mount, skip canmount check for BE dataset Further cleanup after r349380; loader and kernel will both ignore canmount on the root dataset as well, so we should not be so strict about it when mounting it. be_mount is restructured to make it more clear that depth==0 is special, and to not try fetching these properties that we won't care about. r349455: bectl(8): create non-recursive boot environments bectl advertises that it has the ability to create recursive and non-recursive boot environments. This patch implements that functionality using the be_create_depth API provided by libbe. With this patch, bectl now works as bectl(8) describes in regards to creating recursive/non-recursive boot environments. Modified: stable/11/lib/libbe/be_access.c stable/11/sbin/bectl/bectl.c stable/11/sbin/bectl/tests/bectl_test.sh Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libbe/be_access.c stable/12/sbin/bectl/bectl.c stable/12/sbin/bectl/tests/bectl_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libbe/be_access.c ============================================================================== --- stable/11/lib/libbe/be_access.c Fri Jul 26 01:49:28 2019 (r350343) +++ stable/11/lib/libbe/be_access.c Fri Jul 26 01:49:58 2019 (r350344) @@ -89,25 +89,31 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) return (0); } - if (zfs_prop_get_int(zfs_hdl, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_OFF) - return (0); + /* + * canmount and mountpoint are both ignored for the BE dataset, because + * the rest of the system (kernel and loader) will effectively do the + * same. + */ + if (info->depth == 0) { + snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); + } else { + if (zfs_prop_get_int(zfs_hdl, ZFS_PROP_CANMOUNT) == + ZFS_CANMOUNT_OFF) + return (0); - if (zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, zfs_mnt, BE_MAXPATHLEN, - NULL, NULL, 0, 1)) - return (1); + if (zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, zfs_mnt, + BE_MAXPATHLEN, NULL, NULL, 0, 1)) + return (1); - if (strcmp("none", zfs_mnt) == 0) { /* - * mountpoint=none; we'll mount it at info->mountpoint assuming - * we're at the root. If we're not at the root, we're likely - * at some intermediate dataset (e.g. zroot/var) that will have - * children that may need to be mounted. + * We've encountered mountpoint=none at some intermediate + * dataset (e.g. zroot/var) that will have children that may + * need to be mounted. Skip mounting it, but iterate through + * the children. */ - if (info->depth > 0) + if (strcmp("none", zfs_mnt) == 0) goto skipmount; - snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); - } else { mountpoint = be_mountpoint_augmented(info->lbh, zfs_mnt); snprintf(tmp, BE_MAXPATHLEN, "%s%s", info->mountpoint, mountpoint); Modified: stable/11/sbin/bectl/bectl.c ============================================================================== --- stable/11/sbin/bectl/bectl.c Fri Jul 26 01:49:28 2019 (r350343) +++ stable/11/sbin/bectl/bectl.c Fri Jul 26 01:49:58 2019 (r350344) @@ -184,7 +184,8 @@ bectl_cmd_activate(int argc, char *argv[]) static int bectl_cmd_create(int argc, char *argv[]) { - char *atpos, *bootenv, *snapname, *source; + char snapshot[BE_MAXPATHLEN]; + char *atpos, *bootenv, *snapname; int err, opt; bool recursive; @@ -214,6 +215,8 @@ bectl_cmd_create(int argc, char *argv[]) } bootenv = *argv; + + err = BE_ERR_SUCCESS; if ((atpos = strchr(bootenv, '@')) != NULL) { /* * This is the "create a snapshot variant". No new boot @@ -221,24 +224,22 @@ bectl_cmd_create(int argc, char *argv[]) */ *atpos++ = '\0'; err = be_snapshot(be, bootenv, atpos, recursive, NULL); - } else if (snapname != NULL) { - if (strchr(snapname, '@') != NULL) - err = be_create_from_existing_snap(be, bootenv, - snapname); - else - err = be_create_from_existing(be, bootenv, snapname); } else { - if ((snapname = strchr(bootenv, '@')) != NULL) { - *(snapname++) = '\0'; - if ((err = be_snapshot(be, be_active_path(be), - snapname, true, NULL)) != BE_ERR_SUCCESS) - fprintf(stderr, "failed to create snapshot\n"); - asprintf(&source, "%s@%s", be_active_path(be), snapname); - err = be_create_from_existing_snap(be, bootenv, - source); - return (err); - } else - err = be_create(be, bootenv); + if (snapname == NULL) + /* Create from currently booted BE */ + err = be_snapshot(be, be_active_path(be), NULL, + recursive, snapshot); + else if (strchr(snapname, '@') != NULL) + /* Create from given snapshot */ + strlcpy(snapshot, snapname, sizeof(snapshot)); + else + /* Create from given BE */ + err = be_snapshot(be, snapname, NULL, recursive, + snapshot); + + if (err == BE_ERR_SUCCESS) + err = be_create_depth(be, bootenv, snapshot, + recursive == true ? -1 : 0); } switch (err) { Modified: stable/11/sbin/bectl/tests/bectl_test.sh ============================================================================== --- stable/11/sbin/bectl/tests/bectl_test.sh Fri Jul 26 01:49:28 2019 (r350343) +++ stable/11/sbin/bectl/tests/bectl_test.sh Fri Jul 26 01:49:58 2019 (r350344) @@ -99,11 +99,35 @@ bectl_create_body() mount=${cwd}/mnt bectl_create_setup ${zpool} ${disk} ${mount} + + # Create a child dataset that will be used to test creation + # of recursive and non-recursive boot environments. + atf_check zfs create -o mountpoint=/usr -o canmount=noauto \ + ${zpool}/ROOT/default/usr + # Test standard creation, creation of a snapshot, and creation from a # snapshot. atf_check bectl -r ${zpool}/ROOT create -e default default2 atf_check bectl -r ${zpool}/ROOT create default2@test_snap atf_check bectl -r ${zpool}/ROOT create -e default2@test_snap default3 + + # Test standard creation, creation of a snapshot, and creation from a + # snapshot for recursive boot environments. + atf_check bectl -r ${zpool}/ROOT create -r -e default recursive + atf_check bectl -r ${zpool}/ROOT create -r recursive@test_snap + atf_check bectl -r ${zpool}/ROOT create -r -e recursive@test_snap recursive-snap + + # Test that non-recursive boot environments have no child datasets. + atf_check -e not-empty -s not-exit:0 \ + zfs list "${zpool}/ROOT/default2/usr" + atf_check -e not-empty -s not-exit:0 \ + zfs list "${zpool}/ROOT/default3/usr" + + # Test that recursive boot environments have child datasets. + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/recursive/usr" + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/recursive-snap/usr" } bectl_create_cleanup() { From owner-svn-src-all@freebsd.org Fri Jul 26 01:49: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 F0E41B3463; Fri, 26 Jul 2019 01:49:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 CD9E7703E5; Fri, 26 Jul 2019 01:49:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A51377CD3; Fri, 26 Jul 2019 01:49:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6Q1nxSU081446; Fri, 26 Jul 2019 01:49:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q1nx0K081444; Fri, 26 Jul 2019 01:49:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201907260149.x6Q1nx0K081444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 26 Jul 2019 01:49: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: r350344 - in stable: 11/lib/libbe 11/sbin/bectl 11/sbin/bectl/tests 12/lib/libbe 12/sbin/bectl 12/sbin/bectl/tests X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libbe 11/sbin/bectl 11/sbin/bectl/tests 12/lib/libbe 12/sbin/bectl 12/sbin/bectl/tests X-SVN-Commit-Revision: 350344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CD9E7703E5 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.918,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, 26 Jul 2019 01:50:00 -0000 Author: kevans Date: Fri Jul 26 01:49:58 2019 New Revision: 350344 URL: https://svnweb.freebsd.org/changeset/base/350344 Log: MFC r349380, r349383, r349455: bectl(8)/libbe(3) fixes r349380: libbe(3): mount: the BE dataset is mounted at / Other parts of libbe(3) were fairly strict on the mountpoint property of the BE dataset, and be_mount was not much better. It was improved in r347027 to allow mountpoint=none for depth==0, but this bit was still sensitive to mountpoint != / and mountpoint != none. Given that other parts of libbe(3) no longer restrict the mountpoint property here, and the rest of the base system is generally OK and will assume that a BE is mounted at /, let's do the same. r349383: libbe(3): restructure be_mount, skip canmount check for BE dataset Further cleanup after r349380; loader and kernel will both ignore canmount on the root dataset as well, so we should not be so strict about it when mounting it. be_mount is restructured to make it more clear that depth==0 is special, and to not try fetching these properties that we won't care about. r349455: bectl(8): create non-recursive boot environments bectl advertises that it has the ability to create recursive and non-recursive boot environments. This patch implements that functionality using the be_create_depth API provided by libbe. With this patch, bectl now works as bectl(8) describes in regards to creating recursive/non-recursive boot environments. Modified: stable/12/lib/libbe/be_access.c stable/12/sbin/bectl/bectl.c stable/12/sbin/bectl/tests/bectl_test.sh Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libbe/be_access.c stable/11/sbin/bectl/bectl.c stable/11/sbin/bectl/tests/bectl_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libbe/be_access.c ============================================================================== --- stable/12/lib/libbe/be_access.c Fri Jul 26 01:49:28 2019 (r350343) +++ stable/12/lib/libbe/be_access.c Fri Jul 26 01:49:58 2019 (r350344) @@ -89,25 +89,31 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) return (0); } - if (zfs_prop_get_int(zfs_hdl, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_OFF) - return (0); + /* + * canmount and mountpoint are both ignored for the BE dataset, because + * the rest of the system (kernel and loader) will effectively do the + * same. + */ + if (info->depth == 0) { + snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); + } else { + if (zfs_prop_get_int(zfs_hdl, ZFS_PROP_CANMOUNT) == + ZFS_CANMOUNT_OFF) + return (0); - if (zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, zfs_mnt, BE_MAXPATHLEN, - NULL, NULL, 0, 1)) - return (1); + if (zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, zfs_mnt, + BE_MAXPATHLEN, NULL, NULL, 0, 1)) + return (1); - if (strcmp("none", zfs_mnt) == 0) { /* - * mountpoint=none; we'll mount it at info->mountpoint assuming - * we're at the root. If we're not at the root, we're likely - * at some intermediate dataset (e.g. zroot/var) that will have - * children that may need to be mounted. + * We've encountered mountpoint=none at some intermediate + * dataset (e.g. zroot/var) that will have children that may + * need to be mounted. Skip mounting it, but iterate through + * the children. */ - if (info->depth > 0) + if (strcmp("none", zfs_mnt) == 0) goto skipmount; - snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); - } else { mountpoint = be_mountpoint_augmented(info->lbh, zfs_mnt); snprintf(tmp, BE_MAXPATHLEN, "%s%s", info->mountpoint, mountpoint); Modified: stable/12/sbin/bectl/bectl.c ============================================================================== --- stable/12/sbin/bectl/bectl.c Fri Jul 26 01:49:28 2019 (r350343) +++ stable/12/sbin/bectl/bectl.c Fri Jul 26 01:49:58 2019 (r350344) @@ -184,7 +184,8 @@ bectl_cmd_activate(int argc, char *argv[]) static int bectl_cmd_create(int argc, char *argv[]) { - char *atpos, *bootenv, *snapname, *source; + char snapshot[BE_MAXPATHLEN]; + char *atpos, *bootenv, *snapname; int err, opt; bool recursive; @@ -214,6 +215,8 @@ bectl_cmd_create(int argc, char *argv[]) } bootenv = *argv; + + err = BE_ERR_SUCCESS; if ((atpos = strchr(bootenv, '@')) != NULL) { /* * This is the "create a snapshot variant". No new boot @@ -221,24 +224,22 @@ bectl_cmd_create(int argc, char *argv[]) */ *atpos++ = '\0'; err = be_snapshot(be, bootenv, atpos, recursive, NULL); - } else if (snapname != NULL) { - if (strchr(snapname, '@') != NULL) - err = be_create_from_existing_snap(be, bootenv, - snapname); - else - err = be_create_from_existing(be, bootenv, snapname); } else { - if ((snapname = strchr(bootenv, '@')) != NULL) { - *(snapname++) = '\0'; - if ((err = be_snapshot(be, be_active_path(be), - snapname, true, NULL)) != BE_ERR_SUCCESS) - fprintf(stderr, "failed to create snapshot\n"); - asprintf(&source, "%s@%s", be_active_path(be), snapname); - err = be_create_from_existing_snap(be, bootenv, - source); - return (err); - } else - err = be_create(be, bootenv); + if (snapname == NULL) + /* Create from currently booted BE */ + err = be_snapshot(be, be_active_path(be), NULL, + recursive, snapshot); + else if (strchr(snapname, '@') != NULL) + /* Create from given snapshot */ + strlcpy(snapshot, snapname, sizeof(snapshot)); + else + /* Create from given BE */ + err = be_snapshot(be, snapname, NULL, recursive, + snapshot); + + if (err == BE_ERR_SUCCESS) + err = be_create_depth(be, bootenv, snapshot, + recursive == true ? -1 : 0); } switch (err) { Modified: stable/12/sbin/bectl/tests/bectl_test.sh ============================================================================== --- stable/12/sbin/bectl/tests/bectl_test.sh Fri Jul 26 01:49:28 2019 (r350343) +++ stable/12/sbin/bectl/tests/bectl_test.sh Fri Jul 26 01:49:58 2019 (r350344) @@ -99,11 +99,35 @@ bectl_create_body() mount=${cwd}/mnt bectl_create_setup ${zpool} ${disk} ${mount} + + # Create a child dataset that will be used to test creation + # of recursive and non-recursive boot environments. + atf_check zfs create -o mountpoint=/usr -o canmount=noauto \ + ${zpool}/ROOT/default/usr + # Test standard creation, creation of a snapshot, and creation from a # snapshot. atf_check bectl -r ${zpool}/ROOT create -e default default2 atf_check bectl -r ${zpool}/ROOT create default2@test_snap atf_check bectl -r ${zpool}/ROOT create -e default2@test_snap default3 + + # Test standard creation, creation of a snapshot, and creation from a + # snapshot for recursive boot environments. + atf_check bectl -r ${zpool}/ROOT create -r -e default recursive + atf_check bectl -r ${zpool}/ROOT create -r recursive@test_snap + atf_check bectl -r ${zpool}/ROOT create -r -e recursive@test_snap recursive-snap + + # Test that non-recursive boot environments have no child datasets. + atf_check -e not-empty -s not-exit:0 \ + zfs list "${zpool}/ROOT/default2/usr" + atf_check -e not-empty -s not-exit:0 \ + zfs list "${zpool}/ROOT/default3/usr" + + # Test that recursive boot environments have child datasets. + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/recursive/usr" + atf_check -o not-empty \ + zfs list "${zpool}/ROOT/recursive-snap/usr" } bectl_create_cleanup() { From owner-svn-src-all@freebsd.org Fri Jul 26 02:49: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 30646B4056; Fri, 26 Jul 2019 02:49:38 +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 150A371F72; Fri, 26 Jul 2019 02:49:38 +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 E02188769; Fri, 26 Jul 2019 02:49: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 x6Q2nbDJ016287; Fri, 26 Jul 2019 02:49:37 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q2nZwq016273; Fri, 26 Jul 2019 02:49:35 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907260249.x6Q2nZwq016273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 26 Jul 2019 02:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350345 - stable/11/contrib/tcp_wrappers X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/contrib/tcp_wrappers X-SVN-Commit-Revision: 350345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 150A371F72 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.948,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, 26 Jul 2019 02:49:38 -0000 Author: brooks Date: Fri Jul 26 02:49:34 2019 New Revision: 350345 URL: https://svnweb.freebsd.org/changeset/base/350345 Log: MFC r316803,320033,338277,350098,350100-350101 r316803: tcp_wrappers: Sprinkle some bounds-checked string copying Reported by: Coverity CIDs: 1006710, 1006804 Sponsored by: Dell EMC Isilon r320033: TCP Wrappers: tcpdchk (tcp wrapper configuration checker) and tcpdmatch (tcp wrapper oracle) warning fixes via edits to the C code files contrib/tcp_wrappers/fakelog.c Warnings for each of functions: openlog( ), vsyslog( ), VARARGS( ), closelog( ) warning: type specifier missing, defaults to 'int' [-Wimplicit-int] warning: control reaches end of non-void function [-Wreturn-type] Fixes: Explicitly added specification of function type to void for each function, suppressing both warnings for each function listed contrib/tcp_wrappers/inetcf.c Warnings: warning: incompativle redeclaration of library function 'malloc' note: 'malloc' is a builtin with type 'void *(unsigned long)' warning: implicit declaration of function 'check_path' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Removed redeclaration of malloc on line 21 Included library in the code which contains the malloc( ) function in it's library Included scaffold.h header file in the code that contains check-path( ) function contrib/tcp_wrappers/scaffold.c Warnings: warning: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Wimplicit-function-declaration] note: include the header or explicitly provide a declaration for 'exit' Fixes: Included in the code which contains the exit( ) function in it's library contrib/tcp_wrappers/tcpdchk.c Warnings: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration] warning: implicit declaration of function 'atoi' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Included the specific function library to the code Included to the code which contains the atoi( ) function in the library contrib/tcp_wrappers/tcpdmatch.c Warnings: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Included to the code which contains the getopt( ) function in the library Submitted by: Aaron Prieger Reviewed by: vangyzen Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D10995 r338277: Reduce the log level of tcpd_warn calls from ERR to WARNING. This matches the name and avoids logging of warnings to console with default syslog.conf, esp. getting rid of: warning: /etc/hosts.allow, line ..: can't verify hostname: \ getaddrinfo(.., AF_INET) failed r350098: Use ANSI C function definitions and declerations. Obtained from: CheriBSD Sponsored by: DARPA, AFRL r350100: Use headers instead of manual declerations of standard functions and variables. Obtained from: CheriBSD Sponsored by: DARPA, AFRL r350101: 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 Sponsored by: DARPA, AFRL Modified: stable/11/contrib/tcp_wrappers/diag.c stable/11/contrib/tcp_wrappers/fakelog.c stable/11/contrib/tcp_wrappers/hosts_access.c stable/11/contrib/tcp_wrappers/inetcf.c stable/11/contrib/tcp_wrappers/inetcf.h stable/11/contrib/tcp_wrappers/mystdarg.h stable/11/contrib/tcp_wrappers/options.c stable/11/contrib/tcp_wrappers/rfc931.c stable/11/contrib/tcp_wrappers/scaffold.c stable/11/contrib/tcp_wrappers/scaffold.h stable/11/contrib/tcp_wrappers/shell_cmd.c stable/11/contrib/tcp_wrappers/socket.c stable/11/contrib/tcp_wrappers/tcpd.c stable/11/contrib/tcp_wrappers/tcpdchk.c stable/11/contrib/tcp_wrappers/tcpdmatch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tcp_wrappers/diag.c ============================================================================== --- stable/11/contrib/tcp_wrappers/diag.c Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/diag.c Fri Jul 26 02:49:34 2019 (r350345) @@ -52,7 +52,7 @@ void VARARGS(tcpd_warn, char *, format) va_list ap; VASTART(ap, char *, format); - tcpd_diag(LOG_ERR, "warning", format, ap); + tcpd_diag(LOG_WARNING, "warning", format, ap); VAEND(ap); } Modified: stable/11/contrib/tcp_wrappers/fakelog.c ============================================================================== --- stable/11/contrib/tcp_wrappers/fakelog.c Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/fakelog.c Fri Jul 26 02:49:34 2019 (r350345) @@ -17,7 +17,7 @@ static char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17 /* ARGSUSED */ -openlog(name, logopt, facility) +void openlog(name, logopt, facility) char *name; int logopt; int facility; @@ -27,7 +27,7 @@ int facility; /* vsyslog - format one record */ -vsyslog(severity, fmt, ap) +void vsyslog(severity, fmt, ap) int severity; char *fmt; va_list ap; @@ -43,7 +43,7 @@ va_list ap; /* VARARGS */ -VARARGS(syslog, int, severity) +void VARARGS(syslog, int, severity) { va_list ap; char *fmt; @@ -56,7 +56,7 @@ VARARGS(syslog, int, severity) /* closelog - dummy */ -closelog() +void closelog() { /* void */ } Modified: stable/11/contrib/tcp_wrappers/hosts_access.c ============================================================================== --- stable/11/contrib/tcp_wrappers/hosts_access.c Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/hosts_access.c Fri Jul 26 02:49:34 2019 (r350345) @@ -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: stable/11/contrib/tcp_wrappers/inetcf.c ============================================================================== --- stable/11/contrib/tcp_wrappers/inetcf.c Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/inetcf.c Fri Jul 26 02:49:34 2019 (r350345) @@ -14,14 +14,12 @@ static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02: #include #include #include +#include #include -extern int errno; -extern void exit(); -extern char *malloc(); - #include "tcpd.h" #include "inetcf.h" +#include "scaffold.h" /* * Network configuration files may live in unusual places. Here are some @@ -38,8 +36,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. @@ -68,7 +67,6 @@ char *conf; char *arg0; char *arg1; struct tcpd_context saved_context; - char *percent_m(); int i; struct stat st; Modified: stable/11/contrib/tcp_wrappers/inetcf.h ============================================================================== --- stable/11/contrib/tcp_wrappers/inetcf.h Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/inetcf.h Fri Jul 26 02:49:34 2019 (r350345) @@ -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: stable/11/contrib/tcp_wrappers/mystdarg.h ============================================================================== --- stable/11/contrib/tcp_wrappers/mystdarg.h Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/mystdarg.h Fri Jul 26 02:49:34 2019 (r350345) @@ -16,4 +16,4 @@ #define VAEND(ap) va_end(ap);} #endif -extern char *percent_m(); +extern char *percent_m(char *obuf, char *ibuf); Modified: stable/11/contrib/tcp_wrappers/options.c ============================================================================== --- stable/11/contrib/tcp_wrappers/options.c Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/options.c Fri Jul 26 02:49:34 2019 (r350345) @@ -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: stable/11/contrib/tcp_wrappers/rfc931.c ============================================================================== --- stable/11/contrib/tcp_wrappers/rfc931.c Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/rfc931.c Fri Jul 26 02:49:34 2019 (r350345) @@ -66,8 +66,7 @@ int protocol; /* timeout - handle timeouts */ -static void timeout(sig) -int sig; +static void timeout(int sig) { longjmp(timebuf, sig); } Modified: stable/11/contrib/tcp_wrappers/scaffold.c ============================================================================== --- stable/11/contrib/tcp_wrappers/scaffold.c Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/scaffold.c Fri Jul 26 02:49:34 2019 (r350345) @@ -21,7 +21,9 @@ static char sccs_id[] = "@(#) scaffold.c 1.6 97/03/21 #include #include #include +#include #include +#include #ifndef INADDR_NONE #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ @@ -37,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 */ Modified: stable/11/contrib/tcp_wrappers/scaffold.h ============================================================================== --- stable/11/contrib/tcp_wrappers/scaffold.h Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/scaffold.h Fri Jul 26 02:49:34 2019 (r350345) @@ -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: stable/11/contrib/tcp_wrappers/shell_cmd.c ============================================================================== --- stable/11/contrib/tcp_wrappers/shell_cmd.c Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/shell_cmd.c Fri Jul 26 02:49:34 2019 (r350345) @@ -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: stable/11/contrib/tcp_wrappers/socket.c ============================================================================== --- stable/11/contrib/tcp_wrappers/socket.c Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/socket.c Fri Jul 26 02:49:34 2019 (r350345) @@ -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: stable/11/contrib/tcp_wrappers/tcpd.c ============================================================================== --- stable/11/contrib/tcp_wrappers/tcpd.c Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/tcpd.c Fri Jul 26 02:49:34 2019 (r350345) @@ -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 @@ -62,10 +63,10 @@ char **argv; */ if (argv[0][0] == '/') { - strcpy(path, argv[0]); + strlcpy(path, argv[0], sizeof(path)); argv[0] = strrchr(argv[0], '/') + 1; } else { - sprintf(path, "%s/%s", REAL_DAEMON_DIR, argv[0]); + snprintf(path, sizeof(path), "%s/%s", REAL_DAEMON_DIR, argv[0]); } /* Modified: stable/11/contrib/tcp_wrappers/tcpdchk.c ============================================================================== --- stable/11/contrib/tcp_wrappers/tcpdchk.c Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/tcpdchk.c Fri Jul 26 02:49:34 2019 (r350345) @@ -34,13 +34,10 @@ static char sccsid[] = "@(#) tcpdchk.c 1.8 97/02/12 02 #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 */ #endif @@ -71,15 +68,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 @@ -183,7 +180,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: stable/11/contrib/tcp_wrappers/tcpdmatch.c ============================================================================== --- stable/11/contrib/tcp_wrappers/tcpdmatch.c Fri Jul 26 01:49:58 2019 (r350344) +++ stable/11/contrib/tcp_wrappers/tcpdmatch.c Fri Jul 26 02:49:34 2019 (r350345) @@ -30,12 +30,10 @@ 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 */ #endif @@ -50,8 +48,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 Fri Jul 26 03:49: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 AE9B6B5214; Fri, 26 Jul 2019 03:49:18 +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 87F08746BA; Fri, 26 Jul 2019 03:49:18 +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 61DD892D3; Fri, 26 Jul 2019 03:49:18 +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 x6Q3nI55052662; Fri, 26 Jul 2019 03:49:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q3nHFw052657; Fri, 26 Jul 2019 03:49:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201907260349.x6Q3nHFw052657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 26 Jul 2019 03:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350346 - in head: sys/cam/ctl sys/cam/scsi usr.sbin/ctladm X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: sys/cam/ctl sys/cam/scsi usr.sbin/ctladm X-SVN-Commit-Revision: 350346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 87F08746BA 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]; 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, 26 Jul 2019 03:49:18 -0000 Author: mav Date: Fri Jul 26 03:49:16 2019 New Revision: 350346 URL: https://svnweb.freebsd.org/changeset/base/350346 Log: Add device temperature reporting into CTL. The values to report can be set via LUN options. It can be useful for testing, and also required for Drive Maintenance 2016 feature set. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h head/sys/cam/ctl/ctl_private.h head/sys/cam/scsi/scsi_all.h head/usr.sbin/ctladm/ctladm.8 Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Jul 26 02:49:34 2019 (r350345) +++ head/sys/cam/ctl/ctl.c Fri Jul 26 03:49:16 2019 (r350346) @@ -4450,12 +4450,14 @@ ctl_init_log_page_index(struct ctl_lun *lun) lun->log_pages.index[0].page_len = j; lun->log_pages.index[1].page_data = &lun->log_pages.subpages_page[0]; lun->log_pages.index[1].page_len = k * 2; - lun->log_pages.index[2].page_data = &lun->log_pages.lbp_page[0]; - lun->log_pages.index[2].page_len = 12*CTL_NUM_LBP_PARAMS; - lun->log_pages.index[3].page_data = (uint8_t *)&lun->log_pages.stat_page; - lun->log_pages.index[3].page_len = sizeof(lun->log_pages.stat_page); - lun->log_pages.index[4].page_data = (uint8_t *)&lun->log_pages.ie_page; - lun->log_pages.index[4].page_len = sizeof(lun->log_pages.ie_page); + lun->log_pages.index[2].page_data = (uint8_t *)&lun->log_pages.temp_page; + lun->log_pages.index[2].page_len = sizeof(lun->log_pages.temp_page); + lun->log_pages.index[3].page_data = &lun->log_pages.lbp_page[0]; + lun->log_pages.index[3].page_len = 12*CTL_NUM_LBP_PARAMS; + lun->log_pages.index[4].page_data = (uint8_t *)&lun->log_pages.stat_page; + lun->log_pages.index[4].page_len = sizeof(lun->log_pages.stat_page); + lun->log_pages.index[5].page_data = (uint8_t *)&lun->log_pages.ie_page; + lun->log_pages.index[5].page_len = sizeof(lun->log_pages.ie_page); return (CTL_RETVAL_COMPLETE); } @@ -6679,6 +6681,40 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) } int +ctl_temp_log_sense_handler(struct ctl_scsiio *ctsio, + struct ctl_page_index *page_index, + int pc) +{ + struct ctl_lun *lun = CTL_LUN(ctsio); + struct scsi_log_temperature *data; + const char *value; + + data = (struct scsi_log_temperature *)page_index->page_data; + + scsi_ulto2b(SLP_TEMPERATURE, data->hdr.param_code); + data->hdr.param_control = SLP_LBIN; + data->hdr.param_len = sizeof(struct scsi_log_temperature) - + sizeof(struct scsi_log_param_header); + if ((value = dnvlist_get_string(lun->be_lun->options, "temperature", + NULL)) != NULL) + data->temperature = strtol(value, NULL, 0); + else + data->temperature = 0xff; + data++; + + scsi_ulto2b(SLP_REFTEMPERATURE, data->hdr.param_code); + data->hdr.param_control = SLP_LBIN; + data->hdr.param_len = sizeof(struct scsi_log_temperature) - + sizeof(struct scsi_log_param_header); + if ((value = dnvlist_get_string(lun->be_lun->options, "reftemperature", + NULL)) != NULL) + data->temperature = strtol(value, NULL, 0); + else + data->temperature = 0xff; + return (0); +} + +int ctl_lbp_log_sense_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, int pc) @@ -6802,6 +6838,7 @@ ctl_ie_log_sense_handler(struct ctl_scsiio *ctsio, { struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_log_informational_exceptions *data; + const char *value; data = (struct scsi_log_informational_exceptions *)page_index->page_data; @@ -6811,7 +6848,11 @@ ctl_ie_log_sense_handler(struct ctl_scsiio *ctsio, sizeof(struct scsi_log_param_header); data->ie_asc = lun->ie_asc; data->ie_ascq = lun->ie_ascq; - data->temperature = 0xff; + if ((value = dnvlist_get_string(lun->be_lun->options, "temperature", + NULL)) != NULL) + data->temperature = strtol(value, NULL, 0); + else + data->temperature = 0xff; return (0); } Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Fri Jul 26 02:49:34 2019 (r350345) +++ head/sys/cam/ctl/ctl.h Fri Jul 26 03:49:16 2019 (r350346) @@ -158,6 +158,9 @@ int ctl_default_page_handler(struct ctl_scsiio *ctsio, int ctl_ie_page_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, uint8_t *page_ptr); +int ctl_temp_log_sense_handler(struct ctl_scsiio *ctsio, + struct ctl_page_index *page_index, + int pc); int ctl_lbp_log_sense_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, int pc); Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Fri Jul 26 02:49:34 2019 (r350345) +++ head/sys/cam/ctl/ctl_private.h Fri Jul 26 03:49:16 2019 (r350346) @@ -331,6 +331,8 @@ static const struct ctl_page_index log_page_index_temp CTL_PAGE_FLAG_ALL, NULL, NULL}, {SLS_SUPPORTED_PAGES_PAGE, SLS_SUPPORTED_SUBPAGES_SUBPAGE, 0, NULL, CTL_PAGE_FLAG_ALL, NULL, NULL}, + {SLS_TEMPERATURE, 0, 0, NULL, + CTL_PAGE_FLAG_DIRECT, ctl_temp_log_sense_handler, NULL}, {SLS_LOGICAL_BLOCK_PROVISIONING, 0, 0, NULL, CTL_PAGE_FLAG_DIRECT, ctl_lbp_log_sense_handler, NULL}, {SLS_STAT_AND_PERF, 0, 0, NULL, @@ -351,6 +353,7 @@ struct ctl_log_pages { struct scsi_log_idle_time it; struct scsi_log_time_interval ti; } stat_page; + struct scsi_log_temperature temp_page[2]; struct scsi_log_informational_exceptions ie_page; struct ctl_page_index index[CTL_NUM_LOG_PAGES]; }; Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Fri Jul 26 02:49:34 2019 (r350345) +++ head/sys/cam/scsi/scsi_all.h Fri Jul 26 03:49:16 2019 (r350346) @@ -568,6 +568,7 @@ struct scsi_log_sense #define SLS_ERROR_NONMEDIUM_PAGE 0x06 #define SLS_ERROR_LASTN_PAGE 0x07 #define SLS_LOGICAL_BLOCK_PROVISIONING 0x0c +#define SLS_TEMPERATURE 0x0d #define SLS_SELF_TEST_PAGE 0x10 #define SLS_SOLID_STATE_MEDIA 0x11 #define SLS_STAT_AND_PERF 0x19 @@ -680,6 +681,14 @@ struct scsi_log_informational_exceptions { #define SLP_IE_GEN 0x0000 uint8_t ie_asc; uint8_t ie_ascq; + uint8_t temperature; +}; + +struct scsi_log_temperature { + struct scsi_log_param_header hdr; +#define SLP_TEMPERATURE 0x0000 +#define SLP_REFTEMPERATURE 0x0001 + uint8_t reserved; uint8_t temperature; }; Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Fri Jul 26 02:49:34 2019 (r350345) +++ head/usr.sbin/ctladm/ctladm.8 Fri Jul 26 03:49:16 2019 (r350346) @@ -36,7 +36,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd May 10, 2018 +.Dd July 25, 2019 .Dt CTLADM 8 .Os .Sh NAME @@ -918,6 +918,9 @@ Specifies medium rotation rate of the device: 0 -- not .It Va formfactor Specifies nominal form factor of the device: 0 -- not reported, 1 -- 5.25", 2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8". +.It Va temperature +.It Va reftemperature +Specify current and reference (maximum) temperatures of the device. .It Va provisioning_type When UNMAP support is enabled, this option specifies provisioning type: "resource", "thin" or "unknown". From owner-svn-src-all@freebsd.org Fri Jul 26 05:07: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 1CB49B6686; Fri, 26 Jul 2019 05:07:10 +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 BE67E76D44; Fri, 26 Jul 2019 05:07:09 +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 98112A145; Fri, 26 Jul 2019 05:07:09 +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 x6Q579II099087; Fri, 26 Jul 2019 05:07:09 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q579p3099086; Fri, 26 Jul 2019 05:07:09 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201907260507.x6Q579p3099086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 26 Jul 2019 05:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350347 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 350347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE67E76D44 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.961,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, 26 Jul 2019 05:07:10 -0000 Author: alc Date: Fri Jul 26 05:07:09 2019 New Revision: 350347 URL: https://svnweb.freebsd.org/changeset/base/350347 Log: Implement pmap_advise(). (Without a working pmap_advise() implementation madvise(MADV_DONTNEED) and madvise(MADV_FREE) are NOPs.) Reviewed by: markj X-MFC after: r350004 Differential Revision: https://reviews.freebsd.org/D21062 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Fri Jul 26 03:49:16 2019 (r350346) +++ head/sys/arm64/arm64/pmap.c Fri Jul 26 05:07:09 2019 (r350347) @@ -2499,7 +2499,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 __unused +static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va, pd_entry_t l2e, struct spglist *free, struct rwlock **lockp) { @@ -4839,6 +4839,110 @@ out: void pmap_advise(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, int advice) { + struct rwlock *lock; + vm_offset_t va, va_next; + vm_page_t m; + pd_entry_t *l0, *l1, *l2, oldl2; + pt_entry_t *l3, oldl3; + + if (advice != MADV_DONTNEED && advice != MADV_FREE) + return; + + PMAP_LOCK(pmap); + for (; sva < eva; sva = va_next) { + l0 = pmap_l0(pmap, sva); + if (pmap_load(l0) == 0) { + va_next = (sva + L0_SIZE) & ~L0_OFFSET; + if (va_next < sva) + va_next = eva; + continue; + } + l1 = pmap_l0_to_l1(l0, sva); + if (pmap_load(l1) == 0) { + va_next = (sva + L1_SIZE) & ~L1_OFFSET; + if (va_next < sva) + va_next = eva; + continue; + } + va_next = (sva + L2_SIZE) & ~L2_OFFSET; + if (va_next < sva) + va_next = eva; + l2 = pmap_l1_to_l2(l1, sva); + oldl2 = pmap_load(l2); + if (oldl2 == 0) + continue; + if ((oldl2 & ATTR_DESCR_MASK) == L2_BLOCK) { + if ((oldl2 & ATTR_SW_MANAGED) == 0) + continue; + lock = NULL; + if (!pmap_demote_l2_locked(pmap, l2, sva, &lock)) { + if (lock != NULL) + rw_wunlock(lock); + + /* + * The 2MB page mapping was destroyed. + */ + continue; + } + + /* + * Unless the page mappings are wired, remove the + * mapping to a single page so that a subsequent + * access may repromote. Since the underlying page + * table page is fully populated, this removal never + * frees a page table page. + */ + if ((oldl2 & ATTR_SW_WIRED) == 0) { + l3 = pmap_l2_to_l3(l2, sva); + KASSERT(pmap_load(l3) != 0, + ("pmap_advise: invalid PTE")); + pmap_remove_l3(pmap, l3, sva, pmap_load(l2), + NULL, &lock); + } + if (lock != NULL) + rw_wunlock(lock); + } + KASSERT((pmap_load(l2) & ATTR_DESCR_MASK) == L2_TABLE, + ("pmap_advise: invalid L2 entry after demotion")); + if (va_next > eva) + va_next = eva; + va = va_next; + for (l3 = pmap_l2_to_l3(l2, sva); sva != va_next; l3++, + sva += L3_SIZE) { + oldl3 = pmap_load(l3); + if ((oldl3 & (ATTR_SW_MANAGED | ATTR_DESCR_MASK)) != + (ATTR_SW_MANAGED | L3_PAGE)) + goto maybe_invlrng; + else if (pmap_pte_dirty(oldl3)) { + if (advice == MADV_DONTNEED) { + /* + * Future calls to pmap_is_modified() + * can be avoided by making the page + * dirty now. + */ + m = PHYS_TO_VM_PAGE(oldl3 & ~ATTR_MASK); + vm_page_dirty(m); + } + while (!atomic_fcmpset_long(l3, &oldl3, + (oldl3 & ~ATTR_AF) | ATTR_AP(ATTR_AP_RO))) + cpu_spinwait(); + } else if ((oldl3 & ATTR_AF) != 0) + pmap_clear_bits(l3, ATTR_AF); + else + goto maybe_invlrng; + if (va == va_next) + va = sva; + continue; +maybe_invlrng: + if (va != va_next) { + pmap_invalidate_range(pmap, va, sva); + va = va_next; + } + } + if (va != va_next) + pmap_invalidate_range(pmap, va, sva); + } + PMAP_UNLOCK(pmap); } /* From owner-svn-src-all@freebsd.org Fri Jul 26 05:59: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 B2D2EB755D; Fri, 26 Jul 2019 05:59:05 +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 8A576805F1; Fri, 26 Jul 2019 05:59:05 +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 57B64AA36; Fri, 26 Jul 2019 05:59:05 +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 x6Q5x5Ja028415; Fri, 26 Jul 2019 05:59:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q5x4sW028412; Fri, 26 Jul 2019 05:59:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907260559.x6Q5x4sW028412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 26 Jul 2019 05:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350348 - vendor/libcxxrt/dist X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/libcxxrt/dist X-SVN-Commit-Revision: 350348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A576805F1 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.961,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, 26 Jul 2019 05:59:05 -0000 Author: dim Date: Fri Jul 26 05:59:04 2019 New Revision: 350348 URL: https://svnweb.freebsd.org/changeset/base/350348 Log: Import libcxxrt master f96846efbfd508f66d91fcbbef5dd808947c7f6d. Interesting fixes: f96846e Fix std::size_t -> size_t to unbreak build against libc++ 6.0.0 6f4cfa2 Fix the uncaught exception count with rethrowing. db54f53 Added C++14-specific operator delete (#47) Modified: vendor/libcxxrt/dist/CMakeLists.txt vendor/libcxxrt/dist/exception.cc vendor/libcxxrt/dist/memory.cc Modified: vendor/libcxxrt/dist/CMakeLists.txt ============================================================================== --- vendor/libcxxrt/dist/CMakeLists.txt Fri Jul 26 05:07:09 2019 (r350347) +++ vendor/libcxxrt/dist/CMakeLists.txt Fri Jul 26 05:59:04 2019 (r350348) @@ -10,7 +10,7 @@ set(CXXRT_SOURCES libelftc_dem_gnu3.c ) - +add_definitions(-D_GNU_SOURCE) add_library(cxxrt-static STATIC ${CXXRT_SOURCES}) add_library(cxxrt-shared SHARED ${CXXRT_SOURCES}) target_link_libraries(cxxrt-shared ${CMAKE_DL_LIBS}) Modified: vendor/libcxxrt/dist/exception.cc ============================================================================== --- vendor/libcxxrt/dist/exception.cc Fri Jul 26 05:07:09 2019 (r350347) +++ vendor/libcxxrt/dist/exception.cc Fri Jul 26 05:59:04 2019 (r350348) @@ -859,6 +859,13 @@ extern "C" void __cxa_rethrow() assert(ex->handlerCount > 0 && "Rethrowing uncaught exception!"); + // `globals->uncaughtExceptions` was decremented by `__cxa_begin_catch`. + // It's normally incremented by `throw_exception`, but this path invokes + // `_Unwind_Resume_or_Rethrow` directly to rethrow the exception. + // This path is only reachable if we're rethrowing a C++ exception - + // foreign exceptions don't adjust any of this state. + globals->uncaughtExceptions++; + // ex->handlerCount will be decremented in __cxa_end_catch in enclosing // catch block @@ -1204,11 +1211,13 @@ extern "C" void *__cxa_begin_catch(void *e) // we see is a foreign exception then we won't have called it yet. __cxa_thread_info *ti = thread_info(); __cxa_eh_globals *globals = &ti->globals; - globals->uncaughtExceptions--; _Unwind_Exception *exceptionObject = static_cast<_Unwind_Exception*>(e); if (isCXXException(exceptionObject->exception_class)) { + // Only exceptions thrown with a C++ exception throwing function will + // increment this, so don't decrement it here. + globals->uncaughtExceptions--; __cxa_exception *ex = exceptionFromPointer(exceptionObject); if (ex->handlerCount == 0) @@ -1345,6 +1354,14 @@ extern "C" std::type_info *__cxa_current_exception_typ } /** + * Cleanup, ensures that `__cxa_end_catch` is called to balance an explicit + * `__cxa_begin_catch` call. + */ +static void end_catch(char *) +{ + __cxa_end_catch(); +} +/** * ABI function, called when an exception specification is violated. * * This function does not return. @@ -1352,6 +1369,12 @@ extern "C" std::type_info *__cxa_current_exception_typ extern "C" void __cxa_call_unexpected(void*exception) { _Unwind_Exception *exceptionObject = static_cast<_Unwind_Exception*>(exception); + // Wrap the call to the unexpected handler in calls to `__cxa_begin_catch` + // and `__cxa_end_catch` so that we correctly update exception counts if + // the unexpected handler throws an exception. + __cxa_begin_catch(exceptionObject); + __attribute__((cleanup(end_catch))) + char unused; if (exceptionObject->exception_class == exception_class) { __cxa_exception *ex = exceptionFromPointer(exceptionObject); Modified: vendor/libcxxrt/dist/memory.cc ============================================================================== --- vendor/libcxxrt/dist/memory.cc Fri Jul 26 05:07:09 2019 (r350347) +++ vendor/libcxxrt/dist/memory.cc Fri Jul 26 05:59:04 2019 (r350348) @@ -151,4 +151,21 @@ void operator delete[](void * ptr) NOEXCEPT ::operator delete(ptr); } +// C++14 additional delete operators +#if __cplusplus >= 201402L + +__attribute__((weak)) +void operator delete(void * ptr, size_t) NOEXCEPT +{ + ::operator delete(ptr); +} + + +__attribute__((weak)) +void operator delete[](void * ptr, size_t) NOEXCEPT +{ + ::operator delete(ptr); +} + +#endif From owner-svn-src-all@freebsd.org Fri Jul 26 06:55: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 41509B8255; Fri, 26 Jul 2019 06:55:09 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 D3A3D822F7; Fri, 26 Jul 2019 06:55:07 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm1-x32d.google.com with SMTP id f17so46685915wme.2; Thu, 25 Jul 2019 23:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=Fl/L4ru8gLrQhoDwYZB052B1kD5il6xk31MNh3Nqxes=; b=K8yh1vyFkY0W5a5cuAfyLsPCJjpD3kt/I5tKZGteHZlb1KkOrJv20gdWgNifePaZ6+ 63KcndA8rXQ5YGR+Kq7qM3/G1e2oS5hsfEW5s7rMd4X8HNIetn1P3MTjFFEWoIJP1k8I zzVfmbl+7tVkok7C7I5hIdmtG84kmnoCOGK3rXBGHnoTIVDnDzFnO2I/ttnOBWMQu6Cv /IHX/A/QDNWTRaw1BYy7OvZT14KAgeEEoJj4LTOgiwub+pcO7FI5iLTkN/qojUQWSqO0 RPoyjyoawOtwM0KgbMQXxL8pVWsrfnZ7zdLKblVVRSSoOxXVjgWZ78fNXIg3UcFXDPI4 7MAw== 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:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=Fl/L4ru8gLrQhoDwYZB052B1kD5il6xk31MNh3Nqxes=; b=LZ6M5VwYnyb5COPM5WeCGTvSyttNVrSW3+0bqHHeiI82gqpmZ/GOaN3vecqWJzo7Ef dWfWs5UBXAbHniG0O+F1h2jz6ZHQacIx3R3BHaHWpmdIr0k/AZALCERkelGHNCkPp/Ph oqtCtP9s6AMp2dsPWvv6PV+yo8i7Mv73wBBgfd0M49cHBPgp2D+Cbkqa7TrP4rqb9QD5 fD+Hnzfh8gYgMGZ0W75qZR9p3jHjC6awunbn9mLs7s7iA8yKH6JC0+BSsXRDbIEoJL26 xZx/nbB+WYsWFIr0fqXz2a7mGBn0QPjHQT7xh7/6wJyNaVgMnyAaozjK2yf7km73dOFe Docw== X-Gm-Message-State: APjAAAVNXeyXzWpswLuHQQ3i0AWnTqbmWmuRJ677C9MbslQLUFKZG8Rv EbzdtTh5AGCJUj5RQW/yO195zeE3 X-Google-Smtp-Source: APXvYqyk8oUMOlY+m3cNUttc6gg9CBIbSOjs9A9ndfZS13TCs5pdPEtAVtRMwNlWbgOw8KVeTt1JAg== X-Received: by 2002:a1c:2302:: with SMTP id j2mr80581505wmj.174.1564124106601; Thu, 25 Jul 2019 23:55:06 -0700 (PDT) Received: from ernst.home (p5B023CEA.dip0.t-ipconnect.de. [91.2.60.234]) by smtp.gmail.com with ESMTPSA id j17sm79387716wrb.35.2019.07.25.23.55.05 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 23:55:05 -0700 (PDT) Date: Fri, 26 Jul 2019 08:55:04 +0200 From: Gary Jennejohn To: Ian Lepore Cc: Renato Botelho , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349976 - head Message-ID: <20190726085504.50e4563c@ernst.home> In-Reply-To: <62945ba288b96e431b5053167ab8c23f192bcbed.camel@freebsd.org> References: <201907131648.x6DGmRc4090395@repo.freebsd.org> <62945ba288b96e431b5053167ab8c23f192bcbed.camel@freebsd.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: D3A3D822F7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=K8yh1vyF; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gljennjohn@gmail.com designates 2a00:1450:4864:20::32d as permitted sender) smtp.mailfrom=gljennjohn@gmail.com X-Spamd-Result: default: False [-6.68 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[gljennjohn@gmail.com]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; 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.73)[-0.730,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-2.94)[ip: (-9.21), ipnet: 2a00:1450::/32(-3.02), asn: 15169(-2.44), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; 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)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[d.2.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.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: Fri, 26 Jul 2019 06:55:09 -0000 On Thu, 25 Jul 2019 09:32:15 -0600 Ian Lepore wrote: > On Thu, 2019-07-25 at 10:27 -0300, Renato Botelho wrote: > > On 13/07/19 13:48, Ian Lepore wrote: > > > Author: ian > > > Date: Sat Jul 13 16:48:27 2019 > > > New Revision: 349976 > > > URL: https://svnweb.freebsd.org/changeset/base/349976 > > > > > > Log: > > > Add an entry mentioning the permission/mode change to daily > > > accounting files. > > > > > > Modified: > > > head/UPDATING > > > > > > Modified: head/UPDATING > > > =================================================================== > > > =========== > > > --- head/UPDATING Sat Jul 13 16:32:19 2019 (r349975) > > > +++ head/UPDATING Sat Jul 13 16:48:27 2019 (r349976) > > > @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS > > > SLOW: > > > disable the most expensive debugging functionality run > > > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > > > > > +20190713: > > > + Default permissions on the /var/account/acct file (and copies > > > of it rotated > > > + by periodic daily scripts) are changed from 0644 to 0640 > > > because the file > > > + contains sensitive information that should not be world- > > > readable. If the > > > + /var/account directory must be created by rc.d/accounting, the > > > mode used is > > > + now 0750. Admins who use the accounting feature are > > > encouraged to change > > > + the mode of an existing /var/account directory to 0750 or > > > 0700. > > > > Block is indented with 4 spaces instead of tabs > > > > Doh! Must've still had my editor set for the $work coding standards. > Fixed in r350324. Thanks! > I just looked at UPDATING (/usr/src is at r350348) and this is the only entry which wraps on a 80 character wide terminal. -- Gary Jennejohn From owner-svn-src-all@freebsd.org Fri Jul 26 09:51: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 237C9BB39C; Fri, 26 Jul 2019 09:51:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 100D088139; Fri, 26 Jul 2019 09:51:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF96AD552; Fri, 26 Jul 2019 09:51:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6Q9pb8P066007; Fri, 26 Jul 2019 09:51:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q9pZxr065994; Fri, 26 Jul 2019 09:51:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201907260951.x6Q9pZxr065994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 26 Jul 2019 09:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350349 - vendor/mandoc/dist X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: vendor/mandoc/dist X-SVN-Commit-Revision: 350349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 100D088139 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.941,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, 26 Jul 2019 09:51:38 -0000 Author: bapt Date: Fri Jul 26 09:51:35 2019 New Revision: 350349 URL: https://svnweb.freebsd.org/changeset/base/350349 Log: Import mandoc snapshot 2019-07-23 Deleted: vendor/mandoc/dist/libroff.h Modified: vendor/mandoc/dist/Makefile.depend vendor/mandoc/dist/TODO vendor/mandoc/dist/arch.c vendor/mandoc/dist/cgi.c vendor/mandoc/dist/configure vendor/mandoc/dist/dbm.c vendor/mandoc/dist/dbm_map.h vendor/mandoc/dist/eqn.7 vendor/mandoc/dist/eqn_html.c vendor/mandoc/dist/html.c vendor/mandoc/dist/html.h vendor/mandoc/dist/lib.in vendor/mandoc/dist/main.c vendor/mandoc/dist/man.7 vendor/mandoc/dist/man_html.c vendor/mandoc/dist/man_term.c vendor/mandoc/dist/man_validate.c vendor/mandoc/dist/mandoc.1 vendor/mandoc/dist/mandoc.c vendor/mandoc/dist/mandoc.css vendor/mandoc/dist/mandoc.h vendor/mandoc/dist/mandoc_char.7 vendor/mandoc/dist/mandoc_headers.3 vendor/mandoc/dist/mandoc_msg.c vendor/mandoc/dist/mandocdb.c vendor/mandoc/dist/manpath.c vendor/mandoc/dist/mansearch.c vendor/mandoc/dist/mansearch.h vendor/mandoc/dist/mdoc.7 vendor/mandoc/dist/mdoc_argv.c vendor/mandoc/dist/mdoc_markdown.c vendor/mandoc/dist/mdoc_term.c vendor/mandoc/dist/mdoc_validate.c vendor/mandoc/dist/out.c vendor/mandoc/dist/read.c vendor/mandoc/dist/roff.7 vendor/mandoc/dist/roff.c vendor/mandoc/dist/roff_html.c vendor/mandoc/dist/tag.c vendor/mandoc/dist/tbl_html.c vendor/mandoc/dist/tbl_term.c vendor/mandoc/dist/term.c Modified: vendor/mandoc/dist/Makefile.depend ============================================================================== --- vendor/mandoc/dist/Makefile.depend Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/Makefile.depend Fri Jul 26 09:51:35 2019 (r350349) @@ -29,7 +29,7 @@ dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h demandoc.o: demandoc.c config.h mandoc.h roff.h man.h mdoc.h mandoc_parse.h eqn.o: eqn.c config.h mandoc_aux.h mandoc.h roff.h eqn.h libmandoc.h eqn_parse.h -eqn_html.o: eqn_html.c config.h mandoc.h eqn.h out.h html.h +eqn_html.o: eqn_html.c config.h mandoc.h roff.h eqn.h out.h html.h eqn_term.o: eqn_term.c config.h eqn.h out.h term.h html.o: html.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h out.h html.h manconf.h main.h lib.o: lib.c config.h roff.h libmdoc.h lib.in @@ -37,16 +37,16 @@ main.o: main.c config.h mandoc_aux.h mandoc.h mandoc_x man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h man_html.o: man_html.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h html.h main.h man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h -man_term.o: man_term.c config.h mandoc_aux.h roff.h man.h out.h term.h main.h +man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h tag.h main.h man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h mandoc.o: mandoc.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h roff_int.h mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h -mandoc_msg.o: mandoc_msg.c mandoc.h +mandoc_msg.o: mandoc_msg.c config.h mandoc.h mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.o: mandoc_xr.c mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.h mandocd.o: mandocd.c config.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h main.h manconf.h mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h manconf.h mansearch.h dba_array.h dba.h -manpath.o: manpath.c config.h mandoc_aux.h manconf.h +manpath.o: manpath.c config.h mandoc_aux.h mandoc.h manconf.h mansearch.o: mansearch.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h @@ -67,10 +67,10 @@ roff_term.o: roff_term.c mandoc.h roff.h out.h term.h roff_validate.o: roff_validate.c mandoc.h roff.h libmandoc.h roff_int.h soelim.o: soelim.c config.h compat_stringlist.h st.o: st.c config.h mandoc.h roff.h libmdoc.h -tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h tag.h +tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h tag.h tbl.o: tbl.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_parse.h tbl_int.h tbl_data.o: tbl_data.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h -tbl_html.o: tbl_html.c config.h mandoc.h tbl.h out.h html.h +tbl_html.o: tbl_html.c config.h mandoc.h roff.h tbl.h out.h html.h tbl_layout.o: tbl_layout.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h tbl_opts.o: tbl_opts.c config.h mandoc.h tbl.h libmandoc.h tbl_int.h tbl_term.o: tbl_term.c config.h mandoc.h tbl.h out.h term.h Modified: vendor/mandoc/dist/TODO ============================================================================== --- vendor/mandoc/dist/TODO Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/TODO Fri Jul 26 09:51:35 2019 (r350349) @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.289 2019/03/04 13:01:57 schwarze Exp $ +* $Id: TODO,v 1.295 2019/06/11 16:04:36 schwarze Exp $ ************************************************************************ Many issues are annotated for difficulty as follows: @@ -62,6 +62,27 @@ are mere guesses, and some may be wrong. needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 loc ** exist *** algo *** size * imp *** +- .als only works for macros in mandoc, not for user-defined strings. + Also, the "val" field in struct roffkv would have to be replaced + with a pointer to a reference-counted wrapper, and an alias + would have to point to the same wrapper as the original. + .als to undefined does nothing; the alias is not created. + .rm'ing the original leaves the alias to point to the old value. + .de .als .de changes both, but + .de .als .rm .de only changes the new value, not the alias. + Found in groffer(1) version 1.19 + Jan Stary 20 Apr 2019 20:16:54 +0200 + loc * exist ** algo ** size ** imp * + +- roff string condition comparisons fail when vars contain quotes: + .ds s ' + .if '\*s'' \&... + hard to fix because of the basic architecture (string replacement + happens before roff(7) syntax parsing) + Found in groffer(1) version 1.19 + Jan Stary 20 Apr 2019 20:16:54 +0200 + loc * exist *** algo *** size ** imp * + --- missing mdoc features ---------------------------------------------- - .Bl -column .Xo support is missing @@ -263,6 +284,9 @@ are mere guesses, and some may be wrong. http://ikiwiki.info/plugins/contrib/mandoc/ https://github.com/schmonz/ikiwiki/compare/mandoc Amitai Schlair Mon, 19 May 2014 14:05:53 -0400 + +- check compatibility with + https://git.sr.ht/~sircmpwn/scdoc - check features of the Slackware man.conf(5) format Carsten Kunze Wed, 11 Mar 2015 17:57:24 +0100 Modified: vendor/mandoc/dist/arch.c ============================================================================== --- vendor/mandoc/dist/arch.c Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/arch.c Fri Jul 26 09:51:35 2019 (r350349) @@ -1,4 +1,4 @@ -/* $Id: arch.c,v 1.14 2019/03/04 13:01:57 schwarze Exp $ */ +/* $Id: arch.c,v 1.15 2019/05/21 07:52:00 schwarze Exp $ */ /* * Copyright (c) 2017, 2019 Ingo Schwarze * @@ -26,7 +26,7 @@ arch_valid(const char *arch, enum mandoc_os os) const char *openbsd_arch[] = { "alpha", "amd64", "arm64", "armv7", "hppa", "i386", "landisk", "loongson", "luna88k", "macppc", "mips64", - "octeon", "sgi", "socppc", "sparc64", NULL + "octeon", "sgi", "sparc64", NULL }; const char *netbsd_arch[] = { "acorn26", "acorn32", "algor", "alpha", "amiga", Modified: vendor/mandoc/dist/cgi.c ============================================================================== --- vendor/mandoc/dist/cgi.c Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/cgi.c Fri Jul 26 09:51:35 2019 (r350349) @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.166 2019/03/06 12:32:41 schwarze Exp $ */ +/* $Id: cgi.c,v 1.167 2019/07/10 12:49:20 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017, 2018 Ingo Schwarze @@ -869,7 +869,6 @@ resp_format(const struct req *req, const char *file) memset(&conf, 0, sizeof(conf)); conf.fragment = 1; conf.style = mandoc_strdup(CSS_DIR "/mandoc.css"); - conf.toc = 1; usepath = strcmp(req->q.manpath, req->p[0]); mandoc_asprintf(&conf.man, "/%s%s%s%s%%N.%%S", scriptname, *scriptname == '\0' ? "" : "/", Modified: vendor/mandoc/dist/configure ============================================================================== --- vendor/mandoc/dist/configure Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/configure Fri Jul 26 09:51:35 2019 (r350349) @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: configure,v 1.70 2019/03/06 16:04:31 schwarze Exp $ +# $Id: configure,v 1.71 2019/07/01 22:56:24 schwarze Exp $ # # Copyright (c) 2014-2019 Ingo Schwarze # @@ -529,7 +529,7 @@ fi echo "extern char *mkdtemp(char *);" if [ ${HAVE_PROGNAME} -eq 0 ]; then - echo "extern const char *getprogname(void);" + echo "extern const char *getprogname(void);" echo "extern void setprogname(const char *);" fi Modified: vendor/mandoc/dist/dbm.c ============================================================================== --- vendor/mandoc/dist/dbm.c Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/dbm.c Fri Jul 26 09:51:35 2019 (r350349) @@ -1,4 +1,4 @@ -/* $Id: dbm.c,v 1.6 2018/11/19 19:22:07 schwarze Exp $ */ +/* $Id: dbm.c,v 1.7 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * @@ -233,7 +233,7 @@ static struct dbm_res page_bytitle(enum iter arg_iter, const struct dbm_match *arg_match) { static const struct dbm_match *match; - static const char *cp; + static const char *cp; static int32_t ip; struct dbm_res res = {-1, 0}; @@ -315,7 +315,7 @@ page_byarch(const struct dbm_match *arg_match) static const struct dbm_match *match; struct dbm_res res = {-1, 0}; static int32_t ip; - const char *cp; + const char *cp; /* Initialize for a new iteration. */ Modified: vendor/mandoc/dist/dbm_map.h ============================================================================== --- vendor/mandoc/dist/dbm_map.h Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/dbm_map.h Fri Jul 26 09:51:35 2019 (r350349) @@ -1,4 +1,4 @@ -/* $Id: dbm_map.h,v 1.1 2016/07/19 21:31:55 schwarze Exp $ */ +/* $Id: dbm_map.h,v 1.2 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * Private interface for low-level routines for the map-based version + * Private interface for low-level routines for the map-based version * of the mandoc database, for read-only access. * To be used by dbm*.c only. */ Modified: vendor/mandoc/dist/eqn.7 ============================================================================== --- vendor/mandoc/dist/eqn.7 Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/eqn.7 Fri Jul 26 09:51:35 2019 (r350349) @@ -1,4 +1,4 @@ -.\" $Id: eqn.7,v 1.37 2017/09/04 10:35:27 schwarze Exp $ +.\" $Id: eqn.7,v 1.38 2019/04/23 17:57:49 schwarze Exp $ .\" .\" Copyright (c) 2011 Kristaps Dzonsons .\" Copyright (c) 2014 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: September 4 2017 $ +.Dd $Mdocdate: April 23 2019 $ .Dt EQN 7 .Os .Sh NAME @@ -470,7 +470,7 @@ commands are also ignored. .%T System for Typesetting Mathematics .%J Communications of the ACM .%V 18 -.%P 151\(en157 +.%P pp. 151\(en157 .%D March, 1975 .Re .Rs Modified: vendor/mandoc/dist/eqn_html.c ============================================================================== --- vendor/mandoc/dist/eqn_html.c Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/eqn_html.c Fri Jul 26 09:51:35 2019 (r350349) @@ -1,4 +1,4 @@ -/* $Id: eqn_html.c,v 1.18 2018/12/13 05:23:38 schwarze Exp $ */ +/* $Id: eqn_html.c,v 1.19 2019/03/17 18:21:45 schwarze Exp $ */ /* * Copyright (c) 2011, 2014 Kristaps Dzonsons * Copyright (c) 2017 Ingo Schwarze @@ -26,6 +26,7 @@ #include #include "mandoc.h" +#include "roff.h" #include "eqn.h" #include "out.h" #include "html.h" Modified: vendor/mandoc/dist/html.c ============================================================================== --- vendor/mandoc/dist/html.c Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/html.c Fri Jul 26 09:51:35 2019 (r350349) @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.254 2019/03/03 13:02:11 schwarze Exp $ */ +/* $Id: html.c,v 1.255 2019/04/30 15:53:00 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017-2019 Ingo Schwarze @@ -120,6 +120,7 @@ static void print_ctag(struct html *, struct tag *); static int print_escape(struct html *, char); static int print_encode(struct html *, const char *, const char *, int); static void print_href(struct html *, const char *, const char *, int); +static void print_metaf(struct html *); void * @@ -222,55 +223,49 @@ print_gen_head(struct html *h) print_tagq(h, t); } -void -print_metaf(struct html *h, enum mandoc_esc deco) +int +html_setfont(struct html *h, enum mandoc_esc font) { - enum htmlfont font; - - switch (deco) { + switch (font) { case ESCAPE_FONTPREV: font = h->metal; break; case ESCAPE_FONTITALIC: - font = HTMLFONT_ITALIC; - break; case ESCAPE_FONTBOLD: - font = HTMLFONT_BOLD; - break; case ESCAPE_FONTBI: - font = HTMLFONT_BI; - break; case ESCAPE_FONTCW: - font = HTMLFONT_CW; + case ESCAPE_FONTROMAN: break; case ESCAPE_FONT: - case ESCAPE_FONTROMAN: - font = HTMLFONT_NONE; + font = ESCAPE_FONTROMAN; break; default: - return; + return 0; } + h->metal = h->metac; + h->metac = font; + return 1; +} +static void +print_metaf(struct html *h) +{ if (h->metaf) { print_tagq(h, h->metaf); h->metaf = NULL; } - - h->metal = h->metac; - h->metac = font; - - switch (font) { - case HTMLFONT_ITALIC: + switch (h->metac) { + case ESCAPE_FONTITALIC: h->metaf = print_otag(h, TAG_I, ""); break; - case HTMLFONT_BOLD: + case ESCAPE_FONTBOLD: h->metaf = print_otag(h, TAG_B, ""); break; - case HTMLFONT_BI: + case ESCAPE_FONTBI: h->metaf = print_otag(h, TAG_B, ""); print_otag(h, TAG_I, ""); break; - case HTMLFONT_CW: + case ESCAPE_FONTCW: h->metaf = print_otag(h, TAG_SPAN, "c", "Li"); break; default: @@ -479,7 +474,8 @@ print_encode(struct html *h, const char *p, const char case ESCAPE_FONTROMAN: if (0 == norecurse) { h->flags |= HTML_NOSPACE; - print_metaf(h, esc); + if (html_setfont(h, esc)) + print_metaf(h); h->flags &= ~HTML_NOSPACE; } continue; @@ -806,27 +802,9 @@ print_text(struct html *h, const char *word) print_word(h, " "); } - assert(NULL == h->metaf); - switch (h->metac) { - case HTMLFONT_ITALIC: - h->metaf = print_otag(h, TAG_I, ""); - break; - case HTMLFONT_BOLD: - h->metaf = print_otag(h, TAG_B, ""); - break; - case HTMLFONT_BI: - h->metaf = print_otag(h, TAG_B, ""); - print_otag(h, TAG_I, ""); - break; - case HTMLFONT_CW: - h->metaf = print_otag(h, TAG_SPAN, "c", "Li"); - break; - default: - print_indent(h); - break; - } - - assert(word); + assert(h->metaf == NULL); + print_metaf(h); + print_indent(h); if ( ! print_encode(h, word, NULL, 0)) { if ( ! (h->flags & HTML_NONOSPACE)) h->flags &= ~HTML_NOSPACE; @@ -834,7 +812,7 @@ print_text(struct html *h, const char *word) } else h->flags |= HTML_NOSPACE | HTML_NONEWLINE; - if (h->metaf) { + if (h->metaf != NULL) { print_tagq(h, h->metaf); h->metaf = NULL; } Modified: vendor/mandoc/dist/html.h ============================================================================== --- vendor/mandoc/dist/html.h Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/html.h Fri Jul 26 09:51:35 2019 (r350349) @@ -1,4 +1,4 @@ -/* $Id: html.h,v 1.102 2019/03/01 10:57:18 schwarze Exp $ */ +/* $Id: html.h,v 1.103 2019/04/30 15:53:00 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2017, 2018, 2019 Ingo Schwarze @@ -69,15 +69,6 @@ enum htmltag { TAG_MAX }; -enum htmlfont { - HTMLFONT_NONE = 0, - HTMLFONT_BOLD, - HTMLFONT_ITALIC, - HTMLFONT_BI, - HTMLFONT_CW, - HTMLFONT_MAX -}; - struct tag { struct tag *next; int refcnt; @@ -111,8 +102,8 @@ struct html { char *base_includes; /* base for include href */ char *style; /* style-sheet URI */ struct tag *metaf; /* current open font scope */ - enum htmlfont metal; /* last used font */ - enum htmlfont metac; /* current font mode */ + enum mandoc_esc metal; /* last used font */ + enum mandoc_esc metac; /* current font mode */ int oflags; /* output options */ #define HTML_FRAGMENT (1 << 0) /* don't emit HTML/HEAD/BODY */ #define HTML_TOC (1 << 1) /* emit a table of contents */ @@ -128,7 +119,6 @@ void roff_html_pre(struct html *, const struct roff void print_gen_comment(struct html *, struct roff_node *); void print_gen_decls(struct html *); void print_gen_head(struct html *); -void print_metaf(struct html *, enum mandoc_esc); struct tag *print_otag(struct html *, enum htmltag, const char *, ...); void print_tagq(struct html *, const struct tag *); void print_stagq(struct html *, const struct tag *); @@ -141,3 +131,4 @@ void print_endline(struct html *); void html_close_paragraph(struct html *); enum roff_tok html_fillmode(struct html *, enum roff_tok); char *html_make_id(const struct roff_node *, int); +int html_setfont(struct html *, enum mandoc_esc); Modified: vendor/mandoc/dist/lib.in ============================================================================== --- vendor/mandoc/dist/lib.in Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/lib.in Fri Jul 26 09:51:35 2019 (r350349) @@ -1,4 +1,4 @@ -/* $Id: lib.in,v 1.21 2019/03/04 17:35:21 schwarze Exp $ */ +/* $Id: lib.in,v 1.22 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * Copyright (c) 2009, 2012 Joerg Sonnenberger @@ -43,7 +43,7 @@ LINE("libcipher", "FreeSec Crypt Library (libcipher, \ LINE("libcompat", "Compatibility Library (libcompat, \\-lcompat)") LINE("libcrypt", "Crypt Library (libcrypt, \\-lcrypt)") LINE("libcurses", "Curses Library (libcurses, \\-lcurses)") -LINE("libcuse", "Userland Character Device Library (libcuse, \\-lcuse)") +LINE("libcuse", "Userland Character Device Library (libcuse, \\-lcuse)") LINE("libdevattr", "Device attribute and event library (libdevattr, \\-ldevattr)") LINE("libdevctl", "Device Control Library (libdevctl, \\-ldevctl)") LINE("libdevinfo", "Device and Resource Information Utility Library (libdevinfo, \\-ldevinfo)") Modified: vendor/mandoc/dist/main.c ============================================================================== --- vendor/mandoc/dist/main.c Fri Jul 26 05:59:04 2019 (r350348) +++ vendor/mandoc/dist/main.c Fri Jul 26 09:51:35 2019 (r350349) @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.322 2019/03/06 10:18:58 schwarze Exp $ */ +/* $Id: main.c,v 1.332 2019/07/19 20:27:25 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014-2019 Ingo Schwarze @@ -21,6 +21,7 @@ #include #include #include /* MACHINE */ +#include #include #include @@ -97,13 +98,10 @@ static int fs_lookup(const struct manpaths *, static int fs_search(const struct mansearch *, const struct manpaths *, int, char**, struct manpage **, size_t *); -static int koptions(int *, char *); -static void moptions(int *, char *); static void outdata_alloc(struct curparse *); static void parse(struct curparse *, int, const char *); -static void passthrough(const char *, int, int); +static void passthrough(int, int); static pid_t spawn_pager(struct tag_files *); -static int toptions(struct curparse *, char *); static void usage(enum argmode) __attribute__((__noreturn__)); static int woptions(struct curparse *, char *); @@ -125,7 +123,7 @@ main(int argc, char *argv[]) char *conf_file, *defpaths, *auxpaths; char *oarg, *tagarg; unsigned char *uc; - size_t i, sz; + size_t i, sz, ssz; int prio, best_prio; enum outmode outmode; int fd, startdir; @@ -154,10 +152,11 @@ main(int argc, char *argv[]) return mandocdb(argc, argv); #if HAVE_PLEDGE - if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) - err((int)MANDOCLEVEL_SYSERR, "pledge"); + if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) { + mandoc_msg(MANDOCERR_PLEDGE, 0, 0, "%s", strerror(errno)); + return mandoc_msg_getrc(); + } #endif - #if HAVE_SANDBOX_INIT if (sandbox_init(kSBXProfileNoInternet, SANDBOX_NAMED, NULL) == -1) errx((int)MANDOCLEVEL_SYSERR, "sandbox_init"); @@ -221,19 +220,29 @@ main(int argc, char *argv[]) outmode = OUTMODE_ALL; break; case 'I': - if (strncmp(optarg, "os=", 3)) { - warnx("-I %s: Bad argument", optarg); - return (int)MANDOCLEVEL_BADARG; + if (strncmp(optarg, "os=", 3) != 0) { + mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, + "-I %s", optarg); + return mandoc_msg_getrc(); } if (curp.os_s != NULL) { - warnx("-I %s: Duplicate argument", optarg); - return (int)MANDOCLEVEL_BADARG; + mandoc_msg(MANDOCERR_BADARG_DUPE, 0, 0, + "-I %s", optarg); + return mandoc_msg_getrc(); } curp.os_s = mandoc_strdup(optarg + 3); break; case 'K': - if ( ! koptions(&options, optarg)) - return (int)MANDOCLEVEL_BADARG; + options &= ~(MPARSE_UTF8 | MPARSE_LATIN1); + if (strcmp(optarg, "utf-8") == 0) + options |= MPARSE_UTF8; + else if (strcmp(optarg, "iso-8859-1") == 0) + options |= MPARSE_LATIN1; + else if (strcmp(optarg, "us-ascii") != 0) { + mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, + "-K %s", optarg); + return mandoc_msg_getrc(); + } break; case 'k': search.argmode = ARG_EXPR; @@ -258,12 +267,37 @@ main(int argc, char *argv[]) search.sec = optarg; break; case 'T': - if ( ! toptions(&curp, optarg)) - return (int)MANDOCLEVEL_BADARG; + if (strcmp(optarg, "ascii") == 0) + curp.outtype = OUTT_ASCII; + else if (strcmp(optarg, "lint") == 0) { + curp.outtype = OUTT_LINT; + mandoc_msg_setoutfile(stdout); + mandoc_msg_setmin(MANDOCERR_BASE); + } else if (strcmp(optarg, "tree") == 0) + curp.outtype = OUTT_TREE; + else if (strcmp(optarg, "man") == 0) + curp.outtype = OUTT_MAN; + else if (strcmp(optarg, "html") == 0) + curp.outtype = OUTT_HTML; + else if (strcmp(optarg, "markdown") == 0) + curp.outtype = OUTT_MARKDOWN; + else if (strcmp(optarg, "utf8") == 0) + curp.outtype = OUTT_UTF8; + else if (strcmp(optarg, "locale") == 0) + curp.outtype = OUTT_LOCALE; + else if (strcmp(optarg, "ps") == 0) + curp.outtype = OUTT_PS; + else if (strcmp(optarg, "pdf") == 0) + curp.outtype = OUTT_PDF; + else { + mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, + "-T %s", optarg); + return mandoc_msg_getrc(); + } break; case 'W': - if ( ! woptions(&curp, optarg)) - return (int)MANDOCLEVEL_BADARG; + if (woptions(&curp, optarg) == -1) + return mandoc_msg_getrc(); break; case 'w': outmode = OUTMODE_FLN; @@ -299,12 +333,9 @@ main(int argc, char *argv[]) search.outkey = oarg; else { while (oarg != NULL) { - thisarg = oarg; if (manconf_output(&conf.output, - strsep(&oarg, ","), 0) == 0) - continue; - warnx("-O %s: Bad argument", thisarg); - return (int)MANDOCLEVEL_BADARG; + strsep(&oarg, ","), 0) == -1) + return mandoc_msg_getrc(); } } } @@ -328,9 +359,13 @@ main(int argc, char *argv[]) } #if HAVE_PLEDGE - if (!use_pager) - if (pledge("stdio rpath", NULL) == -1) - err((int)MANDOCLEVEL_SYSERR, "pledge"); + if (use_pager == 0) { + if (pledge("stdio rpath", NULL) == -1) { + mandoc_msg(MANDOCERR_PLEDGE, 0, 0, + "%s", strerror(errno)); + return mandoc_msg_getrc(); + } + } #endif /* Parse arguments. */ @@ -355,7 +390,7 @@ main(int argc, char *argv[]) } else if (argc > 1 && ((uc = (unsigned char *)argv[0]) != NULL) && ((isdigit(uc[0]) && (uc[1] == '\0' || - (isalpha(uc[1]) && uc[2] == '\0'))) || + isalpha(uc[1]))) || (uc[0] == 'n' && uc[1] == '\0'))) { search.sec = (char *)uc; argv++; @@ -395,7 +430,7 @@ main(int argc, char *argv[]) usage(search.argmode); if (sz == 0 && search.argmode == ARG_NAME) - fs_search(&search, &conf.manpath, + (void)fs_search(&search, &conf.manpath, argc, argv, &res, &sz); if (search.argmode == ARG_NAME) { @@ -403,7 +438,10 @@ main(int argc, char *argv[]) if (strchr(argv[c], '/') == NULL) continue; if (access(argv[c], R_OK) == -1) { - warn("%s", argv[c]); + mandoc_msg_setinfilename(argv[c]); + mandoc_msg(MANDOCERR_BADARG_BAD, + 0, 0, "%s", strerror(errno)); + mandoc_msg_setinfilename(NULL); continue; } res = mandoc_reallocarray(res, @@ -411,6 +449,7 @@ main(int argc, char *argv[]) res[sz].file = mandoc_strdup(argv[c]); res[sz].names = NULL; res[sz].output = NULL; + res[sz].bits = 0; res[sz].ipath = SIZE_MAX; res[sz].sec = 10; res[sz].form = FORM_SRC; @@ -433,7 +472,7 @@ main(int argc, char *argv[]) if (outmode == OUTMODE_ONE) { argc = 1; - best_prio = 20; + best_prio = 40; } else if (outmode == OUTMODE_ALL) argc = (int)sz; @@ -452,10 +491,21 @@ main(int argc, char *argv[]) sec = res[i].file; sec += strcspn(sec, "123456789"); if (sec[0] == '\0') - continue; + continue; /* No section at all. */ prio = sec_prios[sec[0] - '1']; - if (sec[1] != '/') - prio += 10; + if (search.sec != NULL) { + ssz = strlen(search.sec); + if (strncmp(sec, search.sec, ssz) == 0) + sec += ssz; + } else + sec++; /* Prefer without suffix. */ + if (*sec != '/') + prio += 10; /* Wrong dir name. */ + if (search.sec != NULL && + (strlen(sec) <= ssz + 3 || + strcmp(sec + strlen(sec) - ssz, + search.sec) != 0)) + prio += 20; /* Wrong file ext. */ if (prio >= best_prio) continue; best_prio = prio; @@ -477,16 +527,26 @@ main(int argc, char *argv[]) #if HAVE_PLEDGE if (use_pager) { - if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) - err((int)MANDOCLEVEL_SYSERR, "pledge"); + if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) { + mandoc_msg(MANDOCERR_PLEDGE, 0, 0, + "%s", strerror(errno)); + return mandoc_msg_getrc(); + } } else { - if (pledge("stdio rpath", NULL) == -1) - err((int)MANDOCLEVEL_SYSERR, "pledge"); + if (pledge("stdio rpath", NULL) == -1) { + mandoc_msg(MANDOCERR_PLEDGE, 0, 0, + "%s", strerror(errno)); + return mandoc_msg_getrc(); + } } #endif - if (search.argmode == ARG_FILE) - moptions(&options, auxpaths); + if (search.argmode == ARG_FILE && auxpaths != NULL) { + if (strcmp(auxpaths, "doc") == 0) + options |= MPARSE_MDOC; + else if (strcmp(auxpaths, "an") == 0) + options |= MPARSE_MAN; + } mchars_alloc(); curp.mp = mparse_alloc(options, curp.os_e, curp.os_s); @@ -494,7 +554,8 @@ main(int argc, char *argv[]) if (argc < 1) { if (use_pager) { tag_files = tag_init(); - tag_files->tagname = conf.output.tag; + if (tag_files != NULL) + tag_files->tagname = conf.output.tag; } thisarg = ""; mandoc_msg_setinfilename(thisarg); @@ -527,30 +588,31 @@ main(int argc, char *argv[]) } else thisarg = *argv; + mandoc_msg_setinfilename(thisarg); fd = mparse_open(curp.mp, thisarg); if (fd != -1) { if (use_pager) { use_pager = 0; tag_files = tag_init(); - tag_files->tagname = conf.output.tag; + if (tag_files != NULL) + tag_files->tagname = conf.output.tag; } - mandoc_msg_setinfilename(thisarg); if (resp == NULL || resp->form == FORM_SRC) parse(&curp, fd, thisarg); else - passthrough(resp->file, fd, - conf.output.synopsisonly); - mandoc_msg_setinfilename(NULL); + passthrough(fd, conf.output.synopsisonly); if (ferror(stdout)) { if (tag_files != NULL) { - warn("%s", tag_files->ofn); + mandoc_msg(MANDOCERR_WRITE, 0, 0, + "%s: %s", tag_files->ofn, + strerror(errno)); tag_unlink(); tag_files = NULL; } else - warn("stdout"); - mandoc_msg_setrc(MANDOCLEVEL_SYSERR); + mandoc_msg(MANDOCERR_WRITE, 0, 0, + "%s", strerror(errno)); break; } @@ -560,9 +622,11 @@ main(int argc, char *argv[]) terminal_sepline(curp.outdata); } } else - mandoc_msg(MANDOCERR_FILE, 0, 0, - "%s: %s", thisarg, strerror(errno)); + mandoc_msg(resp == NULL ? MANDOCERR_BADARG_BAD : + MANDOCERR_OPEN, 0, 0, "%s", strerror(errno)); + mandoc_msg_setinfilename(NULL); + if (curp.wstop && mandoc_msg_getrc() != MANDOCLEVEL_OK) break; @@ -653,8 +717,8 @@ out: continue; if (pid == -1) { - warn("wait"); - mandoc_msg_setrc(MANDOCLEVEL_SYSERR); + mandoc_msg(MANDOCERR_WAIT, 0, 0, + "%s", strerror(errno)); break; } if (!WIFSTOPPED(status)) @@ -663,14 +727,16 @@ out: signum = WSTOPSIG(status); } tag_unlink(); - } + } else if (curp.outtype != OUTT_LINT && + (search.argmode == ARG_FILE || sz > 0)) + mandoc_msg_summary(); + return (int)mandoc_msg_getrc(); } static void usage(enum argmode argmode) { - switch (argmode) { case ARG_FILE: fputs("usage: mandoc [-ac] [-I os=name] " @@ -701,6 +767,7 @@ fs_lookup(const struct manpaths *paths, size_t ipath, const char *sec, const char *arch, const char *name, struct manpage **res, size_t *ressz) { + struct stat sb; glob_t globinfo; struct manpage *page; char *file; @@ -710,13 +777,13 @@ fs_lookup(const struct manpaths *paths, size_t ipath, form = FORM_SRC; mandoc_asprintf(&file, "%s/man%s/%s.%s", paths->paths[ipath], sec, name, sec); - if (access(file, R_OK) != -1) + if (stat(file, &sb) != -1) goto found; free(file); mandoc_asprintf(&file, "%s/cat%s/%s.0", paths->paths[ipath], sec, name); - if (access(file, R_OK) != -1) { + if (stat(file, &sb) != -1) { form = FORM_CAT; goto found; } @@ -725,7 +792,7 @@ fs_lookup(const struct manpaths *paths, size_t ipath, if (arch != NULL) { mandoc_asprintf(&file, "%s/man%s/%s/%s.%s", paths->paths[ipath], sec, arch, name, sec); - if (access(file, R_OK) != -1) + if (stat(file, &sb) != -1) goto found; free(file); } @@ -734,37 +801,42 @@ fs_lookup(const struct manpaths *paths, size_t ipath, paths->paths[ipath], sec, name); globres = glob(file, 0, NULL, &globinfo); if (globres != 0 && globres != GLOB_NOMATCH) - warn("%s: glob", file); + mandoc_msg(MANDOCERR_GLOB, 0, 0, + "%s: %s", file, strerror(errno)); free(file); if (globres == 0) file = mandoc_strdup(*globinfo.gl_pathv); globfree(&globinfo); - if (globres == 0) - goto found; + if (globres == 0) { + if (stat(file, &sb) != -1) + goto found; + free(file); + } if (res != NULL || ipath + 1 != paths->sz) - return 0; + return -1; mandoc_asprintf(&file, "%s.%s", name, sec); - globres = access(file, R_OK); + globres = stat(file, &sb); free(file); - return globres != -1; + return globres; found: warnx("outdated mandoc.db lacks %s(%s) entry, run %s %s", name, sec, BINM_MAKEWHATIS, paths->paths[ipath]); if (res == NULL) { free(file); - return 1; + return 0; } - *res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage)); + *res = mandoc_reallocarray(*res, ++*ressz, sizeof(**res)); page = *res + (*ressz - 1); page->file = file; page->names = NULL; page->output = NULL; + page->bits = NAME_FILE & NAME_MASK; page->ipath = ipath; page->sec = (*sec >= '1' && *sec <= '9') ? *sec - '1' + 1 : 10; page->form = form; - return 1; + return 0; } static int @@ -786,14 +858,14 @@ fs_search(const struct mansearch *cfg, const struct ma for (ipath = 0; ipath < paths->sz; ipath++) { if (cfg->sec != NULL) { if (fs_lookup(paths, ipath, cfg->sec, - cfg->arch, *argv, res, ressz) && + cfg->arch, *argv, res, ressz) != -1 && cfg->firstmatch) - return 1; + return 0; } else for (isec = 0; isec < nsec; isec++) if (fs_lookup(paths, ipath, sections[isec], - cfg->arch, *argv, res, ressz) && + cfg->arch, *argv, res, ressz) != -1 && cfg->firstmatch) - return 1; + return 0; } if (res != NULL && *ressz == lastsz && strchr(*argv, '/') == NULL) { @@ -812,7 +884,7 @@ fs_search(const struct mansearch *cfg, const struct ma argv++; argc--; } - return 0; + return -1; } static void @@ -919,7 +991,7 @@ check_xr(void) search.firstmatch = 1; if (mansearch(&search, &paths, 1, &xr->name, NULL, &sz)) continue; - if (fs_search(&search, &paths, 1, &xr->name, NULL, &sz)) + if (fs_search(&search, &paths, 1, &xr->name, NULL, &sz) != -1) continue; if (xr->count == 1) mandoc_msg(MANDOCERR_XR_BAD, xr->line, @@ -959,34 +1031,34 @@ outdata_alloc(struct curparse *curp) } static void -passthrough(const char *file, int fd, int synopsis_only) +passthrough(int fd, int synopsis_only) { const char synb[] = "S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS"; const char synr[] = "SYNOPSIS"; FILE *stream; - const char *syscall; char *line, *cp; size_t linesz; ssize_t len, written; - int print; + int lno, print; + stream = NULL; line = NULL; linesz = 0; if (fflush(stdout) == EOF) { - syscall = "fflush"; - goto fail; + mandoc_msg(MANDOCERR_FFLUSH, 0, 0, "%s", strerror(errno)); + goto done; } - if ((stream = fdopen(fd, "r")) == NULL) { close(fd); - syscall = "fdopen"; - goto fail; + mandoc_msg(MANDOCERR_FDOPEN, 0, 0, "%s", strerror(errno)); + goto done; } - print = 0; + lno = print = 0; while ((len = getline(&line, &linesz, stream)) != -1) { + lno++; cp = line; if (synopsis_only) { if (print) { @@ -1004,97 +1076,23 @@ passthrough(const char *file, int fd, int synopsis_onl } } for (; len > 0; len -= written) { - if ((written = write(STDOUT_FILENO, cp, len)) != -1) - continue; - fclose(stream); - syscall = "write"; - goto fail; + if ((written = write(STDOUT_FILENO, cp, len)) == -1) { + mandoc_msg(MANDOCERR_WRITE, 0, 0, + "%s", strerror(errno)); + goto done; + } } } + if (ferror(stream)) + mandoc_msg(MANDOCERR_GETLINE, lno, 0, "%s", strerror(errno)); - if (ferror(stream)) { - fclose(stream); - syscall = "getline"; - goto fail; - } - done: free(line); - fclose(stream); - return; - -fail: - free(line); - warn("%s: SYSERR: %s", file, syscall); - mandoc_msg_setrc(MANDOCLEVEL_SYSERR); + if (stream != NULL) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 26 09:53: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 0BF52BB597; Fri, 26 Jul 2019 09:53:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 ED06088367; Fri, 26 Jul 2019 09:53:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7D41D6BA; Fri, 26 Jul 2019 09:53:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6Q9rM26070128; Fri, 26 Jul 2019 09:53:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6Q9rM1P070124; Fri, 26 Jul 2019 09:53:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201907260953.x6Q9rM1P070124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 26 Jul 2019 09:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350350 - vendor/mandoc/20190723 X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: vendor/mandoc/20190723 X-SVN-Commit-Revision: 350350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ED06088367 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.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: Fri, 26 Jul 2019 09:53:23 -0000 Author: bapt Date: Fri Jul 26 09:53:21 2019 New Revision: 350350 URL: https://svnweb.freebsd.org/changeset/base/350350 Log: Tag import of mandoc snapshot 2019-07-23 Added: vendor/mandoc/20190723/ - copied from r350348, vendor/mandoc/dist/ Replaced: vendor/mandoc/20190723/Makefile.depend - copied unchanged from r350349, vendor/mandoc/dist/Makefile.depend vendor/mandoc/20190723/TODO - copied unchanged from r350349, vendor/mandoc/dist/TODO vendor/mandoc/20190723/arch.c - copied unchanged from r350349, vendor/mandoc/dist/arch.c vendor/mandoc/20190723/cgi.c - copied unchanged from r350349, vendor/mandoc/dist/cgi.c vendor/mandoc/20190723/configure - copied unchanged from r350349, vendor/mandoc/dist/configure vendor/mandoc/20190723/dbm.c - copied unchanged from r350349, vendor/mandoc/dist/dbm.c vendor/mandoc/20190723/dbm_map.h - copied unchanged from r350349, vendor/mandoc/dist/dbm_map.h vendor/mandoc/20190723/eqn.7 - copied unchanged from r350349, vendor/mandoc/dist/eqn.7 vendor/mandoc/20190723/eqn_html.c - copied unchanged from r350349, vendor/mandoc/dist/eqn_html.c vendor/mandoc/20190723/html.c - copied unchanged from r350349, vendor/mandoc/dist/html.c vendor/mandoc/20190723/html.h - copied unchanged from r350349, vendor/mandoc/dist/html.h vendor/mandoc/20190723/lib.in - copied unchanged from r350349, vendor/mandoc/dist/lib.in vendor/mandoc/20190723/main.c - copied unchanged from r350349, vendor/mandoc/dist/main.c vendor/mandoc/20190723/man.7 - copied unchanged from r350349, vendor/mandoc/dist/man.7 vendor/mandoc/20190723/man_html.c - copied unchanged from r350349, vendor/mandoc/dist/man_html.c vendor/mandoc/20190723/man_term.c - copied unchanged from r350349, vendor/mandoc/dist/man_term.c vendor/mandoc/20190723/man_validate.c - copied unchanged from r350349, vendor/mandoc/dist/man_validate.c vendor/mandoc/20190723/mandoc.1 - copied unchanged from r350349, vendor/mandoc/dist/mandoc.1 vendor/mandoc/20190723/mandoc.c - copied unchanged from r350349, vendor/mandoc/dist/mandoc.c vendor/mandoc/20190723/mandoc.css - copied unchanged from r350349, vendor/mandoc/dist/mandoc.css vendor/mandoc/20190723/mandoc.h - copied unchanged from r350349, vendor/mandoc/dist/mandoc.h vendor/mandoc/20190723/mandoc_char.7 - copied unchanged from r350349, vendor/mandoc/dist/mandoc_char.7 vendor/mandoc/20190723/mandoc_headers.3 - copied unchanged from r350349, vendor/mandoc/dist/mandoc_headers.3 vendor/mandoc/20190723/mandoc_msg.c - copied unchanged from r350349, vendor/mandoc/dist/mandoc_msg.c vendor/mandoc/20190723/mandocdb.c - copied unchanged from r350349, vendor/mandoc/dist/mandocdb.c vendor/mandoc/20190723/manpath.c - copied unchanged from r350349, vendor/mandoc/dist/manpath.c vendor/mandoc/20190723/mansearch.c - copied unchanged from r350349, vendor/mandoc/dist/mansearch.c vendor/mandoc/20190723/mansearch.h - copied unchanged from r350349, vendor/mandoc/dist/mansearch.h vendor/mandoc/20190723/mdoc.7 - copied unchanged from r350349, vendor/mandoc/dist/mdoc.7 vendor/mandoc/20190723/mdoc_argv.c - copied unchanged from r350349, vendor/mandoc/dist/mdoc_argv.c vendor/mandoc/20190723/mdoc_markdown.c - copied unchanged from r350349, vendor/mandoc/dist/mdoc_markdown.c vendor/mandoc/20190723/mdoc_term.c - copied unchanged from r350349, vendor/mandoc/dist/mdoc_term.c vendor/mandoc/20190723/mdoc_validate.c - copied unchanged from r350349, vendor/mandoc/dist/mdoc_validate.c vendor/mandoc/20190723/out.c - copied unchanged from r350349, vendor/mandoc/dist/out.c vendor/mandoc/20190723/read.c - copied unchanged from r350349, vendor/mandoc/dist/read.c vendor/mandoc/20190723/roff.7 - copied unchanged from r350349, vendor/mandoc/dist/roff.7 vendor/mandoc/20190723/roff.c - copied unchanged from r350349, vendor/mandoc/dist/roff.c vendor/mandoc/20190723/roff_html.c - copied unchanged from r350349, vendor/mandoc/dist/roff_html.c vendor/mandoc/20190723/tag.c - copied unchanged from r350349, vendor/mandoc/dist/tag.c vendor/mandoc/20190723/tbl_html.c - copied unchanged from r350349, vendor/mandoc/dist/tbl_html.c vendor/mandoc/20190723/tbl_term.c - copied unchanged from r350349, vendor/mandoc/dist/tbl_term.c vendor/mandoc/20190723/term.c - copied unchanged from r350349, vendor/mandoc/dist/term.c Deleted: vendor/mandoc/20190723/libroff.h Copied: vendor/mandoc/20190723/Makefile.depend (from r350349, vendor/mandoc/dist/Makefile.depend) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mandoc/20190723/Makefile.depend Fri Jul 26 09:53:21 2019 (r350350, copy of r350349, vendor/mandoc/dist/Makefile.depend) @@ -0,0 +1,81 @@ +arch.o: arch.c config.h roff.h +att.o: att.c config.h roff.h libmdoc.h +catman.o: catman.c config.h compat_fts.h +cgi.o: cgi.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h main.h manconf.h mansearch.h cgi.h +chars.o: chars.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h libmandoc.h +compat_err.o: compat_err.c config.h +compat_fts.o: compat_fts.c config.h compat_fts.h +compat_getline.o: compat_getline.c config.h +compat_getsubopt.o: compat_getsubopt.c config.h +compat_isblank.o: compat_isblank.c config.h +compat_mkdtemp.o: compat_mkdtemp.c config.h +compat_ohash.o: compat_ohash.c config.h compat_ohash.h +compat_progname.o: compat_progname.c config.h +compat_reallocarray.o: compat_reallocarray.c config.h +compat_recallocarray.o: compat_recallocarray.c config.h +compat_strcasestr.o: compat_strcasestr.c config.h +compat_stringlist.o: compat_stringlist.c config.h compat_stringlist.h +compat_strlcat.o: compat_strlcat.c config.h +compat_strlcpy.o: compat_strlcpy.c config.h +compat_strndup.o: compat_strndup.c config.h +compat_strsep.o: compat_strsep.c config.h +compat_strtonum.o: compat_strtonum.c config.h +compat_vasprintf.o: compat_vasprintf.c config.h +dba.o: dba.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mansearch.h dba_write.h dba_array.h dba.h +dba_array.o: dba_array.c mandoc_aux.h dba_write.h dba_array.h +dba_read.o: dba_read.c mandoc_aux.h mansearch.h dba_array.h dba.h dbm.h +dba_write.o: dba_write.c config.h dba_write.h +dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h +dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h +demandoc.o: demandoc.c config.h mandoc.h roff.h man.h mdoc.h mandoc_parse.h +eqn.o: eqn.c config.h mandoc_aux.h mandoc.h roff.h eqn.h libmandoc.h eqn_parse.h +eqn_html.o: eqn_html.c config.h mandoc.h roff.h eqn.h out.h html.h +eqn_term.o: eqn_term.c config.h eqn.h out.h term.h +html.o: html.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h out.h html.h manconf.h main.h +lib.o: lib.c config.h roff.h libmdoc.h lib.in +main.o: main.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h man.h mandoc_parse.h tag.h main.h manconf.h mansearch.h +man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h +man_html.o: man_html.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h html.h main.h +man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h +man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h tag.h main.h +man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h +mandoc.o: mandoc.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h roff_int.h +mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h +mandoc_msg.o: mandoc_msg.c config.h mandoc.h +mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h +mandoc_xr.o: mandoc_xr.c mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.h +mandocd.o: mandocd.c config.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h main.h manconf.h +mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h manconf.h mansearch.h dba_array.h dba.h +manpath.o: manpath.c config.h mandoc_aux.h mandoc.h manconf.h +mansearch.o: mansearch.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h +mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_html.o: mdoc_html.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h html.h main.h +mdoc_macro.o: mdoc_macro.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_man.o: mdoc_man.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h out.h main.h +mdoc_markdown.o: mdoc_markdown.c mandoc_aux.h mandoc.h roff.h mdoc.h main.h +mdoc_state.o: mdoc_state.c mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_term.o: mdoc_term.c config.h mandoc_aux.h roff.h mdoc.h out.h term.h tag.h main.h +mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +msec.o: msec.c config.h mandoc.h libmandoc.h msec.in +out.o: out.c config.h mandoc_aux.h tbl.h out.h +preconv.o: preconv.c config.h mandoc.h roff.h mandoc_parse.h libmandoc.h +read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h libmandoc.h roff_int.h +roff.o: roff.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mandoc_parse.h libmandoc.h roff_int.h tbl_parse.h eqn_parse.h predefs.in +roff_html.o: roff_html.c mandoc.h roff.h out.h html.h +roff_term.o: roff_term.c mandoc.h roff.h out.h term.h +roff_validate.o: roff_validate.c mandoc.h roff.h libmandoc.h roff_int.h +soelim.o: soelim.c config.h compat_stringlist.h +st.o: st.c config.h mandoc.h roff.h libmdoc.h +tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h tag.h +tbl.o: tbl.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_parse.h tbl_int.h +tbl_data.o: tbl_data.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h +tbl_html.o: tbl_html.c config.h mandoc.h roff.h tbl.h out.h html.h +tbl_layout.o: tbl_layout.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h +tbl_opts.o: tbl_opts.c config.h mandoc.h tbl.h libmandoc.h tbl_int.h +tbl_term.o: tbl_term.c config.h mandoc.h tbl.h out.h term.h +term.o: term.c config.h mandoc.h mandoc_aux.h out.h term.h main.h +term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h manconf.h main.h +term_ps.o: term_ps.c config.h mandoc_aux.h out.h term.h manconf.h main.h +term_tab.o: term_tab.c mandoc_aux.h out.h term.h +tree.o: tree.c config.h mandoc.h roff.h mdoc.h man.h tbl.h eqn.h main.h Copied: vendor/mandoc/20190723/TODO (from r350349, vendor/mandoc/dist/TODO) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mandoc/20190723/TODO Fri Jul 26 09:53:21 2019 (r350350, copy of r350349, vendor/mandoc/dist/TODO) @@ -0,0 +1,583 @@ +************************************************************************ +* Official mandoc TODO. +* $Id: TODO,v 1.295 2019/06/11 16:04:36 schwarze Exp $ +************************************************************************ + +Many issues are annotated for difficulty as follows: + + - loc = locality of the issue + * single file issue, affects file only, or very few + ** single module issue, affects several files of one module + *** cross-module issue, significantly impacts multiple modules + and may require substantial changes to internal interfaces + - exist = difficulty of the existing code in this area + * affected code is straightforward and easy to read and change + ** affected code is somewhat complex, but once you understand + the design, not particularly difficult to understand + *** affected code uses a special, exceptionally tricky design + - algo = difficulty of the new algorithm to be written + * the required logic and code is straightforward + ** the required logic is somewhat complex and needs a careful design + *** the required logic is exceptionally tricky, + maybe an approach to solve that is not even known yet + - size = the amount of code to be written or changed + * a small number of lines (at most 100, usually much less) + ** a considerable amount of code (several dozen to a few hundred) + *** a large amount of code (many hundreds, maybe thousands) + - imp = importance of the issue + * mostly for completeness + ** would be nice to have + *** issue causes considerable inconvenience + +Obviously, as the issues have not been solved yet, these annotations +are mere guesses, and some may be wrong. + +************************************************************************ +* missing features +************************************************************************ + +--- missing roff features ---------------------------------------------- + +- .ad (adjust margins) + .ad l -- adjust left margin only (flush left) + .ad r -- adjust right margin only (flush right) + .ad c -- center text on line + .ad b -- adjust both margins (alias: .ad n) + .na -- temporarily disable adjustment without changing the mode + .ad -- re-enable adjustment without changing the mode + Adjustment mode is ignored while in no-fill mode (.nf). + loc *** exist *** algo ** size ** imp ** (parser reorg would help) + +- .fc (field control) + found by naddy@ in xloadimage(1) + loc ** exist *** algo * size * imp * + +- .ns (no-space mode) occurs in xine-config(1) + when implementing this, also let .TH set it + reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + loc *** exist *** algo *** size ** imp * + +- \w'' improve width measurements + would not be very useful without an expression parser, see below + needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 + loc ** exist *** algo *** size * imp *** + +- .als only works for macros in mandoc, not for user-defined strings. + Also, the "val" field in struct roffkv would have to be replaced + with a pointer to a reference-counted wrapper, and an alias + would have to point to the same wrapper as the original. + .als to undefined does nothing; the alias is not created. + .rm'ing the original leaves the alias to point to the old value. + .de .als .de changes both, but + .de .als .rm .de only changes the new value, not the alias. + Found in groffer(1) version 1.19 + Jan Stary 20 Apr 2019 20:16:54 +0200 + loc * exist ** algo ** size ** imp * + +- roff string condition comparisons fail when vars contain quotes: + .ds s ' + .if '\*s'' \&... + hard to fix because of the basic architecture (string replacement + happens before roff(7) syntax parsing) + Found in groffer(1) version 1.19 + Jan Stary 20 Apr 2019 20:16:54 +0200 + loc * exist *** algo *** size ** imp * + +--- missing mdoc features ---------------------------------------------- + +- .Bl -column .Xo support is missing + ultimate goal: + restore .Xr and .Dv to + lib/libc/compat-43/sigvec.3 + lib/libc/gen/signal.3 + lib/libc/sys/sigaction.2 + loc * exist *** algo *** size * imp ** + +- edge case: decide how to deal with blk_full bad nesting, e.g. + .Sh .Nm .Bk .Nm .Ek .Sh found by jmc@ in ssh-keygen(1) + from jmc@ Wed, 14 Jul 2010 18:10:32 +0100 + loc * exist *** algo *** size ** imp ** + +- .Bd -filled should not be the same as .Bd -ragged, but align both + the left and right margin. In groff, it is implemented in terms + of .ad b, which we don't have either. Found in cksum(1). + loc *** exist *** algo ** size ** imp ** (parser reorg would help) + +- implement blank `Bl -column', such as + .Bl -column + .It foo Ta bar + .El + loc * exist *** algo *** size * imp * + +- explicitly disallow nested `Bl -column', which would clobber internal + flags defined for struct mdoc_macro + loc * exist * algo * size * imp ** + +- In .Bl -column .It, the end of the line probably has to be regarded + as an implicit .Ta, if there could be one, see the following mildly + ugly code from login.conf(5): + .Bl -column minpasswordlen program xetcxmotd + .It path Ta path Ta value of Dv _PATH_DEFPATH + .br + Default search path. + reported by Michal Mazurek + via jmc@ Thu, 7 Apr 2011 16:00:53 +0059 + loc * exist *** algo ** size * imp ** + +- inside `.Bl -column' phrases, punctuation is handled like normal + text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -." + +- inside `.Bl -column' phrases, TERMP_IGNDELIM handling by `Pf' + is not safe, e.g. `.Bl -column .It Pf a b .' gives "ab." + but should give "ab ." + +- prohibit `Nm' from having non-text HEAD children + (e.g., NetBSD mDNSShared/dns-sd.1) + (mdoc_html.c and mdoc_term.c `Nm' handlers can be slightly simplified) + +- support translated section names + e.g. x11/scrotwm scrotwm_es.1:21:2: error: NAME section must be first + that one uses NOMBRE because it is spanish... + deraadt tends to think that section-dependent macro behaviour + is a bad idea in the first place, so this may be irrelevant + loc ** exist ** algo ** size * imp ** + +- When there is free text in the SYNOPSIS and that free text contains + the .Nm macro, groff somehow understands to treat the .Nm as an in-line + macro, while mandoc treats it as a block macro and breaks the line. + No idea how the logic for distinguishing in-line and block instances + should be, needs investigation. + uqs@ Thu, 2 Jun 2011 11:03:51 +0200 + uqs@ Thu, 2 Jun 2011 11:33:35 +0200 + loc * exist ** algo *** size * imp ** + +--- missing man features ----------------------------------------------- + +- groff_www(7) .MTO and .URL + These macros were used by the GNU grep(1) man page. + The groff_www(7) manual page itself uses them, too. + We should probably *not* add them to mandoc. + Just mentioning this here to keep track of the abuse. + Laura Morales 20 Apr 2018 07:33:02 +0200 + loc ** exist * algo * size ** imp * + +--- missing tbl features ----------------------------------------------- + +- vertical centering in cells vertically spanned with ^ + pali dot rohar at gmail dot com 16 Jul 2018 13:03:35 +0200 + loc * exist *** algo *** size ** imp * + +- support mdoc(7) and man(7) macros inside tbl(7) code; + probably requires the parser reorg and letting tbl(7) + use roff_node such that macro sets can mix; + informed by bapt@ that FreeBSD needs this: 3 Jan 2015 23:32:23 +0100 + loc *** exist ** algo *** size ** imp *** + +- look at the POSIX manuals in the books/man-pages-posix port, + they use some unsupported tbl(7) features, mostly macros in tbl(7). + loc * exist ** algo ** size ** imp *** + +- look what Joerg Schilling manual pages use + Thu, 19 Mar 2015 18:31:48 +0100 + +--- missing eqn features ----------------------------------------------- + +- In a matrix, break the output line after each matrix line. + Found in the discussion at CDBUG 2015. Suggested by Avi Weinstock. + This may not be the ideal solution after all: eqn(7) matrices + are lists of columns, so Avi's proposal would show each *column* + on its own *line*, which is likely to cause confusion. + A better solution, but much harder to implement, would be to + actually show the coordinates of column vectors on different + terminal output lines, using the clumnated output facilities + developed for .Bl -tag, .Bl -column, and also used for tbl(7). + loc * exist * algo ** size ** imp ** + +- The "size" keyword is parsed, but ignored by the formatter. + loc * exist * algo * size * imp * + +- The spacing characters `~', `^', and tab are currently ignored, + see User's Guide (Second Edition) page 2 section 4. + loc * exist * algo ** size * imp ** + +- Mark and lineup are parsed and ignored, + see User's Guide (Second Edition) page 5 section 15. + loc ** exist ** algo ** size ** imp ** + +- GNU eqn converts some operators to special characters, for example, + input HYPHEN-MINUS becomes output \(mi, unless it is part of a + quoted word. mandoc(1) only does this when the operator is + surrounded by blanks, not when it is part of an unquoted word. + Also, check whether there are more such cases (e.g., +?). + reported by bentley@ 20 Jun 2017 02:04:29 -0600 + loc * exist ** algo ** size * imp * + +- Primes, opprime, and ' + bentley@ Thu, 13 Jul 2017 23:14:20 -0600 + +--- missing misc features ---------------------------------------------- + +- man -ks 1,8 route; kn@ Jul 13, 2018 orally + +- italic correction (\/) in PostScript mode + Werner LEMBERG on groff at gnu dot org Sun, 10 Nov 2013 12:47:46 + loc ** exist ** algo * size * imp * + +- change the default PAGER to more -Es and use the pager + even for apropos title line output; req by bapt@ + loc * exist * algo * size * imp *** + +- clean up escape sequence handling, creating three classes: + (1) fully implemented, or parsed and ignored without loss of content + (2) unimplemented, potentially causing loss of content + or serious mangling of formatting (e.g. \n) -> ERROR + see textproc/mgdiff(1) for nice examples + (3) undefined, just output the character -> perhaps WARNING + loc *** exist ** algo ** size ** imp *** (parser reorg helps) + +- kettenis wants base roff, ms, and me Fri, 1 Jan 2010 22:13:15 +0100 (CET) + loc ** exist ** algo ** size *** imp * + +--- compatibility checks ----------------------------------------------- + +- is .Bk implemented correctly in modern groff? + sobrado@ Tue, 19 Apr 2011 22:12:55 +0200 + +- compare output to Heirloom roff, Solaris roff, and + http://repo.or.cz/w/neatroff.git http://litcave.rudi.ir/ + +- look at AT&T DWB http://www2.research.att.com/sw/download + Carsten Kunze has patches + Mon, 4 Aug 2014 17:01:28 +0200 + ported version: https://github.com/n-t-roff/DWB3.3 + Carsten Kunze Wed, 22 Apr 2015 11:21:43 +0200 + +- look at pages generated from reStructeredText, e.g. devel/mercurial hg(1) + These are a weird mixture of man(7) and custom autogenerated low-level + roff stuff. Figure out to what extent we can cope. + For details, see http://docutils.sourceforge.net/rst.html + noted by stsp@ Sat, 24 Apr 2010 09:17:55 +0200 + reminded by nicm@ Mon, 3 May 2010 09:52:41 +0100 + +- look at pages generated from ronn(1) github.com/rtomayko/ronn + (based on markdown) + +- look at pages generated from Texinfo source by yat2m, e.g. security/gnupg + First impression is not that bad. + +- look at pages generated by pandoc; see + https://github.com/jgm/pandoc/blob/master/src/Text/Pandoc/Writers/Man.hs + porting planned by kili@ Thu, 19 Jun 2014 19:46:28 +0200 + +- check compatibility with Plan9: + http://swtch.com/usr/local/plan9/tmac/tmac.an + http://swtch.com/plan9port/man/man7/man.html + "Anthony J. Bentley" 28 Dec 2010 21:58:40 -0700 + +- check compatibility with COHERENT troff: + http://www.nesssoftware.com/home/mwc/source.php + +- check compatibility with the man(7) formatter + https://raw.githubusercontent.com/rofl0r/hardcore-utils/master/man.c + +- check compatibility with + http://ikiwiki.info/plugins/contrib/mandoc/ + https://github.com/schmonz/ikiwiki/compare/mandoc + Amitai Schlair Mon, 19 May 2014 14:05:53 -0400 + +- check compatibility with + https://git.sr.ht/~sircmpwn/scdoc + +- check features of the Slackware man.conf(5) format + Carsten Kunze Wed, 11 Mar 2015 17:57:24 +0100 + +************************************************************************ +* formatting issues: ugly output +************************************************************************ + +- revisit empty in-line macros + look at the difference between "Em x Em ." and "Sq x Em ." + Carsten Kunze Fri, 12 Dec 2014 00:15:41 +0100 + loc *** exist *** algo *** size * imp ** + +- a column list with blank `Ta' cells triggers a spurious + start-with-whitespace printing of a newline + +- In .Bl -column, .It a"bc" + shows the quotes in groff, but not in mandoc + loc * exist *** algo ** size * imp ** + +- In .Bl -column, + .It Em AuthenticationKey Length + ought to render "Key Length" with emphasis, too, + see OpenBSD iked.conf(5). + reported again Nicolas Joly via wiz@ Wed, 12 Oct 2011 00:20:00 +0200 + loc * exist *** algo *** size ** imp *** + +- empty phrases in .Bl column produce too few blanks + try e.g. .Bl -column It Ta Ta + reported by millert Fri, 02 Apr 2010 16:13:46 -0400 + loc * exist *** algo *** size * imp ** + +- .%T can have trailing punctuation. Currently, it puts the trailing + punctuation into a trailing MDOC_TEXT element inside its own scope. + That element should rather be outside its scope, such that the + punctuation does not get underlines. This is not trivial to + implement because .%T then needs some features of in_line_eoln() - + slurp all arguments into one single text element - and one feature + of in_line() - put trailing punctuation out of scope. + Found in mount_nfs(8) and exports(5), search for "Appendix". + loc ** exist ** algo *** size * imp ** + +- Trailing punctuation after .%T triggers EOS spacing, at least + outside .Rs (eek!). Simply setting ARGSFL_DELIM for .%T is not + the right solution, it sends mandoc into an endless loop. + reported by Nicolas Joly Sat, 17 Nov 2012 11:49:54 +0100 + loc * exist ** algo ** size * imp ** + +- global variables in the SYNOPSIS of section 3 pages + .Vt vs .Vt/.Va vs .Ft/.Va vs .Ft/.Fa ... + from kristaps@ Tue, 08 Jun 2010 11:13:32 +0200 + +- implicit whitespace around inline equations + example code: where '$times$' denotes matrix multiplication + must not have an HTML line break, nor a blank, before + partial solution: html.c {"math", HTML_NLINSIDE | HTML_INDENT}, + bentley@ Thu, 13 Jul 2017 19:00:59 -0600 + +- in enclosures, mandoc sometimes fancies a bogus end of sentence + reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059 + loc * exist ** algo *** size * imp *** + +- a line starting with "\fB something" counts as starting with whitespace + and triggers a line break; found in audio/normalize-mp3(1) + This will become easier once escape sequences are represented + by syntax tree nodes. + loc ** exist * algo ** size * imp ** + +- formatting /usr/local/man/man1/latex2man.1 with groff and mandoc + reveals lots of bugs both in groff and mandoc... + reported by bentley@ Wed, 22 May 2013 23:49:30 -0600 + +--- PostScript and PDF issues ------------------------------------------ + +- PDF output doesn't use a monospaced font for .Bd -literal + Example: "mandoc -Tpdf afterboot.8 > output.pdf && pdfviewer output.pdf". + Search the text "Routing tables". + Also check what PostScript mode does when fixing this. + reported by juanfra@ Wed, 04 Jun 2014 21:44:58 +0200 + instructions from juanfra@ Wed, 11 Jun 2014 02:21:01 +0200 + add a new <> block to the PDF files with /BaseFont /Courier + and change the /Name from /F0 to the new font (/F5 (?)). + re-reported by tb@ Mon, 16 Mar 2015 16:47:21 +0100 + loc * exist ** algo ** size * imp ** + +--- HTML issues -------------------------------------------------------- + +- .Bf at the beginning of a paragraph inserts a bogus 1ex horizontal + space, see for example random(3). Introduced in + http://mdocml.bsd.lv/cgi-bin/cvsweb/mdoc_html.c.diff?r1=1.91&r2=1.92 + reported by deraadt@ Mon, 28 Sep 2015 20:14:13 -0600 (MDT) + loc ** exist ** algo ** size * imp * + +- jsg on icb, Nov 3, 2014: + try to guess Xr in man(7) for hyperlinking + and render them with + https://github.com/Debian/debiman/issues/15 + loc * exist * algo ** size ** imp ** + +- The tables used to render the three-part page headers actually force + the width of the to the max-width given for . + Not yet sure how to fix that... + Observed by an Anonymous Coward on undeadly.org: + http://undeadly.org/cgi?action=article&sid=20140925064244&pid=1 + loc * exist * algo ** size * imp *** + +- generate tags in HTML + idea from florian@ Tue, 7 Apr 2015 00:26:28 +0000 + may be possible to implement with .Lk img://something.png alt_text + +- check https://github.com/trentm/mdocml + +************************************************************************ +* formatting issues: gratuitous differences +************************************************************************ + +- .Fn reopens a new scope after punctuation in mandoc, + but closes its scope for good in groff. + Do we want to change mandoc or groff? + Steffen Nurpmeso Sat, 08 Nov 2014 13:34:59 +0100 + loc * exist ** algo ** size * imp ** + +- In .Bl -enum -width 0n, groff continues one the same line after + the number, mandoc breaks the line. + mail to kristaps@ Mon, 20 Jul 2009 02:21:39 +0200 + loc * exist ** algo ** size * imp ** + +- .Pp between two .It in .Bl -column should produce one, + not two blank lines, see e.g. login.conf(5). + reported by jmc@ Sun, 17 Apr 2011 14:04:58 +0059 + reported again by sthen@ Wed, 18 Jan 2012 02:09:39 +0000 (UTC) + loc * exist *** algo ** size * imp ** + +- If the *first* line after .It is .Pp, break the line right after + the tag, do not pad with space characters before breaking. + See the description of the a, c, and i commands in sed(1). + loc * exist ** algo ** size * imp ** + +- If the first line after .It is .D1, do not assert a blank line + in between, see for example tmux(1). + reported by nicm@ 13 Jan 2011 00:18:57 +0000 + loc * exist ** algo ** size * imp ** + +- Trailing punctuation after .It should trigger EOS spacing. + reported by Nicolas Joly Sat, 17 Nov 2012 11:49:54 +0100 + Probably, this should be fixed somewhere in termp_it_pre(), not sure. + loc * exist ** algo ** size * imp ** + +- When the -width string contains macros, the macros must be rendered + before measuring the width, for example + .Bl -tag -width ".Dv message" + in magic(5), located in src/usr.bin/file, is the same + as -width 7n, not -width 11n. + The same applies to .Bl -column column widths; + reported again by Nicolas Joly Thu, 1 Mar 2012 13:41:26 +0100 via wiz@ 5 Mar + reported again by Franco Fichtner Fri, 27 Sep 2013 21:02:28 +0200 + reported again by Bruce Evans Fri, 17 Feb 2017 21:22:44 +0100 via bapt@ + loc *** exist *** algo *** size ** imp *** + An easy partial fix would be to just skip the first word if it starts + with a dot, including any following white space, when measuring. + loc * exist * algo * size * imp *** + +- The \& zero-width character counts as output. + That is, when it is alone on a line between two .Pp, + we want three blank lines, not two as in mandoc. + loc ** exist ** algo ** size * imp ** + +- Sequences of multiple man(7) paragraphs (.PP, .IP) interspersed + with .ps and .nf/.fi produce execessive blank lines, see libJudy + and graphics/dcmtk. The parser reorg may help with this. + +- trailing whitespace must be ignored even when followed by a font escape, + see for example + makes + \fBdig \fR + operate in batch mode + in dig(1). + loc ** exist ** algo ** size * imp ** + +************************************************************************ +* warning issues +************************************************************************ + +- warn about duplicate .Sh/.Ss heads + gre(4): Rename duplicate sections 20 Apr 2018 15:27:33 +0200 + loc * exist * algo * size * imp ** + +- style message about macros inside .Bd -literal and .Dl, in particular + font changing macros like .Cm, .Ar, .Fa (from the mdoclint TODO) + +- style message about mismatches between the section number in the + file name (if it is known) and the section number in .Dt + (from the mdoclint TODO) + +- style message about NULL without .Dv (from the mdoclint TODO) + +- style message about error constants without .Er (from the mdoclint TODO) + +- warn when .Sh or .Ss contain other macros + Steffen Nurpmeso, savannah.gnu.org/bugs/index.php?45034 + loc * exist * algo * size * imp ** + +- style message about violations of the convention + .An name Aq Mt localpart@domain in AUTHORS (from the mdoclint TODO) + +- warn about attempts to call non-callable macros + Steffen Nurpmeso Tue, 11 Nov 2014 22:55:16 +0100 + Note that formatting is inconsistent in groff. + .Fn Po prints "Po()", .Ar Sh prints "file ..." and no "Sh". + Relatively hard because the relevant code is scattered + all over mdoc_macro.c and all subtly different. + loc ** exist ** algo ** size ** imp ** + +- warn about punctuation - e.g. ',' and ';' - at the beginning + of a text line, if it is likely intended to follow the preceding + output without intervening whitespace, in particular after a + macro line (from the mdoclint TODO) + +- makewhatis -p complains about language subdirectories: + /usr/local/man//ru: Unknown directory part + + +************************************************************************ +* documentation issues +************************************************************************ + +- mark macros as: page structure domain, manual domain, general text domain + is this useful? + +- mention /usr/share/misc/mdoc.template in mdoc(7)? + +- Is all the content from http://www.std.com/obi/BSD/doc/usd/28.tbl/tbl + covered in tbl(7)? + +************************************************************************ +* performance issues +************************************************************************ + +- the PDF file is HUGE: this can be reduced by using relative offsets + +************************************************************************ +* structural issues +************************************************************************ + +- POSIX says in the documentation of sysconf(3) that PATH_MAX + is allowed to be so large that it is a bad idea to use it + for sizing static buffers. So use dynamic buffers throughout. + See the file test-PATH_MAX.c for details. + Found by Aaron M. Ucko in the GNU Hurd via Bdale Garbee, + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829624 + +- Is it possible to further simplify ENDBODY_SPACE? + +- Find better ways to prevent endless loops + in roff(7) macro and string expansion. + +- make buffers for parsing functions const + christos@ via wiz@ Fri, 18 Dec 2015 17:10:01 +0100 + +- struct mparse refactoring + Steffen Nurpmeso Thu, 04 Sep 2014 12:50:00 +0200 + +************************************************************************ +* CGI issues +************************************************************************ + + - Enable HTTP compression by detecting gzip encoding and filtering + output through libz. + - Privilege separation (see OpenSSH). + - Enable caching support via HTTP 304 and If-Modified-Since. + +************************************************************************ +* to improve in the groff_mdoc(7) macros +************************************************************************ + +- .Cd # arch1, arch2 in section 4 pages: + find better way to indicate multiple architectures, maybe: + allow .Dt vgafb 4 "macppc sparc64" + already shown as "Device Drivers Manual (macppc sparc64)" + for apropos, make that "vgafb(4) - macppc # sparc64" instead of "- all" + groff can be made to show multiple arches, too, but it is + tedious to do the string parsing in roff code... + jmc@ 23 Apr 2018 07:24:52 +0100 [man for vgafb(4)...] + loc ** exist ** algo * size * imp *** + +- use uname(1) to set doc-default-operating-system at install time + tobimensch Mon, 1 Dec 2014 00:25:07 +0100 + +- apostrophe (39), circumflex (94), grave (96), tilde (126) + in manuals: \(aq, \(ha, \`, \(ti + Re: [Groff] ASCII Minus Sign in man Pages. + bentley@ 26 Apr 2017 10:02:06 -0600 + Do we need to fix existing manuals? + Do we need to fix the definition of the mdoc(7) language? Copied: vendor/mandoc/20190723/arch.c (from r350349, vendor/mandoc/dist/arch.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mandoc/20190723/arch.c Fri Jul 26 09:53:21 2019 (r350350, copy of r350349, vendor/mandoc/dist/arch.c) @@ -0,0 +1,54 @@ +/* $Id: arch.c,v 1.15 2019/05/21 07:52:00 schwarze Exp $ */ +/* + * Copyright (c) 2017, 2019 Ingo Schwarze + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +#include "config.h" + +#include + +#include "roff.h" + +int +arch_valid(const char *arch, enum mandoc_os os) +{ + const char *openbsd_arch[] = { + "alpha", "amd64", "arm64", "armv7", "hppa", "i386", + "landisk", "loongson", "luna88k", "macppc", "mips64", + "octeon", "sgi", "sparc64", NULL + }; + const char *netbsd_arch[] = { + "acorn26", "acorn32", "algor", "alpha", "amiga", + "arc", "atari", + "bebox", "cats", "cesfic", "cobalt", "dreamcast", + "emips", "evbarm", "evbmips", "evbppc", "evbsh3", "evbsh5", + "hp300", "hpcarm", "hpcmips", "hpcsh", "hppa", + "i386", "ibmnws", "luna68k", + "mac68k", "macppc", "mipsco", "mmeye", "mvme68k", "mvmeppc", + "netwinder", "news68k", "newsmips", "next68k", + "pc532", "playstation2", "pmax", "pmppc", "prep", + "sandpoint", "sbmips", "sgimips", "shark", + "sparc", "sparc64", "sun2", "sun3", + "vax", "walnut", "x68k", "x86", "x86_64", "xen", NULL + }; + const char **arches[] = { NULL, netbsd_arch, openbsd_arch }; + const char **arch_p; + + if ((arch_p = arches[os]) == NULL) + return 1; + for (; *arch_p != NULL; arch_p++) + if (strcmp(*arch_p, arch) == 0) + return 1; + return 0; +} Copied: vendor/mandoc/20190723/cgi.c (from r350349, vendor/mandoc/dist/cgi.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mandoc/20190723/cgi.c Fri Jul 26 09:53:21 2019 (r350350, copy of r350349, vendor/mandoc/dist/cgi.c) @@ -0,0 +1,1253 @@ +/* $Id: cgi.c,v 1.167 2019/07/10 12:49:20 schwarze Exp $ */ +/* + * Copyright (c) 2011, 2012 Kristaps Dzonsons + * Copyright (c) 2014, 2015, 2016, 2017, 2018 Ingo Schwarze + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +#include "config.h" + +#include +#include + +#include +#if HAVE_ERR +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mandoc_aux.h" +#include "mandoc.h" +#include "roff.h" +#include "mdoc.h" +#include "man.h" +#include "mandoc_parse.h" +#include "main.h" +#include "manconf.h" +#include "mansearch.h" +#include "cgi.h" + +/* + * A query as passed to the search function. + */ +struct query { + char *manpath; /* desired manual directory */ + char *arch; /* architecture */ + char *sec; /* manual section */ + char *query; /* unparsed query expression */ + int equal; /* match whole names, not substrings */ +}; + +struct req { + struct query q; + char **p; /* array of available manpaths */ + size_t psz; /* number of available manpaths */ + int isquery; /* QUERY_STRING used, not PATH_INFO */ +}; + +enum focus { + FOCUS_NONE = 0, + FOCUS_QUERY +}; + +static void html_print(const char *); +static void html_putchar(char); +static int http_decode(char *); +static void http_encode(const char *p); +static void parse_manpath_conf(struct req *); +static void parse_path_info(struct req *req, const char *path); +static void parse_query_string(struct req *, const char *); +static void pg_error_badrequest(const char *); +static void pg_error_internal(void); +static void pg_index(const struct req *); +static void pg_noresult(const struct req *, const char *); +static void pg_redirect(const struct req *, const char *); +static void pg_search(const struct req *); +static void pg_searchres(const struct req *, + struct manpage *, size_t); +static void pg_show(struct req *, const char *); +static void resp_begin_html(int, const char *, const char *); +static void resp_begin_http(int, const char *); +static void resp_catman(const struct req *, const char *); +static void resp_copy(const char *); +static void resp_end_html(void); +static void resp_format(const struct req *, const char *); +static void resp_searchform(const struct req *, enum focus); +static void resp_show(const struct req *, const char *); +static void set_query_attr(char **, char **); +static int validate_arch(const char *); +static int validate_filename(const char *); +static int validate_manpath(const struct req *, const char *); +static int validate_urifrag(const char *); + +static const char *scriptname = SCRIPT_NAME; + +static const int sec_prios[] = {1, 4, 5, 8, 6, 3, 7, 2, 9}; +static const char *const sec_numbers[] = { + "0", "1", "2", "3", "3p", "4", "5", "6", "7", "8", "9" +}; +static const char *const sec_names[] = { + "All Sections", + "1 - General Commands", + "2 - System Calls", + "3 - Library Functions", + "3p - Perl Library", + "4 - Device Drivers", + "5 - File Formats", + "6 - Games", + "7 - Miscellaneous Information", + "8 - System Manager\'s Manual", + "9 - Kernel Developer\'s Manual" +}; +static const int sec_MAX = sizeof(sec_names) / sizeof(char *); + +static const char *const arch_names[] = { + "amd64", "alpha", "armv7", "arm64", + "hppa", "i386", "landisk", + "loongson", "luna88k", "macppc", "mips64", + "octeon", "sgi", "socppc", "sparc64", + "amiga", "arc", "armish", "arm32", + "atari", "aviion", "beagle", "cats", + "hppa64", "hp300", + "ia64", "mac68k", "mvme68k", "mvme88k", + "mvmeppc", "palm", "pc532", "pegasos", + "pmax", "powerpc", "solbourne", "sparc", + "sun3", "vax", "wgrisc", "x68k", + "zaurus" +}; +static const int arch_MAX = sizeof(arch_names) / sizeof(char *); + +/* + * Print a character, escaping HTML along the way. + * This will pass non-ASCII straight to output: be warned! + */ +static void +html_putchar(char c) +{ + + switch (c) { + case '"': + printf("""); + break; + case '&': + printf("&"); + break; + case '>': + printf(">"); + break; + case '<': + printf("<"); + break; + default: + putchar((unsigned char)c); + break; + } +} + +/* + * Call through to html_putchar(). + * Accepts NULL strings. + */ +static void +html_print(const char *p) +{ + + if (NULL == p) + return; + while ('\0' != *p) + html_putchar(*p++); +} + +/* + * Transfer the responsibility for the allocated string *val + * to the query structure. + */ +static void +set_query_attr(char **attr, char **val) +{ + + free(*attr); + if (**val == '\0') { + *attr = NULL; + free(*val); + } else + *attr = *val; + *val = NULL; +} + +/* + * Parse the QUERY_STRING for key-value pairs + * and store the values into the query structure. + */ +static void +parse_query_string(struct req *req, const char *qs) +{ + char *key, *val; + size_t keysz, valsz; + + req->isquery = 1; + req->q.manpath = NULL; + req->q.arch = NULL; + req->q.sec = NULL; + req->q.query = NULL; + req->q.equal = 1; + + key = val = NULL; + while (*qs != '\0') { + + /* Parse one key. */ + + keysz = strcspn(qs, "=;&"); + key = mandoc_strndup(qs, keysz); + qs += keysz; + if (*qs != '=') + goto next; + + /* Parse one value. */ + + valsz = strcspn(++qs, ";&"); + val = mandoc_strndup(qs, valsz); + qs += valsz; + + /* Decode and catch encoding errors. */ + + if ( ! (http_decode(key) && http_decode(val))) + goto next; + + /* Handle key-value pairs. */ + + if ( ! strcmp(key, "query")) + set_query_attr(&req->q.query, &val); + + else if ( ! strcmp(key, "apropos")) + req->q.equal = !strcmp(val, "0"); + + else if ( ! strcmp(key, "manpath")) { +#ifdef COMPAT_OLDURI + if ( ! strncmp(val, "OpenBSD ", 8)) { + val[7] = '-'; + if ('C' == val[8]) + val[8] = 'c'; + } +#endif + set_query_attr(&req->q.manpath, &val); + } + + else if ( ! (strcmp(key, "sec") +#ifdef COMPAT_OLDURI + && strcmp(key, "sektion") +#endif + )) { + if ( ! strcmp(val, "0")) + *val = '\0'; + set_query_attr(&req->q.sec, &val); + } + + else if ( ! strcmp(key, "arch")) { + if ( ! strcmp(val, "default")) + *val = '\0'; + set_query_attr(&req->q.arch, &val); + } + + /* + * The key must be freed in any case. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 26 10:00: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 DD322BB8E8; Fri, 26 Jul 2019 10:00:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 C511388874; Fri, 26 Jul 2019 10:00:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6953D6C3; Fri, 26 Jul 2019 10:00:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6QA0auf070649; Fri, 26 Jul 2019 10:00:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QA0YSN070635; Fri, 26 Jul 2019 10:00:34 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201907261000.x6QA0YSN070635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 26 Jul 2019 10:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350351 - head/contrib/mandoc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/contrib/mandoc X-SVN-Commit-Revision: 350351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C511388874 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.941,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, 26 Jul 2019 10:00:36 -0000 Author: bapt Date: Fri Jul 26 10:00:33 2019 New Revision: 350351 URL: https://svnweb.freebsd.org/changeset/base/350351 Log: Update mandoc to cvs snapshot 2019-07-23 This snapshot among other things includes a fix for a crash of mandoc with empty tbl reported by rea@ (his regression test has been incorporated upstream) MFC after: 3 weeks Deleted: head/contrib/mandoc/libroff.h Modified: head/contrib/mandoc/Makefile.depend head/contrib/mandoc/TODO head/contrib/mandoc/arch.c head/contrib/mandoc/cgi.c head/contrib/mandoc/configure head/contrib/mandoc/dbm.c head/contrib/mandoc/dbm_map.h head/contrib/mandoc/eqn.7 head/contrib/mandoc/eqn_html.c head/contrib/mandoc/html.c head/contrib/mandoc/html.h head/contrib/mandoc/lib.in head/contrib/mandoc/main.c head/contrib/mandoc/man.7 head/contrib/mandoc/man_html.c head/contrib/mandoc/man_term.c head/contrib/mandoc/man_validate.c head/contrib/mandoc/mandoc.1 head/contrib/mandoc/mandoc.c head/contrib/mandoc/mandoc.css head/contrib/mandoc/mandoc.h head/contrib/mandoc/mandoc_char.7 head/contrib/mandoc/mandoc_headers.3 head/contrib/mandoc/mandoc_msg.c head/contrib/mandoc/mandocdb.c head/contrib/mandoc/manpath.c head/contrib/mandoc/mansearch.c head/contrib/mandoc/mansearch.h head/contrib/mandoc/mdoc.7 head/contrib/mandoc/mdoc_argv.c head/contrib/mandoc/mdoc_markdown.c head/contrib/mandoc/mdoc_term.c head/contrib/mandoc/mdoc_validate.c head/contrib/mandoc/out.c head/contrib/mandoc/read.c head/contrib/mandoc/roff.7 head/contrib/mandoc/roff.c head/contrib/mandoc/roff_html.c head/contrib/mandoc/tag.c head/contrib/mandoc/tbl_html.c head/contrib/mandoc/tbl_term.c head/contrib/mandoc/term.c Directory Properties: head/contrib/mandoc/ (props changed) Modified: head/contrib/mandoc/Makefile.depend ============================================================================== --- head/contrib/mandoc/Makefile.depend Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/Makefile.depend Fri Jul 26 10:00:33 2019 (r350351) @@ -29,7 +29,7 @@ dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h demandoc.o: demandoc.c config.h mandoc.h roff.h man.h mdoc.h mandoc_parse.h eqn.o: eqn.c config.h mandoc_aux.h mandoc.h roff.h eqn.h libmandoc.h eqn_parse.h -eqn_html.o: eqn_html.c config.h mandoc.h eqn.h out.h html.h +eqn_html.o: eqn_html.c config.h mandoc.h roff.h eqn.h out.h html.h eqn_term.o: eqn_term.c config.h eqn.h out.h term.h html.o: html.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h out.h html.h manconf.h main.h lib.o: lib.c config.h roff.h libmdoc.h lib.in @@ -37,16 +37,16 @@ main.o: main.c config.h mandoc_aux.h mandoc.h mandoc_x man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h man_html.o: man_html.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h html.h main.h man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h -man_term.o: man_term.c config.h mandoc_aux.h roff.h man.h out.h term.h main.h +man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h tag.h main.h man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h mandoc.o: mandoc.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h roff_int.h mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h -mandoc_msg.o: mandoc_msg.c mandoc.h +mandoc_msg.o: mandoc_msg.c config.h mandoc.h mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.o: mandoc_xr.c mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.h mandocd.o: mandocd.c config.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h main.h manconf.h mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h mandoc_parse.h manconf.h mansearch.h dba_array.h dba.h -manpath.o: manpath.c config.h mandoc_aux.h manconf.h +manpath.o: manpath.c config.h mandoc_aux.h mandoc.h manconf.h mansearch.o: mansearch.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h @@ -67,10 +67,10 @@ roff_term.o: roff_term.c mandoc.h roff.h out.h term.h roff_validate.o: roff_validate.c mandoc.h roff.h libmandoc.h roff_int.h soelim.o: soelim.c config.h compat_stringlist.h st.o: st.c config.h mandoc.h roff.h libmdoc.h -tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h tag.h +tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h tag.h tbl.o: tbl.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_parse.h tbl_int.h tbl_data.o: tbl_data.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h -tbl_html.o: tbl_html.c config.h mandoc.h tbl.h out.h html.h +tbl_html.o: tbl_html.c config.h mandoc.h roff.h tbl.h out.h html.h tbl_layout.o: tbl_layout.c config.h mandoc_aux.h mandoc.h tbl.h libmandoc.h tbl_int.h tbl_opts.o: tbl_opts.c config.h mandoc.h tbl.h libmandoc.h tbl_int.h tbl_term.o: tbl_term.c config.h mandoc.h tbl.h out.h term.h Modified: head/contrib/mandoc/TODO ============================================================================== --- head/contrib/mandoc/TODO Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/TODO Fri Jul 26 10:00:33 2019 (r350351) @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.289 2019/03/04 13:01:57 schwarze Exp $ +* $Id: TODO,v 1.295 2019/06/11 16:04:36 schwarze Exp $ ************************************************************************ Many issues are annotated for difficulty as follows: @@ -62,6 +62,27 @@ are mere guesses, and some may be wrong. needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 loc ** exist *** algo *** size * imp *** +- .als only works for macros in mandoc, not for user-defined strings. + Also, the "val" field in struct roffkv would have to be replaced + with a pointer to a reference-counted wrapper, and an alias + would have to point to the same wrapper as the original. + .als to undefined does nothing; the alias is not created. + .rm'ing the original leaves the alias to point to the old value. + .de .als .de changes both, but + .de .als .rm .de only changes the new value, not the alias. + Found in groffer(1) version 1.19 + Jan Stary 20 Apr 2019 20:16:54 +0200 + loc * exist ** algo ** size ** imp * + +- roff string condition comparisons fail when vars contain quotes: + .ds s ' + .if '\*s'' \&... + hard to fix because of the basic architecture (string replacement + happens before roff(7) syntax parsing) + Found in groffer(1) version 1.19 + Jan Stary 20 Apr 2019 20:16:54 +0200 + loc * exist *** algo *** size ** imp * + --- missing mdoc features ---------------------------------------------- - .Bl -column .Xo support is missing @@ -263,6 +284,9 @@ are mere guesses, and some may be wrong. http://ikiwiki.info/plugins/contrib/mandoc/ https://github.com/schmonz/ikiwiki/compare/mandoc Amitai Schlair Mon, 19 May 2014 14:05:53 -0400 + +- check compatibility with + https://git.sr.ht/~sircmpwn/scdoc - check features of the Slackware man.conf(5) format Carsten Kunze Wed, 11 Mar 2015 17:57:24 +0100 Modified: head/contrib/mandoc/arch.c ============================================================================== --- head/contrib/mandoc/arch.c Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/arch.c Fri Jul 26 10:00:33 2019 (r350351) @@ -1,4 +1,4 @@ -/* $Id: arch.c,v 1.14 2019/03/04 13:01:57 schwarze Exp $ */ +/* $Id: arch.c,v 1.15 2019/05/21 07:52:00 schwarze Exp $ */ /* * Copyright (c) 2017, 2019 Ingo Schwarze * @@ -26,7 +26,7 @@ arch_valid(const char *arch, enum mandoc_os os) const char *openbsd_arch[] = { "alpha", "amd64", "arm64", "armv7", "hppa", "i386", "landisk", "loongson", "luna88k", "macppc", "mips64", - "octeon", "sgi", "socppc", "sparc64", NULL + "octeon", "sgi", "sparc64", NULL }; const char *netbsd_arch[] = { "acorn26", "acorn32", "algor", "alpha", "amiga", Modified: head/contrib/mandoc/cgi.c ============================================================================== --- head/contrib/mandoc/cgi.c Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/cgi.c Fri Jul 26 10:00:33 2019 (r350351) @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.166 2019/03/06 12:32:41 schwarze Exp $ */ +/* $Id: cgi.c,v 1.167 2019/07/10 12:49:20 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017, 2018 Ingo Schwarze @@ -869,7 +869,6 @@ resp_format(const struct req *req, const char *file) memset(&conf, 0, sizeof(conf)); conf.fragment = 1; conf.style = mandoc_strdup(CSS_DIR "/mandoc.css"); - conf.toc = 1; usepath = strcmp(req->q.manpath, req->p[0]); mandoc_asprintf(&conf.man, "/%s%s%s%s%%N.%%S", scriptname, *scriptname == '\0' ? "" : "/", Modified: head/contrib/mandoc/configure ============================================================================== --- head/contrib/mandoc/configure Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/configure Fri Jul 26 10:00:33 2019 (r350351) @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: configure,v 1.70 2019/03/06 16:04:31 schwarze Exp $ +# $Id: configure,v 1.71 2019/07/01 22:56:24 schwarze Exp $ # # Copyright (c) 2014-2019 Ingo Schwarze # @@ -529,7 +529,7 @@ fi echo "extern char *mkdtemp(char *);" if [ ${HAVE_PROGNAME} -eq 0 ]; then - echo "extern const char *getprogname(void);" + echo "extern const char *getprogname(void);" echo "extern void setprogname(const char *);" fi Modified: head/contrib/mandoc/dbm.c ============================================================================== --- head/contrib/mandoc/dbm.c Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/dbm.c Fri Jul 26 10:00:33 2019 (r350351) @@ -1,4 +1,4 @@ -/* $Id: dbm.c,v 1.6 2018/11/19 19:22:07 schwarze Exp $ */ +/* $Id: dbm.c,v 1.7 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * @@ -233,7 +233,7 @@ static struct dbm_res page_bytitle(enum iter arg_iter, const struct dbm_match *arg_match) { static const struct dbm_match *match; - static const char *cp; + static const char *cp; static int32_t ip; struct dbm_res res = {-1, 0}; @@ -315,7 +315,7 @@ page_byarch(const struct dbm_match *arg_match) static const struct dbm_match *match; struct dbm_res res = {-1, 0}; static int32_t ip; - const char *cp; + const char *cp; /* Initialize for a new iteration. */ Modified: head/contrib/mandoc/dbm_map.h ============================================================================== --- head/contrib/mandoc/dbm_map.h Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/dbm_map.h Fri Jul 26 10:00:33 2019 (r350351) @@ -1,4 +1,4 @@ -/* $Id: dbm_map.h,v 1.1 2016/07/19 21:31:55 schwarze Exp $ */ +/* $Id: dbm_map.h,v 1.2 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * Private interface for low-level routines for the map-based version + * Private interface for low-level routines for the map-based version * of the mandoc database, for read-only access. * To be used by dbm*.c only. */ Modified: head/contrib/mandoc/eqn.7 ============================================================================== --- head/contrib/mandoc/eqn.7 Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/eqn.7 Fri Jul 26 10:00:33 2019 (r350351) @@ -1,4 +1,4 @@ -.\" $Id: eqn.7,v 1.37 2017/09/04 10:35:27 schwarze Exp $ +.\" $Id: eqn.7,v 1.38 2019/04/23 17:57:49 schwarze Exp $ .\" .\" Copyright (c) 2011 Kristaps Dzonsons .\" Copyright (c) 2014 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: September 4 2017 $ +.Dd $Mdocdate: April 23 2019 $ .Dt EQN 7 .Os .Sh NAME @@ -470,7 +470,7 @@ commands are also ignored. .%T System for Typesetting Mathematics .%J Communications of the ACM .%V 18 -.%P 151\(en157 +.%P pp. 151\(en157 .%D March, 1975 .Re .Rs Modified: head/contrib/mandoc/eqn_html.c ============================================================================== --- head/contrib/mandoc/eqn_html.c Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/eqn_html.c Fri Jul 26 10:00:33 2019 (r350351) @@ -1,4 +1,4 @@ -/* $Id: eqn_html.c,v 1.18 2018/12/13 05:23:38 schwarze Exp $ */ +/* $Id: eqn_html.c,v 1.19 2019/03/17 18:21:45 schwarze Exp $ */ /* * Copyright (c) 2011, 2014 Kristaps Dzonsons * Copyright (c) 2017 Ingo Schwarze @@ -26,6 +26,7 @@ #include #include "mandoc.h" +#include "roff.h" #include "eqn.h" #include "out.h" #include "html.h" Modified: head/contrib/mandoc/html.c ============================================================================== --- head/contrib/mandoc/html.c Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/html.c Fri Jul 26 10:00:33 2019 (r350351) @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.254 2019/03/03 13:02:11 schwarze Exp $ */ +/* $Id: html.c,v 1.255 2019/04/30 15:53:00 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017-2019 Ingo Schwarze @@ -120,6 +120,7 @@ static void print_ctag(struct html *, struct tag *); static int print_escape(struct html *, char); static int print_encode(struct html *, const char *, const char *, int); static void print_href(struct html *, const char *, const char *, int); +static void print_metaf(struct html *); void * @@ -222,55 +223,49 @@ print_gen_head(struct html *h) print_tagq(h, t); } -void -print_metaf(struct html *h, enum mandoc_esc deco) +int +html_setfont(struct html *h, enum mandoc_esc font) { - enum htmlfont font; - - switch (deco) { + switch (font) { case ESCAPE_FONTPREV: font = h->metal; break; case ESCAPE_FONTITALIC: - font = HTMLFONT_ITALIC; - break; case ESCAPE_FONTBOLD: - font = HTMLFONT_BOLD; - break; case ESCAPE_FONTBI: - font = HTMLFONT_BI; - break; case ESCAPE_FONTCW: - font = HTMLFONT_CW; + case ESCAPE_FONTROMAN: break; case ESCAPE_FONT: - case ESCAPE_FONTROMAN: - font = HTMLFONT_NONE; + font = ESCAPE_FONTROMAN; break; default: - return; + return 0; } + h->metal = h->metac; + h->metac = font; + return 1; +} +static void +print_metaf(struct html *h) +{ if (h->metaf) { print_tagq(h, h->metaf); h->metaf = NULL; } - - h->metal = h->metac; - h->metac = font; - - switch (font) { - case HTMLFONT_ITALIC: + switch (h->metac) { + case ESCAPE_FONTITALIC: h->metaf = print_otag(h, TAG_I, ""); break; - case HTMLFONT_BOLD: + case ESCAPE_FONTBOLD: h->metaf = print_otag(h, TAG_B, ""); break; - case HTMLFONT_BI: + case ESCAPE_FONTBI: h->metaf = print_otag(h, TAG_B, ""); print_otag(h, TAG_I, ""); break; - case HTMLFONT_CW: + case ESCAPE_FONTCW: h->metaf = print_otag(h, TAG_SPAN, "c", "Li"); break; default: @@ -479,7 +474,8 @@ print_encode(struct html *h, const char *p, const char case ESCAPE_FONTROMAN: if (0 == norecurse) { h->flags |= HTML_NOSPACE; - print_metaf(h, esc); + if (html_setfont(h, esc)) + print_metaf(h); h->flags &= ~HTML_NOSPACE; } continue; @@ -806,27 +802,9 @@ print_text(struct html *h, const char *word) print_word(h, " "); } - assert(NULL == h->metaf); - switch (h->metac) { - case HTMLFONT_ITALIC: - h->metaf = print_otag(h, TAG_I, ""); - break; - case HTMLFONT_BOLD: - h->metaf = print_otag(h, TAG_B, ""); - break; - case HTMLFONT_BI: - h->metaf = print_otag(h, TAG_B, ""); - print_otag(h, TAG_I, ""); - break; - case HTMLFONT_CW: - h->metaf = print_otag(h, TAG_SPAN, "c", "Li"); - break; - default: - print_indent(h); - break; - } - - assert(word); + assert(h->metaf == NULL); + print_metaf(h); + print_indent(h); if ( ! print_encode(h, word, NULL, 0)) { if ( ! (h->flags & HTML_NONOSPACE)) h->flags &= ~HTML_NOSPACE; @@ -834,7 +812,7 @@ print_text(struct html *h, const char *word) } else h->flags |= HTML_NOSPACE | HTML_NONEWLINE; - if (h->metaf) { + if (h->metaf != NULL) { print_tagq(h, h->metaf); h->metaf = NULL; } Modified: head/contrib/mandoc/html.h ============================================================================== --- head/contrib/mandoc/html.h Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/html.h Fri Jul 26 10:00:33 2019 (r350351) @@ -1,4 +1,4 @@ -/* $Id: html.h,v 1.102 2019/03/01 10:57:18 schwarze Exp $ */ +/* $Id: html.h,v 1.103 2019/04/30 15:53:00 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2017, 2018, 2019 Ingo Schwarze @@ -69,15 +69,6 @@ enum htmltag { TAG_MAX }; -enum htmlfont { - HTMLFONT_NONE = 0, - HTMLFONT_BOLD, - HTMLFONT_ITALIC, - HTMLFONT_BI, - HTMLFONT_CW, - HTMLFONT_MAX -}; - struct tag { struct tag *next; int refcnt; @@ -111,8 +102,8 @@ struct html { char *base_includes; /* base for include href */ char *style; /* style-sheet URI */ struct tag *metaf; /* current open font scope */ - enum htmlfont metal; /* last used font */ - enum htmlfont metac; /* current font mode */ + enum mandoc_esc metal; /* last used font */ + enum mandoc_esc metac; /* current font mode */ int oflags; /* output options */ #define HTML_FRAGMENT (1 << 0) /* don't emit HTML/HEAD/BODY */ #define HTML_TOC (1 << 1) /* emit a table of contents */ @@ -128,7 +119,6 @@ void roff_html_pre(struct html *, const struct roff void print_gen_comment(struct html *, struct roff_node *); void print_gen_decls(struct html *); void print_gen_head(struct html *); -void print_metaf(struct html *, enum mandoc_esc); struct tag *print_otag(struct html *, enum htmltag, const char *, ...); void print_tagq(struct html *, const struct tag *); void print_stagq(struct html *, const struct tag *); @@ -141,3 +131,4 @@ void print_endline(struct html *); void html_close_paragraph(struct html *); enum roff_tok html_fillmode(struct html *, enum roff_tok); char *html_make_id(const struct roff_node *, int); +int html_setfont(struct html *, enum mandoc_esc); Modified: head/contrib/mandoc/lib.in ============================================================================== --- head/contrib/mandoc/lib.in Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/lib.in Fri Jul 26 10:00:33 2019 (r350351) @@ -1,4 +1,4 @@ -/* $Id: lib.in,v 1.21 2019/03/04 17:35:21 schwarze Exp $ */ +/* $Id: lib.in,v 1.22 2019/07/01 22:56:24 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * Copyright (c) 2009, 2012 Joerg Sonnenberger @@ -43,7 +43,7 @@ LINE("libcipher", "FreeSec Crypt Library (libcipher, \ LINE("libcompat", "Compatibility Library (libcompat, \\-lcompat)") LINE("libcrypt", "Crypt Library (libcrypt, \\-lcrypt)") LINE("libcurses", "Curses Library (libcurses, \\-lcurses)") -LINE("libcuse", "Userland Character Device Library (libcuse, \\-lcuse)") +LINE("libcuse", "Userland Character Device Library (libcuse, \\-lcuse)") LINE("libdevattr", "Device attribute and event library (libdevattr, \\-ldevattr)") LINE("libdevctl", "Device Control Library (libdevctl, \\-ldevctl)") LINE("libdevinfo", "Device and Resource Information Utility Library (libdevinfo, \\-ldevinfo)") Modified: head/contrib/mandoc/main.c ============================================================================== --- head/contrib/mandoc/main.c Fri Jul 26 09:53:21 2019 (r350350) +++ head/contrib/mandoc/main.c Fri Jul 26 10:00:33 2019 (r350351) @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.322 2019/03/06 10:18:58 schwarze Exp $ */ +/* $Id: main.c,v 1.332 2019/07/19 20:27:25 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014-2019 Ingo Schwarze @@ -21,6 +21,7 @@ #include #include #include /* MACHINE */ +#include #include #include @@ -97,13 +98,10 @@ static int fs_lookup(const struct manpaths *, static int fs_search(const struct mansearch *, const struct manpaths *, int, char**, struct manpage **, size_t *); -static int koptions(int *, char *); -static void moptions(int *, char *); static void outdata_alloc(struct curparse *); static void parse(struct curparse *, int, const char *); -static void passthrough(const char *, int, int); +static void passthrough(int, int); static pid_t spawn_pager(struct tag_files *); -static int toptions(struct curparse *, char *); static void usage(enum argmode) __attribute__((__noreturn__)); static int woptions(struct curparse *, char *); @@ -125,7 +123,7 @@ main(int argc, char *argv[]) char *conf_file, *defpaths, *auxpaths; char *oarg, *tagarg; unsigned char *uc; - size_t i, sz; + size_t i, sz, ssz; int prio, best_prio; enum outmode outmode; int fd, startdir; @@ -154,10 +152,11 @@ main(int argc, char *argv[]) return mandocdb(argc, argv); #if HAVE_PLEDGE - if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) - err((int)MANDOCLEVEL_SYSERR, "pledge"); + if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) { + mandoc_msg(MANDOCERR_PLEDGE, 0, 0, "%s", strerror(errno)); + return mandoc_msg_getrc(); + } #endif - #if HAVE_SANDBOX_INIT if (sandbox_init(kSBXProfileNoInternet, SANDBOX_NAMED, NULL) == -1) errx((int)MANDOCLEVEL_SYSERR, "sandbox_init"); @@ -221,19 +220,29 @@ main(int argc, char *argv[]) outmode = OUTMODE_ALL; break; case 'I': - if (strncmp(optarg, "os=", 3)) { - warnx("-I %s: Bad argument", optarg); - return (int)MANDOCLEVEL_BADARG; + if (strncmp(optarg, "os=", 3) != 0) { + mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, + "-I %s", optarg); + return mandoc_msg_getrc(); } if (curp.os_s != NULL) { - warnx("-I %s: Duplicate argument", optarg); - return (int)MANDOCLEVEL_BADARG; + mandoc_msg(MANDOCERR_BADARG_DUPE, 0, 0, + "-I %s", optarg); + return mandoc_msg_getrc(); } curp.os_s = mandoc_strdup(optarg + 3); break; case 'K': - if ( ! koptions(&options, optarg)) - return (int)MANDOCLEVEL_BADARG; + options &= ~(MPARSE_UTF8 | MPARSE_LATIN1); + if (strcmp(optarg, "utf-8") == 0) + options |= MPARSE_UTF8; + else if (strcmp(optarg, "iso-8859-1") == 0) + options |= MPARSE_LATIN1; + else if (strcmp(optarg, "us-ascii") != 0) { + mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, + "-K %s", optarg); + return mandoc_msg_getrc(); + } break; case 'k': search.argmode = ARG_EXPR; @@ -264,12 +273,37 @@ main(int argc, char *argv[]) search.sec = optarg; break; case 'T': - if ( ! toptions(&curp, optarg)) - return (int)MANDOCLEVEL_BADARG; + if (strcmp(optarg, "ascii") == 0) + curp.outtype = OUTT_ASCII; + else if (strcmp(optarg, "lint") == 0) { + curp.outtype = OUTT_LINT; + mandoc_msg_setoutfile(stdout); + mandoc_msg_setmin(MANDOCERR_BASE); + } else if (strcmp(optarg, "tree") == 0) + curp.outtype = OUTT_TREE; + else if (strcmp(optarg, "man") == 0) + curp.outtype = OUTT_MAN; + else if (strcmp(optarg, "html") == 0) + curp.outtype = OUTT_HTML; + else if (strcmp(optarg, "markdown") == 0) + curp.outtype = OUTT_MARKDOWN; + else if (strcmp(optarg, "utf8") == 0) + curp.outtype = OUTT_UTF8; + else if (strcmp(optarg, "locale") == 0) + curp.outtype = OUTT_LOCALE; + else if (strcmp(optarg, "ps") == 0) + curp.outtype = OUTT_PS; + else if (strcmp(optarg, "pdf") == 0) + curp.outtype = OUTT_PDF; + else { + mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, + "-T %s", optarg); + return mandoc_msg_getrc(); + } break; case 'W': - if ( ! woptions(&curp, optarg)) - return (int)MANDOCLEVEL_BADARG; + if (woptions(&curp, optarg) == -1) + return mandoc_msg_getrc(); break; case 'w': outmode = OUTMODE_FLN; @@ -305,12 +339,9 @@ main(int argc, char *argv[]) search.outkey = oarg; else { while (oarg != NULL) { - thisarg = oarg; if (manconf_output(&conf.output, - strsep(&oarg, ","), 0) == 0) - continue; - warnx("-O %s: Bad argument", thisarg); - return (int)MANDOCLEVEL_BADARG; + strsep(&oarg, ","), 0) == -1) + return mandoc_msg_getrc(); } } } @@ -334,9 +365,13 @@ main(int argc, char *argv[]) } #if HAVE_PLEDGE - if (!use_pager) - if (pledge("stdio rpath", NULL) == -1) - err((int)MANDOCLEVEL_SYSERR, "pledge"); + if (use_pager == 0) { + if (pledge("stdio rpath", NULL) == -1) { + mandoc_msg(MANDOCERR_PLEDGE, 0, 0, + "%s", strerror(errno)); + return mandoc_msg_getrc(); + } + } #endif /* Parse arguments. */ @@ -361,7 +396,7 @@ main(int argc, char *argv[]) } else if (argc > 1 && ((uc = (unsigned char *)argv[0]) != NULL) && ((isdigit(uc[0]) && (uc[1] == '\0' || - (isalpha(uc[1]) && uc[2] == '\0'))) || + isalpha(uc[1]))) || (uc[0] == 'n' && uc[1] == '\0'))) { search.sec = (char *)uc; argv++; @@ -426,7 +461,7 @@ main(int argc, char *argv[]) usage(search.argmode); if (sz == 0 && search.argmode == ARG_NAME) - fs_search(&search, &conf.manpath, + (void)fs_search(&search, &conf.manpath, argc, argv, &res, &sz); if (search.argmode == ARG_NAME) { @@ -434,7 +469,10 @@ main(int argc, char *argv[]) if (strchr(argv[c], '/') == NULL) continue; if (access(argv[c], R_OK) == -1) { - warn("%s", argv[c]); + mandoc_msg_setinfilename(argv[c]); + mandoc_msg(MANDOCERR_BADARG_BAD, + 0, 0, "%s", strerror(errno)); + mandoc_msg_setinfilename(NULL); continue; } res = mandoc_reallocarray(res, @@ -442,6 +480,7 @@ main(int argc, char *argv[]) res[sz].file = mandoc_strdup(argv[c]); res[sz].names = NULL; res[sz].output = NULL; + res[sz].bits = 0; res[sz].ipath = SIZE_MAX; res[sz].sec = 10; res[sz].form = FORM_SRC; @@ -464,7 +503,7 @@ main(int argc, char *argv[]) if (outmode == OUTMODE_ONE) { argc = 1; - best_prio = 20; + best_prio = 40; } else if (outmode == OUTMODE_ALL) argc = (int)sz; @@ -483,10 +522,21 @@ main(int argc, char *argv[]) sec = res[i].file; sec += strcspn(sec, "123456789"); if (sec[0] == '\0') - continue; + continue; /* No section at all. */ prio = sec_prios[sec[0] - '1']; - if (sec[1] != '/') - prio += 10; + if (search.sec != NULL) { + ssz = strlen(search.sec); + if (strncmp(sec, search.sec, ssz) == 0) + sec += ssz; + } else + sec++; /* Prefer without suffix. */ + if (*sec != '/') + prio += 10; /* Wrong dir name. */ + if (search.sec != NULL && + (strlen(sec) <= ssz + 3 || + strcmp(sec + strlen(sec) - ssz, + search.sec) != 0)) + prio += 20; /* Wrong file ext. */ if (prio >= best_prio) continue; best_prio = prio; @@ -508,16 +558,26 @@ main(int argc, char *argv[]) #if HAVE_PLEDGE if (use_pager) { - if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) - err((int)MANDOCLEVEL_SYSERR, "pledge"); + if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1) { + mandoc_msg(MANDOCERR_PLEDGE, 0, 0, + "%s", strerror(errno)); + return mandoc_msg_getrc(); + } } else { - if (pledge("stdio rpath", NULL) == -1) - err((int)MANDOCLEVEL_SYSERR, "pledge"); + if (pledge("stdio rpath", NULL) == -1) { + mandoc_msg(MANDOCERR_PLEDGE, 0, 0, + "%s", strerror(errno)); + return mandoc_msg_getrc(); + } } #endif - if (search.argmode == ARG_FILE) - moptions(&options, auxpaths); + if (search.argmode == ARG_FILE && auxpaths != NULL) { + if (strcmp(auxpaths, "doc") == 0) + options |= MPARSE_MDOC; + else if (strcmp(auxpaths, "an") == 0) + options |= MPARSE_MAN; + } mchars_alloc(); curp.mp = mparse_alloc(options, curp.os_e, curp.os_s); @@ -525,7 +585,8 @@ main(int argc, char *argv[]) if (argc < 1) { if (use_pager) { tag_files = tag_init(); - tag_files->tagname = conf.output.tag; + if (tag_files != NULL) + tag_files->tagname = conf.output.tag; } thisarg = ""; mandoc_msg_setinfilename(thisarg); @@ -558,30 +619,31 @@ main(int argc, char *argv[]) } else thisarg = *argv; + mandoc_msg_setinfilename(thisarg); fd = mparse_open(curp.mp, thisarg); if (fd != -1) { if (use_pager) { use_pager = 0; tag_files = tag_init(); - tag_files->tagname = conf.output.tag; + if (tag_files != NULL) + tag_files->tagname = conf.output.tag; } - mandoc_msg_setinfilename(thisarg); if (resp == NULL || resp->form == FORM_SRC) parse(&curp, fd, thisarg); else - passthrough(resp->file, fd, - conf.output.synopsisonly); - mandoc_msg_setinfilename(NULL); + passthrough(fd, conf.output.synopsisonly); if (ferror(stdout)) { if (tag_files != NULL) { - warn("%s", tag_files->ofn); + mandoc_msg(MANDOCERR_WRITE, 0, 0, + "%s: %s", tag_files->ofn, + strerror(errno)); tag_unlink(); tag_files = NULL; } else - warn("stdout"); - mandoc_msg_setrc(MANDOCLEVEL_SYSERR); + mandoc_msg(MANDOCERR_WRITE, 0, 0, + "%s", strerror(errno)); break; } @@ -591,9 +653,11 @@ main(int argc, char *argv[]) terminal_sepline(curp.outdata); } } else - mandoc_msg(MANDOCERR_FILE, 0, 0, - "%s: %s", thisarg, strerror(errno)); + mandoc_msg(resp == NULL ? MANDOCERR_BADARG_BAD : + MANDOCERR_OPEN, 0, 0, "%s", strerror(errno)); + mandoc_msg_setinfilename(NULL); + if (curp.wstop && mandoc_msg_getrc() != MANDOCLEVEL_OK) break; @@ -684,8 +748,8 @@ out: continue; if (pid == -1) { - warn("wait"); - mandoc_msg_setrc(MANDOCLEVEL_SYSERR); + mandoc_msg(MANDOCERR_WAIT, 0, 0, + "%s", strerror(errno)); break; } if (!WIFSTOPPED(status)) @@ -694,14 +758,16 @@ out: signum = WSTOPSIG(status); } tag_unlink(); - } + } else if (curp.outtype != OUTT_LINT && + (search.argmode == ARG_FILE || sz > 0)) + mandoc_msg_summary(); + return (int)mandoc_msg_getrc(); } static void usage(enum argmode argmode) { - switch (argmode) { case ARG_FILE: fputs("usage: mandoc [-ac] [-I os=name] " @@ -732,6 +798,7 @@ fs_lookup(const struct manpaths *paths, size_t ipath, const char *sec, const char *arch, const char *name, struct manpage **res, size_t *ressz) { + struct stat sb; glob_t globinfo; struct manpage *page; char *file; @@ -741,13 +808,13 @@ fs_lookup(const struct manpaths *paths, size_t ipath, form = FORM_SRC; mandoc_asprintf(&file, "%s/man%s/%s.%s", paths->paths[ipath], sec, name, sec); - if (access(file, R_OK) != -1) + if (stat(file, &sb) != -1) goto found; free(file); mandoc_asprintf(&file, "%s/cat%s/%s.0", paths->paths[ipath], sec, name); - if (access(file, R_OK) != -1) { + if (stat(file, &sb) != -1) { form = FORM_CAT; goto found; } @@ -756,7 +823,7 @@ fs_lookup(const struct manpaths *paths, size_t ipath, if (arch != NULL) { mandoc_asprintf(&file, "%s/man%s/%s/%s.%s", paths->paths[ipath], sec, arch, name, sec); - if (access(file, R_OK) != -1) + if (stat(file, &sb) != -1) goto found; free(file); } @@ -765,37 +832,42 @@ fs_lookup(const struct manpaths *paths, size_t ipath, paths->paths[ipath], sec, name); globres = glob(file, 0, NULL, &globinfo); if (globres != 0 && globres != GLOB_NOMATCH) - warn("%s: glob", file); + mandoc_msg(MANDOCERR_GLOB, 0, 0, + "%s: %s", file, strerror(errno)); free(file); if (globres == 0) file = mandoc_strdup(*globinfo.gl_pathv); globfree(&globinfo); - if (globres == 0) - goto found; + if (globres == 0) { + if (stat(file, &sb) != -1) + goto found; + free(file); + } if (res != NULL || ipath + 1 != paths->sz) - return 0; + return -1; mandoc_asprintf(&file, "%s.%s", name, sec); - globres = access(file, R_OK); + globres = stat(file, &sb); free(file); - return globres != -1; + return globres; found: warnx("outdated mandoc.db lacks %s(%s) entry, run %s %s", name, sec, BINM_MAKEWHATIS, paths->paths[ipath]); if (res == NULL) { free(file); - return 1; + return 0; } - *res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage)); + *res = mandoc_reallocarray(*res, ++*ressz, sizeof(**res)); page = *res + (*ressz - 1); page->file = file; page->names = NULL; page->output = NULL; + page->bits = NAME_FILE & NAME_MASK; page->ipath = ipath; page->sec = (*sec >= '1' && *sec <= '9') ? *sec - '1' + 1 : 10; page->form = form; - return 1; + return 0; } static int @@ -817,14 +889,14 @@ fs_search(const struct mansearch *cfg, const struct ma for (ipath = 0; ipath < paths->sz; ipath++) { if (cfg->sec != NULL) { if (fs_lookup(paths, ipath, cfg->sec, - cfg->arch, *argv, res, ressz) && + cfg->arch, *argv, res, ressz) != -1 && cfg->firstmatch) - return 1; + return 0; } else for (isec = 0; isec < nsec; isec++) if (fs_lookup(paths, ipath, sections[isec], - cfg->arch, *argv, res, ressz) && + cfg->arch, *argv, res, ressz) != -1 && cfg->firstmatch) - return 1; + return 0; } if (res != NULL && *ressz == lastsz && strchr(*argv, '/') == NULL) { @@ -843,7 +915,7 @@ fs_search(const struct mansearch *cfg, const struct ma argv++; argc--; } - return 0; + return -1; } static void @@ -950,7 +1022,7 @@ check_xr(void) search.firstmatch = 1; if (mansearch(&search, &paths, 1, &xr->name, NULL, &sz)) continue; - if (fs_search(&search, &paths, 1, &xr->name, NULL, &sz)) + if (fs_search(&search, &paths, 1, &xr->name, NULL, &sz) != -1) continue; if (xr->count == 1) mandoc_msg(MANDOCERR_XR_BAD, xr->line, @@ -990,34 +1062,34 @@ outdata_alloc(struct curparse *curp) } static void -passthrough(const char *file, int fd, int synopsis_only) +passthrough(int fd, int synopsis_only) { const char synb[] = "S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS"; const char synr[] = "SYNOPSIS"; FILE *stream; - const char *syscall; char *line, *cp; size_t linesz; ssize_t len, written; - int print; + int lno, print; + stream = NULL; line = NULL; linesz = 0; if (fflush(stdout) == EOF) { - syscall = "fflush"; - goto fail; + mandoc_msg(MANDOCERR_FFLUSH, 0, 0, "%s", strerror(errno)); + goto done; } - if ((stream = fdopen(fd, "r")) == NULL) { close(fd); - syscall = "fdopen"; - goto fail; + mandoc_msg(MANDOCERR_FDOPEN, 0, 0, "%s", strerror(errno)); + goto done; } - print = 0; + lno = print = 0; while ((len = getline(&line, &linesz, stream)) != -1) { + lno++; cp = line; if (synopsis_only) { if (print) { @@ -1035,97 +1107,23 @@ passthrough(const char *file, int fd, int synopsis_onl } } for (; len > 0; len -= written) { - if ((written = write(STDOUT_FILENO, cp, len)) != -1) - continue; - fclose(stream); - syscall = "write"; - goto fail; + if ((written = write(STDOUT_FILENO, cp, len)) == -1) { + mandoc_msg(MANDOCERR_WRITE, 0, 0, + "%s", strerror(errno)); + goto done; + } } } + if (ferror(stream)) + mandoc_msg(MANDOCERR_GETLINE, lno, 0, "%s", strerror(errno)); - if (ferror(stream)) { - fclose(stream); - syscall = "getline"; - goto fail; - } - done: free(line); - fclose(stream); - return; - -fail: - free(line); - warn("%s: SYSERR: %s", file, syscall); - mandoc_msg_setrc(MANDOCLEVEL_SYSERR); + if (stream != NULL) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jul 26 10:13: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 47A31BBD60; Fri, 26 Jul 2019 10:13: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 1F1988901C; Fri, 26 Jul 2019 10:13: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 AF26EDA45; Fri, 26 Jul 2019 10:13: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 x6QADnTH081966; Fri, 26 Jul 2019 10:13:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QADnMV081963; Fri, 26 Jul 2019 10:13:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907261013.x6QADnMV081963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 26 Jul 2019 10:13: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: r350352 - in stable/12/lib/libc: . amd64/gen i386/gen x86/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/lib/libc: . amd64/gen i386/gen x86/gen X-SVN-Commit-Revision: 350352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F1988901C 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.931,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, 26 Jul 2019 10:13:50 -0000 Author: kib Date: Fri Jul 26 10:13:48 2019 New Revision: 350352 URL: https://svnweb.freebsd.org/changeset/base/350352 Log: MFC r344120: Unify i386 and amd64 getcontextx.c, and use ifuncs while there. This is yet another attempt of the merge, previously done as r344436 and reverted in r344463. It is redone since ld was changed to ifunc-capable linker on i386. Added: stable/12/lib/libc/x86/gen/ - copied from r344120, head/lib/libc/x86/gen/ Deleted: stable/12/lib/libc/amd64/gen/getcontextx.c stable/12/lib/libc/i386/gen/getcontextx.c Modified: stable/12/lib/libc/Makefile stable/12/lib/libc/amd64/gen/Makefile.inc stable/12/lib/libc/i386/gen/Makefile.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/Makefile ============================================================================== --- stable/12/lib/libc/Makefile Fri Jul 26 10:00:33 2019 (r350351) +++ stable/12/lib/libc/Makefile Fri Jul 26 10:13:48 2019 (r350352) @@ -120,6 +120,7 @@ NOASM= .endif .if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64" .include "${LIBC_SRCTOP}/x86/sys/Makefile.inc" +.include "${LIBC_SRCTOP}/x86/gen/Makefile.inc" .endif .if ${MK_NIS} != "no" CFLAGS+= -DYP Modified: stable/12/lib/libc/amd64/gen/Makefile.inc ============================================================================== --- stable/12/lib/libc/amd64/gen/Makefile.inc Fri Jul 26 10:00:33 2019 (r350351) +++ stable/12/lib/libc/amd64/gen/Makefile.inc Fri Jul 26 10:13:48 2019 (r350352) @@ -2,7 +2,7 @@ # $FreeBSD$ SRCS+= _setjmp.S _set_tp.c rfork_thread.S setjmp.S sigsetjmp.S \ - fabs.S getcontextx.c \ + fabs.S \ infinity.c ldexp.c makecontext.c signalcontext.c \ flt_rounds.c fpgetmask.c fpsetmask.c fpgetprec.c fpsetprec.c \ fpgetround.c fpsetround.c fpgetsticky.c Modified: stable/12/lib/libc/i386/gen/Makefile.inc ============================================================================== --- stable/12/lib/libc/i386/gen/Makefile.inc Fri Jul 26 10:00:33 2019 (r350351) +++ stable/12/lib/libc/i386/gen/Makefile.inc Fri Jul 26 10:13:48 2019 (r350352) @@ -2,5 +2,5 @@ # $FreeBSD$ SRCS+= _ctx_start.S _setjmp.S _set_tp.c fabs.S \ - flt_rounds.c getcontextx.c infinity.c ldexp.c makecontext.c \ + flt_rounds.c infinity.c ldexp.c makecontext.c \ rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S From owner-svn-src-all@freebsd.org Fri Jul 26 10:21: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 CEDACBBFD6; Fri, 26 Jul 2019 10:21: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 B381E89507; Fri, 26 Jul 2019 10:21: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 8BD8EDBC7; Fri, 26 Jul 2019 10:21: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 x6QALtbY083932; Fri, 26 Jul 2019 10:21:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QALt8Q083931; Fri, 26 Jul 2019 10:21:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907261021.x6QALt8Q083931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 26 Jul 2019 10:21:55 +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: r350353 - stable/11/sys/dev/hwpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/hwpmc X-SVN-Commit-Revision: 350353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B381E89507 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.931,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, 26 Jul 2019 10:21:55 -0000 Author: kib Date: Fri Jul 26 10:21:55 2019 New Revision: 350353 URL: https://svnweb.freebsd.org/changeset/base/350353 Log: MFC r348544: hwpmc_intel: List all Silvermont ids. PR: 238310 Modified: stable/11/sys/dev/hwpmc/hwpmc_intel.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_intel.c Fri Jul 26 10:13:48 2019 (r350352) +++ stable/11/sys/dev/hwpmc/hwpmc_intel.c Fri Jul 26 10:21:55 2019 (r350353) @@ -209,7 +209,11 @@ pmc_intel_initialize(void) cputype = PMC_CPU_INTEL_HASWELL; nclasses = 5; break; + case 0x37: + case 0x4A: case 0x4D: /* Per Intel document 330061-001 01/2014. */ + case 0x5A: + case 0x5D: cputype = PMC_CPU_INTEL_ATOM_SILVERMONT; nclasses = 3; break; From owner-svn-src-all@freebsd.org Fri Jul 26 10:30:46 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 66EE8BC0E5; Fri, 26 Jul 2019 10:30:46 +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 45CBE898C5; Fri, 26 Jul 2019 10:30:46 +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 0EBDADC16; Fri, 26 Jul 2019 10:30:46 +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 x6QAUjuw088257; Fri, 26 Jul 2019 10:30:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QAUjE5088256; Fri, 26 Jul 2019 10:30:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907261030.x6QAUjE5088256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 26 Jul 2019 10:30:45 +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: r350354 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 350354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45CBE898C5 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.931,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, 26 Jul 2019 10:30:46 -0000 Author: kib Date: Fri Jul 26 10:30:45 2019 New Revision: 350354 URL: https://svnweb.freebsd.org/changeset/base/350354 Log: MFC r348536: Remove dead check. Modified: stable/11/sys/kern/link_elf_obj.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/link_elf_obj.c ============================================================================== --- stable/11/sys/kern/link_elf_obj.c Fri Jul 26 10:21:55 2019 (r350353) +++ stable/11/sys/kern/link_elf_obj.c Fri Jul 26 10:30:45 2019 (r350354) @@ -707,11 +707,6 @@ link_elf_load_file(linker_class_t cls, const char *fil goto out; } - if (symstrindex == -1) { - link_elf_error(filename, "lost symbol string index"); - error = ENOEXEC; - goto out; - } /* Allocate space for and load the symbol strings */ ef->ddbstrcnt = shdr[symstrindex].sh_size; ef->ddbstrtab = malloc(shdr[symstrindex].sh_size, M_LINKER, M_WAITOK); From owner-svn-src-all@freebsd.org Fri Jul 26 10:36: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 CD007BC34B; Fri, 26 Jul 2019 10:36:08 +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 7C2B389E11; Fri, 26 Jul 2019 10:36:08 +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 4F35CDDE2; Fri, 26 Jul 2019 10:36:08 +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 x6QAa89S094100; Fri, 26 Jul 2019 10:36:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QAa8wA094099; Fri, 26 Jul 2019 10:36:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907261036.x6QAa8wA094099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 26 Jul 2019 10:36: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: r350355 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 350355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C2B389E11 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.931,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, 26 Jul 2019 10:36:08 -0000 Author: kib Date: Fri Jul 26 10:36:07 2019 New Revision: 350355 URL: https://svnweb.freebsd.org/changeset/base/350355 Log: MFC r348533: Remove dead store. Modified: stable/11/sys/vm/swap_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/swap_pager.c ============================================================================== --- stable/11/sys/vm/swap_pager.c Fri Jul 26 10:30:45 2019 (r350354) +++ stable/11/sys/vm/swap_pager.c Fri Jul 26 10:36:07 2019 (r350355) @@ -2182,7 +2182,6 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl sp->sw_vp = vp; sp->sw_id = id; sp->sw_dev = dev; - sp->sw_flags = 0; sp->sw_nblks = nblks; sp->sw_used = 0; sp->sw_strategy = strategy; From owner-svn-src-all@freebsd.org Fri Jul 26 10:38: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 0A847BC3D7; Fri, 26 Jul 2019 10:38: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 DDAF889FD0; Fri, 26 Jul 2019 10:38:20 +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 A507EDDE3; Fri, 26 Jul 2019 10:38:20 +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 x6QAcKF1094246; Fri, 26 Jul 2019 10:38:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QAcK3i094245; Fri, 26 Jul 2019 10:38:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907261038.x6QAcK3i094245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 26 Jul 2019 10:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350356 - stable/11/sys/dev/efidev X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/efidev X-SVN-Commit-Revision: 350356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DDAF889FD0 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.931,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, 26 Jul 2019 10:38:21 -0000 Author: kib Date: Fri Jul 26 10:38:20 2019 New Revision: 350356 URL: https://svnweb.freebsd.org/changeset/base/350356 Log: MFC r348541: efirt efi_enter(): Release acquired locks and restore FPU ownership if efi_arch_enter() returned an error. Modified: stable/11/sys/dev/efidev/efirt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/efidev/efirt.c ============================================================================== --- stable/11/sys/dev/efidev/efirt.c Fri Jul 26 10:36:07 2019 (r350355) +++ stable/11/sys/dev/efidev/efirt.c Fri Jul 26 10:38:20 2019 (r350356) @@ -261,7 +261,13 @@ efi_enter(void) return (error); } - return (efi_arch_enter()); + error = efi_arch_enter(); + if (error != 0) { + fpu_kern_leave(td, NULL); + mtx_unlock(&efi_lock); + PMAP_UNLOCK(curpmap); + } + return (error); } static void From owner-svn-src-all@freebsd.org Fri Jul 26 10:43: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 2B3A9BC642; Fri, 26 Jul 2019 10:43:08 +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 09B9F8A502; Fri, 26 Jul 2019 10:43:08 +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 ED675DFA4; Fri, 26 Jul 2019 10:43:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6QAh73Z099855; Fri, 26 Jul 2019 10:43:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QAh7Jd099853; Fri, 26 Jul 2019 10:43:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907261043.x6QAh7Jd099853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 26 Jul 2019 10:43:07 +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: r350357 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 350357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 09B9F8A502 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.931,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, 26 Jul 2019 10:43:08 -0000 Author: kib Date: Fri Jul 26 10:43:07 2019 New Revision: 350357 URL: https://svnweb.freebsd.org/changeset/base/350357 Log: MFC r348360: Do not go into sleep in sleepq_catch_signals() when SIGSTOP from PT_ATTACH was consumed. PR: 231445 Modified: stable/11/sys/kern/kern_sig.c stable/11/sys/kern/subr_sleepqueue.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_sig.c ============================================================================== --- stable/11/sys/kern/kern_sig.c Fri Jul 26 10:38:20 2019 (r350356) +++ stable/11/sys/kern/kern_sig.c Fri Jul 26 10:43:07 2019 (r350357) @@ -2588,7 +2588,15 @@ ptracestop(struct thread *td, int sig, ksiginfo_t *si) p->p_xthread == NULL)) { p->p_xsig = sig; p->p_xthread = td; - td->td_dbgflags &= ~TDB_FSTP; + + /* + * If we are on sleepqueue already, + * let sleepqueue code decide if it + * needs to go sleep after attach. + */ + if (td->td_wchan == NULL) + td->td_dbgflags &= ~TDB_FSTP; + p->p_flag2 &= ~P2_PTRACE_FSTP; p->p_flag |= P_STOPPED_SIG | P_STOPPED_TRACE; sig_suspend_threads(td, p, 0); Modified: stable/11/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/11/sys/kern/subr_sleepqueue.c Fri Jul 26 10:38:20 2019 (r350356) +++ stable/11/sys/kern/subr_sleepqueue.c Fri Jul 26 10:43:07 2019 (r350357) @@ -494,6 +494,19 @@ sleepq_catch_signals(void *wchan, int pri) } else { mtx_unlock(&ps->ps_mtx); } + + /* + * Do not go into sleep if this thread was the + * ptrace(2) attach leader. cursig() consumed + * SIGSTOP from PT_ATTACH, but we usually act + * on the signal by interrupting sleep, and + * should do that here as well. + */ + if ((td->td_dbgflags & TDB_FSTP) != 0) { + if (ret == 0) + ret = EINTR; + td->td_dbgflags &= ~TDB_FSTP; + } } /* * Lock the per-process spinlock prior to dropping the PROC_LOCK From owner-svn-src-all@freebsd.org Fri Jul 26 12: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 2F494BF3D6; Fri, 26 Jul 2019 12:51:40 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B37908EE56; Fri, 26 Jul 2019 12:51:38 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 0dfa1e63; Fri, 26 Jul 2019 14:51:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=ewh0iC8qZs3iP0N5iO29Lz00Qn4=; b=diytNRIsPjzFo2Mhn5Rx9mNhdMGC pp+CC6eEVMB8btzNuHT8PkNCtujlrvrXzVOxwEJVsxSaLjACK4vh/yWVSBDUiPiB tk9k4CrilkBP4tqolJTjUgVxK5ZjnzYJRyBH9n1kF2QkjU4uuX/Y8sLn14Gfyb11 TwXdxQpsoXac3vw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=tYa9yTsnRBVEpJrCwPiesjc9XtKRT0RbcoGJBOcrJJxSqvCuvIttFU+/ syH94y5CCZh8zJgqBKPbTw/1UCDR5cWg2b2XTYTTePU0nk4uqzaTqlWz1tDiikIH 526NHqWTF1u+h0uuCFHnXpRNZM9mp6jbOCYdoix+HzmZ5GYwoyY= Received: from knuckles.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 06d43836 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Fri, 26 Jul 2019 14:51:31 +0200 (CEST) Date: Fri, 26 Jul 2019 05:10:42 +0200 From: Emmanuel Vadot To: Guido Falsi Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350135 - head/share/mk Message-Id: <20190726051042.fcc4f6d969e19fb6f480977b@bidouilliste.com> In-Reply-To: <28eb9717-533e-3d87-0e30-f60317ed97cb@FreeBSD.org> References: <201907191511.x6JFBWVi053537@repo.freebsd.org> <37944eff-6e00-df14-59d3-beae3fa89b6a@FreeBSD.org> <28eb9717-533e-3d87-0e30-f60317ed97cb@FreeBSD.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: B37908EE56 X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mail header.b=diytNRIs; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.177.182 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [2.42 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mail]; URIBL_BLOCKED(0.00)[bidouilliste.com.multi.uribl.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[bidouilliste.com]; NEURAL_SPAM_MEDIUM(0.88)[0.879,0]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_SHORT(0.93)[0.927,0]; MX_GOOD(-0.01)[mx-backup.blih.net,mail.blih.net]; DKIM_TRACE(0.00)[bidouilliste.com:+]; NEURAL_SPAM_LONG(0.18)[0.182,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.34)[ip: (-1.00), ipnet: 212.83.160.0/19(2.62), asn: 12876(0.09), country: FR(-0.01)]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; 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: Fri, 26 Jul 2019 12:51:40 -0000 On Thu, 25 Jul 2019 00:17:31 +0200 Guido Falsi wrote: > On 25/07/19 00:14, Guido Falsi wrote: > > On 19/07/19 17:11, Emmanuel Vadot wrote: > >> 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 > >> > > > > Hello, > > > > I don't know the actual workings of this file and have not checked it in > > depth, but this change is causing "make package" to not package > > /etc/rc.d/sshd (and others, all the ones being defined in > > ${group}PACKAGE variables), which are then missing when upgrading machines. > > > > Reverting this change makes packaging things work again. I think this > > change is actually wrong and the previous version was correct. > > /etc/rc.d/sshd is in the FreeBSD-sshd package, the other ones are also in their own package now, I'll check them all to see if that make sense. > After sending this message I also noticed, it causes the spurious > "FreeBSD-zfs" package to be generated again. Not so spurious, it now contains the rc.d zfs related files. I think that I'll remove it anyway, it doesn't make sense. > -- > Guido Falsi -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Fri Jul 26 12: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 DFDA1BF7D0; Fri, 26 Jul 2019 12:58:05 +0000 (UTC) (envelope-from madpilot@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 7736C8F337; Fri, 26 Jul 2019 12:58:05 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from tommy.madpilot.net (78-134-115-11.v4.ngi.it [78.134.115.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: madpilot/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 8408811726; Fri, 26 Jul 2019 12:58:04 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Subject: Re: svn commit: r350135 - head/share/mk To: Emmanuel Vadot Cc: Emmanuel Vadot , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201907191511.x6JFBWVi053537@repo.freebsd.org> <37944eff-6e00-df14-59d3-beae3fa89b6a@FreeBSD.org> <28eb9717-533e-3d87-0e30-f60317ed97cb@FreeBSD.org> <20190726051042.fcc4f6d969e19fb6f480977b@bidouilliste.com> From: Guido Falsi Openpgp: preference=signencrypt Autocrypt: addr=madpilot@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBE+G+l0BCADi/WBQ0aRJfnE7LBPsM0G3m/m3Yx7OPu4iYFvS84xawmRHtCNjWIntsxuX fptkmEo3Rsw816WUrek8dxoUAYdHd+EcpBcnnDzfDH5LW/TZ4gbrFezrHPdRp7wdxi23GN80 qPwHEwXuF0X4Wy5V0OO8B6VT/nA0ADYnBDhXS52HGIJ/GCUjgqJn+phDTdCFLvrSFdmgx4Wl c0W5Z1p5cmDF9l8L/hc959AeyNf7I9dXnjekGM9gVv7UDUYzCifR3U8T0fnfdMmS8NeI9NC+ wuREpRO4lKOkTnj9TtQJRiptlhcHQiAlG1cFqs7EQo57Tqq6cxD1FycZJLuC32bGbgalABEB AAG0Ikd1aWRvIEZhbHNpIDxtYWRwaWxvdEBGcmVlQlNELm9yZz6JATYEEwEIACACGwMCHgEC F4AFAlLvzwUFCwkIBwMFFQoJCAsEFgIDAQAKCRAa5oYOVsvSk6EzCAC4ovSo6XF4x0spuKmp RzVuZ5ywqCJAfRIrJHpW8HjSPkcUYwmXVOE3zjul9j2C2eHPPGobEDN5FqovAtzb7HdYGGcU aUdhDApUMMRVkzflwb23C/CI1RBcZxjC0noajSKgbIHx4+Afg6CFMgpngq+NJwEaaVrKlYzq G+KcfeVKAdwlWHJOgQJIEylUtwtBqXx/iJDrGwKO5A6a1uSEZrZfuwjSh8cBqoUfIwLZUIFE HBjHa8pUkp8mWx7JaZ19vBF6pDpPVZSoLSg8stWd1DPesn/qySYgtSGSY6hpWABVF98HRsBG +VXlHtqCaB0j0cGCDhCpHQUI10oGGc8k4zcvuQINBFMQe0EBEAChYaw3HqD3SvyBw0pqI+kk GIrLzO1XYXJXkuxPQ6BAFbe8jG3+h22zFU02OnJL8E1kLLMsCwVzVasYHOFiyY831IYHn/lh O+TN/lhWJTlUCxmWP8xFYJmta2mJzhzQDs3hyw5hF422T+rxgHg8gWxn0D6RO6hmGe7m3k91 8EDvj5JXAq7zj49mT3AMRjUtsVVPy8zjagqyaizCUiHAnbG4kj+BuT5wxR7TKJGk2OjhK/Dh EHzgHq4XB1Gv8+1LvGLZmqih/kBpBP1hIGkakok579CTkw/g8XoWqr6Cjz2fvtjaQmTBwdou gP8Yn5kMBIiIxF7XLngUc5DVEJMYamcktd0q4aHC/cnbWlTwc2WrQBI1AwxCZgDC1RbOOan8 oTIjWqRyaNp9zFvxOaJqgrxJA3Vl/3p9z+witk3pnmg4ITLIJDSmsf89MDaOVGQpDjzs9MaT YlIpTlW5Lns2WTYOue+NanntpX14UCGmeusk+4aYXPzf89zyALS3s3uLtVUdhFwLmdrFgHZS gjU5STLGlP8e9AVddVnf8qZ1czOvHX3UCCAI9YjBQA/5VxpRFJil4OTr9lUA5U57UKGpwmKw IPvArbT8468nYC2Rat4a7UJn3NLHucr9Vh0uvfgbFDhtPUb72sFA2cVI1tfZMnjfUx2jUYKM N5ErgK1Kes0piQARAQABiQEfBBgBCAAJBQJTEHtBAhsMAAoJEBrmhg5Wy9KTDecIAOGwpF/6 sBFQtOk6HkegtqbrZklkDIKQ2qq7+uR7m6PkBpoNj+HsE2EEOIOqGFktN6h8alVVoSs+xY36 1fnR/Kmwi30oCHL3QYWu2shmVa7IrjCyhm8N+n3JpGT6Ugznx3D9Fx/GfrvQlo9MVJE8QJWf +4uoGElKRtiVjbXZhP1/FVRMl7rAi8MtCtASOtAP+HUUyF9wuECqyd2W1F3oM+9Mp4x3/pUD GfSGSgEqETLkuRaMz0Iemm75sGRD3X+SPa4lBJc7x66ifAcdLdz7o3aLYfsjR6Zwca7TvC5E Ha0OfD9EsHGiF9909lPaRvG4buWFUfPBUPDkNHBLDwaQ53I= Message-ID: <0e851350-0967-ee2b-3655-b79d9abd38ed@FreeBSD.org> Date: Fri, 26 Jul 2019 14:58:01 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190726051042.fcc4f6d969e19fb6f480977b@bidouilliste.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 7736C8F337 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.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, 26 Jul 2019 12:58:05 -0000 On 26/07/19 05:10, Emmanuel Vadot wrote: > On Thu, 25 Jul 2019 00:17:31 +0200 > Guido Falsi wrote: > >> On 25/07/19 00:14, Guido Falsi wrote: >>> On 19/07/19 17:11, Emmanuel Vadot wrote: >>>> 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 >>>> >>> >>> Hello, >>> >>> I don't know the actual workings of this file and have not checked it in >>> depth, but this change is causing "make package" to not package >>> /etc/rc.d/sshd (and others, all the ones being defined in >>> ${group}PACKAGE variables), which are then missing when upgrading machines. >>> >>> Reverting this change makes packaging things work again. I think this >>> change is actually wrong and the previous version was correct. >>> > > /etc/rc.d/sshd is in the FreeBSD-sshd package, the other ones are also > in their own package now, I'll check them all to see if that make sense. It makes perfect sense for that file to be in the FreeBSD-sshd package and that was my first guess when looking for the missing file, but in my case it was not present in that package. By reverting your change it appears to end up in the FreeBSD-runtime package. > >> After sending this message I also noticed, it causes the spurious >> "FreeBSD-zfs" package to be generated again. > > Not so spurious, it now contains the rc.d zfs related files. > I think that I'll remove it anyway, it doesn't make sense. It does, but, again reverting your change, those files end up in the runtime package. -- Guido Falsi From owner-svn-src-all@freebsd.org Fri Jul 26 13:04: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 28BE3BF9CB; Fri, 26 Jul 2019 13:04:34 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5165B8F7F8; Fri, 26 Jul 2019 13:04:33 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id ac53f52c; Fri, 26 Jul 2019 15:04:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=7COCIE2Q02HrktGvhGJYpRRSTgY=; b=EtGgqnOrzv9nrMvvuDtpnfk9zJ8A 738DZwzEqi1qbAx5Mt0OYOS3IH0ga9jptoSNrveaCkgmGsCGfHvqQWBGu5hmbGgL e7cWjF5S8nKP4vtVHwA3nsfp5f9lLYVIcXtwm6ilsiuFHMJYlj456YHbgzAQDhnb 2HRfQfpWeq5CQOw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=OLfPR5sMzonZicRZyDxoavJmCZb1AuqMV25E5IodqqxglZzXFT2jvdy2 iTR8bKwWND0AZYyZiWkKOXl35699z0YZsmzTz9y9LjokYJ5FMHPg48STyCvqcj0L ZYZottyQ2KADWZdMXVP1SIDOl3BgUUiOyhgCZqHK6px/wpCJCFg= Received: from knuckles.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 46fea0d5 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Fri, 26 Jul 2019 15:04:31 +0200 (CEST) Date: Fri, 26 Jul 2019 05:23:45 +0200 From: Emmanuel Vadot To: Guido Falsi Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r350135 - head/share/mk Message-Id: <20190726052345.560b122cf2714bef73a2bf4f@bidouilliste.com> In-Reply-To: <0e851350-0967-ee2b-3655-b79d9abd38ed@FreeBSD.org> References: <201907191511.x6JFBWVi053537@repo.freebsd.org> <37944eff-6e00-df14-59d3-beae3fa89b6a@FreeBSD.org> <28eb9717-533e-3d87-0e30-f60317ed97cb@FreeBSD.org> <20190726051042.fcc4f6d969e19fb6f480977b@bidouilliste.com> <0e851350-0967-ee2b-3655-b79d9abd38ed@FreeBSD.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5165B8F7F8 X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mail header.b=EtGgqnOr; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.177.182 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [2.38 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mail]; URIBL_BLOCKED(0.00)[bidouilliste.com.multi.uribl.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[bidouilliste.com]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(0.88)[0.875,0]; NEURAL_SPAM_SHORT(0.93)[0.927,0]; DKIM_TRACE(0.00)[bidouilliste.com:+]; MX_GOOD(-0.01)[cached: mx-backup.blih.net]; NEURAL_SPAM_LONG(0.15)[0.147,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.34)[ip: (-0.99), ipnet: 212.83.160.0/19(2.62), asn: 12876(0.09), country: FR(-0.01)]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; 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: Fri, 26 Jul 2019 13:04:34 -0000 On Fri, 26 Jul 2019 14:58:01 +0200 Guido Falsi wrote: > On 26/07/19 05:10, Emmanuel Vadot wrote: > > On Thu, 25 Jul 2019 00:17:31 +0200 > > Guido Falsi wrote: > > > >> On 25/07/19 00:14, Guido Falsi wrote: > >>> On 19/07/19 17:11, Emmanuel Vadot wrote: > >>>> 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 > >>>> > >>> > >>> Hello, > >>> > >>> I don't know the actual workings of this file and have not checked it in > >>> depth, but this change is causing "make package" to not package > >>> /etc/rc.d/sshd (and others, all the ones being defined in > >>> ${group}PACKAGE variables), which are then missing when upgrading machines. > >>> > >>> Reverting this change makes packaging things work again. I think this > >>> change is actually wrong and the previous version was correct. > >>> > > > > /etc/rc.d/sshd is in the FreeBSD-sshd package, the other ones are also > > in their own package now, I'll check them all to see if that make sense. > > It makes perfect sense for that file to be in the FreeBSD-sshd package > and that was my first guess when looking for the missing file, but in my > case it was not present in that package. > > By reverting your change it appears to end up in the FreeBSD-runtime > package. Fresh build from today : elbarto@wopr> tar tzf FreeBSD-ssh-13.0.s20190726081149.txz /etc/rc.d/sshd /etc/rc.d/sshd elbarto@wopr> tar xzf FreeBSD-ssh-13.0.s20190726081149.txz +MANIFEST elbarto@wopr> jq < +MANIFEST | grep sshd "/etc/rc.d/sshd": "1$09d051563f89dbae0f54af42add15f9c16d5bf5c63a32d8eadc5127f665e4de9", "/etc/ssh/sshd_config": "1$7501d70e5186360c812b55cf0f0caff51169ca6764222f3fa668c09e8b5823a8", "/usr/sbin/sshd": "1$85772d32ba83cf6edd190fe48e949a358b08079a1dcc2c6a0de9addfe5075829", "/usr/share/man/man5/sshd_config.5.gz": "1$593bcd2338b124faf735825c52da8d9534f3e4b326a573590e8625f364017b57", "/usr/share/man/man8/sshd.8.gz": "1$729b894da4fa632be0ca6e06897943caca0e9d699a8a3c0ed33393e0b7ecec44", "/etc/rc.d/sshd", "/etc/ssh/sshd_config" > > > >> After sending this message I also noticed, it causes the spurious > >> "FreeBSD-zfs" package to be generated again. > > > > Not so spurious, it now contains the rc.d zfs related files. > > I think that I'll remove it anyway, it doesn't make sense. > > It does, but, again reverting your change, those files end up in the > runtime package. Yes reverting make those files end up in the runtime package, aka the default package used when no packages are specified. The change is good but will needs more tweaking in libexec/rc.d/Makefile so files endup when it make sense. > -- > Guido Falsi -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Fri Jul 26 13:12: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 9E6B5BFE8E; Fri, 26 Jul 2019 13:12:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 7DA968FF58; Fri, 26 Jul 2019 13:12:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6992AFA9B; Fri, 26 Jul 2019 13:12:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6QDCXks088296; Fri, 26 Jul 2019 13:12:33 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QDCXfe088295; Fri, 26 Jul 2019 13:12:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201907261312.x6QDCXfe088295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 26 Jul 2019 13:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350358 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 350358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DA968FF58 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,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, 26 Jul 2019 13:12:33 -0000 Author: bapt Date: Fri Jul 26 13:12:33 2019 New Revision: 350358 URL: https://svnweb.freebsd.org/changeset/base/350358 Log: Fix a bug introduced with parallel mounting of zfs Incorporate a fix from zol: https://github.com/zfsonlinux/zfs/commit/ab5036df1ccbe1b18c1ce6160b5829e8039d94ce commit log from upstream: Fix race in parallel mount's thread dispatching algorithm Strategy of parallel mount is as follows. 1) Initial thread dispatching is to select sets of mount points that don't have dependencies on other sets, hence threads can/should run lock-less and shouldn't race with other threads for other sets. Each thread dispatched corresponds to top level directory which may or may not have datasets to be mounted on sub directories. 2) Subsequent recursive thread dispatching for each thread from 1) is to mount datasets for each set of mount points. The mount points within each set have dependencies (i.e. child directories), so child directories are processed only after parent directory completes. The problem is that the initial thread dispatching in zfs_foreach_mountpoint() can be multi-threaded when it needs to be single-threaded, and this puts threads under race condition. This race appeared as mount/unmount issues on ZoL for ZoL having different timing regarding mount(2) execution due to fork(2)/exec(2) of mount(8). `zfs unmount -a` which expects proper mount order can't unmount if the mounts were reordered by the race condition. There are currently two known patterns of input list `handles` in `zfs_foreach_mountpoint(..,handles,..)` which cause the race condition. 1) #8833 case where input is `/a /a /a/b` after sorting. The problem is that libzfs_path_contains() can't correctly handle an input list with two same top level directories. There is a race between two POSIX threads A and B, * ThreadA for "/a" for test1 and "/a/b" * ThreadB for "/a" for test0/a and in case of #8833, ThreadA won the race. Two threads were created because "/a" wasn't considered as `"/a" contains "/a"`. 2) #8450 case where input is `/ /var/data /var/data/test` after sorting. The problem is that libzfs_path_contains() can't correctly handle an input list containing "/". There is a race between two POSIX threads A and B, * ThreadA for "/" and "/var/data/test" * ThreadB for "/var/data" and in case of #8450, ThreadA won the race. Two threads were created because "/var/data" wasn't considered as `"/" contains "/var/data"`. In other words, if there is (at least one) "/" in the input list, the initial thread dispatching must be single-threaded since every directory is a child of "/", meaning they all directly or indirectly depend on "/". In both cases, the first non_descendant_idx() call fails to correctly determine "path1-contains-path2", and as a result the initial thread dispatching creates another thread when it needs to be single-threaded. Fix a conditional in libzfs_path_contains() to consider above two. Reviewed-by: Brian Behlendorf Reviewed by: Sebastien Roy Signed-off-by: Tomohiro Kusumi PR: 237517, 237397, 239243 Submitted by: Matthew D. Fuller (by email) MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Jul 26 10:43:07 2019 (r350357) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Fri Jul 26 13:12:33 2019 (r350358) @@ -1281,12 +1281,14 @@ mountpoint_cmp(const void *arga, const void *argb) } /* - * Reutrn true if path2 is a child of path1 + * Return true if path2 is a child of path1 or path2 equals path1 or + * path1 is "/" (path2 is always a child of "/"). */ static boolean_t libzfs_path_contains(const char *path1, const char *path2) { - return (strstr(path2, path1) == path2 && path2[strlen(path1)] == '/'); + return (strcmp(path1, path2) == 0 || strcmp(path1, "/") == 0 || + (strstr(path2, path1) == path2 && path2[strlen(path1)] == '/')); } From owner-svn-src-all@freebsd.org Fri Jul 26 15:18: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 00DDBA333B; Fri, 26 Jul 2019 15:18:11 +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 CFD106DEE0; Fri, 26 Jul 2019 15:18:11 +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 8C15A19033; Fri, 26 Jul 2019 15:18:11 +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 x6QFIB01059385; Fri, 26 Jul 2019 15:18:11 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QFIBPk059384; Fri, 26 Jul 2019 15:18:11 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201907261518.x6QFIBPk059384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 26 Jul 2019 15:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350359 - head/sbin/swapon X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sbin/swapon X-SVN-Commit-Revision: 350359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CFD106DEE0 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,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, 26 Jul 2019 15:18:12 -0000 Author: dougm Date: Fri Jul 26 15:18:11 2019 New Revision: 350359 URL: https://svnweb.freebsd.org/changeset/base/350359 Log: Rewrite the comments that explain swapon_trim() to make them more comprehensible. Suggested by: rpokala Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D21034 Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Fri Jul 26 13:12:33 2019 (r350358) +++ head/sbin/swapon/swapon.c Fri Jul 26 15:18:11 2019 (r350359) @@ -746,9 +746,11 @@ swapon_trim(const char *name) off_t ioarg[2], sz; int error, fd; + /* Open a descriptor to create a consumer of the device. */ fd = open(name, O_WRONLY); if (fd < 0) errx(1, "Cannot open %s", name); + /* Find the device size. */ if (fstat(fd, &sb) < 0) errx(1, "Cannot stat %s", name); if (S_ISREG(sb.st_mode)) @@ -758,18 +760,22 @@ swapon_trim(const char *name) err(1, "ioctl(DIOCGMEDIASIZE)"); } else errx(1, "%s has an invalid file type", name); + /* Trim the device. */ ioarg[0] = 0; ioarg[1] = sz; if (ioctl(fd, DIOCGDELETE, ioarg) != 0) warn("ioctl(DIOCGDELETE)"); + /* Start using the device for swapping, creating a second consumer. */ + error = swapon(name); + /* - * 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. + * Do not close the device until the swap pager has attempted to create + * another consumer. For GELI devices created with the 'detach -l' + * option, removing the last consumer causes the device to be detached + * - that is, to disappear. This ordering ensures that the device will + * not be detached until swapoff is called. */ - error = swapon(name); close(fd); return (error); } From owner-svn-src-all@freebsd.org Fri Jul 26 16:55: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 0B03DA4AD1; Fri, 26 Jul 2019 16:55:08 +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 E1162713B8; Fri, 26 Jul 2019 16:55: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 B5EAD1A216; Fri, 26 Jul 2019 16:55:07 +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 x6QGt78H018389; Fri, 26 Jul 2019 16:55:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QGt6Vo018386; Fri, 26 Jul 2019 16:55:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907261655.x6QGt6Vo018386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 26 Jul 2019 16:55:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350360 - in head: contrib/libcxxrt lib/libcxxrt X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/libcxxrt lib/libcxxrt X-SVN-Commit-Revision: 350360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E1162713B8 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, 26 Jul 2019 16:55:08 -0000 Author: dim Date: Fri Jul 26 16:55:06 2019 New Revision: 350360 URL: https://svnweb.freebsd.org/changeset/base/350360 Log: Merge libcxxrt master f96846efbfd508f66d91fcbbef5dd808947c7f6d. Interesting fixes: f96846e Fix std::size_t -> size_t to unbreak build against libc++ 6.0.0 6f4cfa2 Fix the uncaught exception count with rethrowing (PR 239265) db54f53 Added C++14-specific operator delete (#47) PR: 239265 MFC after: 3 days Modified: head/contrib/libcxxrt/exception.cc (contents, props changed) head/contrib/libcxxrt/memory.cc (contents, props changed) head/lib/libcxxrt/Makefile head/lib/libcxxrt/Version.map Directory Properties: head/contrib/libcxxrt/ (props changed) head/contrib/libcxxrt/abi_namespace.h (props changed) head/contrib/libcxxrt/auxhelper.cc (props changed) head/contrib/libcxxrt/cxxabi.h (props changed) head/contrib/libcxxrt/dwarf_eh.h (props changed) head/contrib/libcxxrt/dynamic_cast.cc (props changed) head/contrib/libcxxrt/guard.cc (props changed) head/contrib/libcxxrt/libelftc_dem_gnu3.c (props changed) head/contrib/libcxxrt/stdexcept.cc (props changed) head/contrib/libcxxrt/stdexcept.h (props changed) head/contrib/libcxxrt/terminate.cc (props changed) head/contrib/libcxxrt/typeinfo.cc (props changed) head/contrib/libcxxrt/typeinfo.h (props changed) Modified: head/contrib/libcxxrt/exception.cc ============================================================================== --- head/contrib/libcxxrt/exception.cc Fri Jul 26 15:18:11 2019 (r350359) +++ head/contrib/libcxxrt/exception.cc Fri Jul 26 16:55:06 2019 (r350360) @@ -879,6 +879,13 @@ extern "C" void __cxa_rethrow() assert(ex->handlerCount > 0 && "Rethrowing uncaught exception!"); + // `globals->uncaughtExceptions` was decremented by `__cxa_begin_catch`. + // It's normally incremented by `throw_exception`, but this path invokes + // `_Unwind_Resume_or_Rethrow` directly to rethrow the exception. + // This path is only reachable if we're rethrowing a C++ exception - + // foreign exceptions don't adjust any of this state. + globals->uncaughtExceptions++; + // ex->handlerCount will be decremented in __cxa_end_catch in enclosing // catch block @@ -1224,11 +1231,13 @@ extern "C" void *__cxa_begin_catch(void *e) // we see is a foreign exception then we won't have called it yet. __cxa_thread_info *ti = thread_info(); __cxa_eh_globals *globals = &ti->globals; - globals->uncaughtExceptions--; _Unwind_Exception *exceptionObject = static_cast<_Unwind_Exception*>(e); if (isCXXException(exceptionObject->exception_class)) { + // Only exceptions thrown with a C++ exception throwing function will + // increment this, so don't decrement it here. + globals->uncaughtExceptions--; __cxa_exception *ex = exceptionFromPointer(exceptionObject); if (ex->handlerCount == 0) @@ -1365,6 +1374,14 @@ extern "C" std::type_info *__cxa_current_exception_typ } /** + * Cleanup, ensures that `__cxa_end_catch` is called to balance an explicit + * `__cxa_begin_catch` call. + */ +static void end_catch(char *) +{ + __cxa_end_catch(); +} +/** * ABI function, called when an exception specification is violated. * * This function does not return. @@ -1372,6 +1389,12 @@ extern "C" std::type_info *__cxa_current_exception_typ extern "C" void __cxa_call_unexpected(void*exception) { _Unwind_Exception *exceptionObject = static_cast<_Unwind_Exception*>(exception); + // Wrap the call to the unexpected handler in calls to `__cxa_begin_catch` + // and `__cxa_end_catch` so that we correctly update exception counts if + // the unexpected handler throws an exception. + __cxa_begin_catch(exceptionObject); + __attribute__((cleanup(end_catch))) + char unused; if (exceptionObject->exception_class == exception_class) { __cxa_exception *ex = exceptionFromPointer(exceptionObject); Modified: head/contrib/libcxxrt/memory.cc ============================================================================== --- head/contrib/libcxxrt/memory.cc Fri Jul 26 15:18:11 2019 (r350359) +++ head/contrib/libcxxrt/memory.cc Fri Jul 26 16:55:06 2019 (r350360) @@ -151,4 +151,21 @@ void operator delete[](void * ptr) NOEXCEPT ::operator delete(ptr); } +// C++14 additional delete operators +#if __cplusplus >= 201402L + +__attribute__((weak)) +void operator delete(void * ptr, size_t) NOEXCEPT +{ + ::operator delete(ptr); +} + + +__attribute__((weak)) +void operator delete[](void * ptr, size_t) NOEXCEPT +{ + ::operator delete(ptr); +} + +#endif Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Fri Jul 26 15:18:11 2019 (r350359) +++ head/lib/libcxxrt/Makefile Fri Jul 26 16:55:06 2019 (r350360) @@ -22,7 +22,7 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ -CXXSTD?= c++11 +CXXSTD?= c++14 VERSION_MAP= ${.CURDIR}/Version.map .include Modified: head/lib/libcxxrt/Version.map ============================================================================== --- head/lib/libcxxrt/Version.map Fri Jul 26 15:18:11 2019 (r350359) +++ head/lib/libcxxrt/Version.map Fri Jul 26 16:55:06 2019 (r350360) @@ -277,6 +277,10 @@ CXXABI_1.3.9 { "typeinfo name for unsigned __int128 const*"; "typeinfo name for unsigned __int128"; "typeinfo name for unsigned __int128*"; + "operator delete[](void*, unsigned int)"; + "operator delete(void*, unsigned int)"; + "operator delete[](void*, unsigned long)"; + "operator delete(void*, unsigned long)"; }; } CXXABI_1.3.6; From owner-svn-src-all@freebsd.org Fri Jul 26 17:48: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 73814A59B9; Fri, 26 Jul 2019 17:48:52 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) (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 81D3C7318F; Fri, 26 Jul 2019 17:48:51 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f66.google.com with SMTP id i10so106430035iol.13; Fri, 26 Jul 2019 10:48:51 -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=aJgpeuAPvKgCtIh2QKM2DX6QmhIweZbu/E+tQDhMxUo=; b=WwQvXOVb+EeGW2yhChFUmS8fUB+9nSbbXFv8xHySTLGICQ2fZfuvwZouyiT85nkmd8 KZMOZFTjXFufAzKdap9SJfTufDjqeyG1yy2GfUqgj0qYhDpgyTk/HMKqtdUfUt1M59uG ndtqoo/t3jHYFzLtOkXrSG/2ZYXqQLurOgxDP//fHQ9lY+H3TG6+gVhR2i8V2uKC/4fW m4o6h+HuJoAJ15dG9JipdqRE8rhkYgqxDlDbjDI5+U6z44luM38gbY+JSupPbWGYGQN/ tj9aRv8xLptMt2h5Yvweb5GuHBXwCfOLP9QCtFz4aBTx6qPFIDDs+nmYJzntVd0wvF7q x3uQ== X-Gm-Message-State: APjAAAXY4ia3y8N8JiPJprBlPh5WuBC+oS2zUuQtJRJpHt9x7PPMEDdF 6YLlAMPgp0vK9ltbHh7/IIde+CgKy/gSJuVrlykL4t22 X-Google-Smtp-Source: APXvYqxzo9LL37zxCrYBAlzismzhq0XhG8t4Q/2ez2dWK+744jnSjweT7CWzelYVKT1rk68fUs0Pe4qCPVmEOGUcshw= X-Received: by 2002:a02:aa0d:: with SMTP id r13mr98097378jam.129.1564162915762; Fri, 26 Jul 2019 10:41:55 -0700 (PDT) MIME-Version: 1.0 References: <201907242106.x6OL6KaM068071@repo.freebsd.org> <201907250203.x6P23GeQ076818@slippy.cwsent.com> In-Reply-To: <201907250203.x6P23GeQ076818@slippy.cwsent.com> From: Ed Maste Date: Fri, 26 Jul 2019 12:02:13 -0400 Message-ID: Subject: Re: svn commit: r350301 - head/lib/libsysdecode To: Cy Schubert Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 81D3C7318F X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.66 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.16 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; 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.86)[-0.863,0]; RCVD_IN_DNSWL_NONE(0.00)[66.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.29)[ip: (-0.54), ipnet: 209.85.128.0/17(-3.42), asn: 15169(-2.45), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; MIME_TRACE(0.00)[0:+]; 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)[emaste@freebsd.org,carpeddiem@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: Fri, 26 Jul 2019 17:48:52 -0000 On Wed, 24 Jul 2019 at 22:04, Cy Schubert wrote: > > In message <201907242106.x6OL6KaM068071@repo.freebsd.org>, Ed Maste > writes: > > Author: emaste > > Date: Wed Jul 24 21:06:19 2019 > > New Revision: 350301 > > URL: https://svnweb.freebsd.org/changeset/base/350301 > > > > Log: > > libsysdecode: add explicit dependencies on recently changed headers > > > Hi Ed, > > This breaks 32-bit compatibility builds on amd64. Thanks for the note and sorry about that. lwhsu had a workaround in r350322 and it should have a proper fix as of r350327. From owner-svn-src-all@freebsd.org Fri Jul 26 17:58: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 9055AA5C37; Fri, 26 Jul 2019 17:58:47 +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 734227379B; Fri, 26 Jul 2019 17:58:47 +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 403EA1ACC1; Fri, 26 Jul 2019 17:58:47 +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 x6QHwlTg053963; Fri, 26 Jul 2019 17:58:47 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QHwlr7053962; Fri, 26 Jul 2019 17:58:47 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201907261758.x6QHwlr7053962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 26 Jul 2019 17:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350361 - head X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 734227379B 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.961,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, 26 Jul 2019 17:58:47 -0000 Author: ian Date: Fri Jul 26 17:58:46 2019 New Revision: 350361 URL: https://svnweb.freebsd.org/changeset/base/350361 Log: Re-wrap the text at 80 columns after fixing the indent in the prior commit. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jul 26 16:55:06 2019 (r350360) +++ head/UPDATING Fri Jul 26 17:58:46 2019 (r350361) @@ -27,12 +27,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20190713: - Default permissions on the /var/account/acct file (and copies of it rotated - by periodic daily scripts) are changed from 0644 to 0640 because the file - contains sensitive information that should not be world-readable. If the - /var/account directory must be created by rc.d/accounting, the mode used is - now 0750. Admins who use the accounting feature are encouraged to change - the mode of an existing /var/account directory to 0750 or 0700. + Default permissions on the /var/account/acct file (and copies of it + rotated by periodic daily scripts) are changed from 0644 to 0640 + because the file contains sensitive information that should not be + world-readable. If the /var/account directory must be created by + rc.d/accounting, the mode used is now 0750. Admins who use the + accounting feature are encouraged to change the mode of an existing + /var/account directory to 0750 or 0700. 20190620: Entropy collection and the /dev/random device are no longer optional From owner-svn-src-all@freebsd.org Fri Jul 26 18:03: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 05D1BA5EA7; Fri, 26 Jul 2019 18:03:52 +0000 (UTC) (envelope-from madpilot@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 DC33E74230; Fri, 26 Jul 2019 18:03:51 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from tommy.madpilot.net (78-134-115-11.v4.ngi.it [78.134.115.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: madpilot/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 1D91F13BDA; Fri, 26 Jul 2019 18:03:50 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Subject: Re: svn commit: r350135 - head/share/mk To: Emmanuel Vadot Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201907191511.x6JFBWVi053537@repo.freebsd.org> <37944eff-6e00-df14-59d3-beae3fa89b6a@FreeBSD.org> <28eb9717-533e-3d87-0e30-f60317ed97cb@FreeBSD.org> <20190726051042.fcc4f6d969e19fb6f480977b@bidouilliste.com> <0e851350-0967-ee2b-3655-b79d9abd38ed@FreeBSD.org> <20190726052345.560b122cf2714bef73a2bf4f@bidouilliste.com> From: Guido Falsi Openpgp: preference=signencrypt Autocrypt: addr=madpilot@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBE+G+l0BCADi/WBQ0aRJfnE7LBPsM0G3m/m3Yx7OPu4iYFvS84xawmRHtCNjWIntsxuX fptkmEo3Rsw816WUrek8dxoUAYdHd+EcpBcnnDzfDH5LW/TZ4gbrFezrHPdRp7wdxi23GN80 qPwHEwXuF0X4Wy5V0OO8B6VT/nA0ADYnBDhXS52HGIJ/GCUjgqJn+phDTdCFLvrSFdmgx4Wl c0W5Z1p5cmDF9l8L/hc959AeyNf7I9dXnjekGM9gVv7UDUYzCifR3U8T0fnfdMmS8NeI9NC+ wuREpRO4lKOkTnj9TtQJRiptlhcHQiAlG1cFqs7EQo57Tqq6cxD1FycZJLuC32bGbgalABEB AAG0Ikd1aWRvIEZhbHNpIDxtYWRwaWxvdEBGcmVlQlNELm9yZz6JATYEEwEIACACGwMCHgEC F4AFAlLvzwUFCwkIBwMFFQoJCAsEFgIDAQAKCRAa5oYOVsvSk6EzCAC4ovSo6XF4x0spuKmp RzVuZ5ywqCJAfRIrJHpW8HjSPkcUYwmXVOE3zjul9j2C2eHPPGobEDN5FqovAtzb7HdYGGcU aUdhDApUMMRVkzflwb23C/CI1RBcZxjC0noajSKgbIHx4+Afg6CFMgpngq+NJwEaaVrKlYzq G+KcfeVKAdwlWHJOgQJIEylUtwtBqXx/iJDrGwKO5A6a1uSEZrZfuwjSh8cBqoUfIwLZUIFE HBjHa8pUkp8mWx7JaZ19vBF6pDpPVZSoLSg8stWd1DPesn/qySYgtSGSY6hpWABVF98HRsBG +VXlHtqCaB0j0cGCDhCpHQUI10oGGc8k4zcvuQINBFMQe0EBEAChYaw3HqD3SvyBw0pqI+kk GIrLzO1XYXJXkuxPQ6BAFbe8jG3+h22zFU02OnJL8E1kLLMsCwVzVasYHOFiyY831IYHn/lh O+TN/lhWJTlUCxmWP8xFYJmta2mJzhzQDs3hyw5hF422T+rxgHg8gWxn0D6RO6hmGe7m3k91 8EDvj5JXAq7zj49mT3AMRjUtsVVPy8zjagqyaizCUiHAnbG4kj+BuT5wxR7TKJGk2OjhK/Dh EHzgHq4XB1Gv8+1LvGLZmqih/kBpBP1hIGkakok579CTkw/g8XoWqr6Cjz2fvtjaQmTBwdou gP8Yn5kMBIiIxF7XLngUc5DVEJMYamcktd0q4aHC/cnbWlTwc2WrQBI1AwxCZgDC1RbOOan8 oTIjWqRyaNp9zFvxOaJqgrxJA3Vl/3p9z+witk3pnmg4ITLIJDSmsf89MDaOVGQpDjzs9MaT YlIpTlW5Lns2WTYOue+NanntpX14UCGmeusk+4aYXPzf89zyALS3s3uLtVUdhFwLmdrFgHZS gjU5STLGlP8e9AVddVnf8qZ1czOvHX3UCCAI9YjBQA/5VxpRFJil4OTr9lUA5U57UKGpwmKw IPvArbT8468nYC2Rat4a7UJn3NLHucr9Vh0uvfgbFDhtPUb72sFA2cVI1tfZMnjfUx2jUYKM N5ErgK1Kes0piQARAQABiQEfBBgBCAAJBQJTEHtBAhsMAAoJEBrmhg5Wy9KTDecIAOGwpF/6 sBFQtOk6HkegtqbrZklkDIKQ2qq7+uR7m6PkBpoNj+HsE2EEOIOqGFktN6h8alVVoSs+xY36 1fnR/Kmwi30oCHL3QYWu2shmVa7IrjCyhm8N+n3JpGT6Ugznx3D9Fx/GfrvQlo9MVJE8QJWf +4uoGElKRtiVjbXZhP1/FVRMl7rAi8MtCtASOtAP+HUUyF9wuECqyd2W1F3oM+9Mp4x3/pUD GfSGSgEqETLkuRaMz0Iemm75sGRD3X+SPa4lBJc7x66ifAcdLdz7o3aLYfsjR6Zwca7TvC5E Ha0OfD9EsHGiF9909lPaRvG4buWFUfPBUPDkNHBLDwaQ53I= Message-ID: <2eaac343-b3ef-4910-65e2-b9b0c7886029@FreeBSD.org> Date: Fri, 26 Jul 2019 20:03:49 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190726052345.560b122cf2714bef73a2bf4f@bidouilliste.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DC33E74230 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.981,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, 26 Jul 2019 18:03:52 -0000 On 26/07/19 05:23, Emmanuel Vadot wrote: > On Fri, 26 Jul 2019 14:58:01 +0200 > Guido Falsi wrote: >>>>> Hello, >>>>> >>>>> I don't know the actual workings of this file and have not checked it in >>>>> depth, but this change is causing "make package" to not package >>>>> /etc/rc.d/sshd (and others, all the ones being defined in >>>>> ${group}PACKAGE variables), which are then missing when upgrading machines. >>>>> >>>>> Reverting this change makes packaging things work again. I think this >>>>> change is actually wrong and the previous version was correct. >>>>> >>> >>> /etc/rc.d/sshd is in the FreeBSD-sshd package, the other ones are also >>> in their own package now, I'll check them all to see if that make sense. >> >> It makes perfect sense for that file to be in the FreeBSD-sshd package >> and that was my first guess when looking for the missing file, but in my >> case it was not present in that package. >> >> By reverting your change it appears to end up in the FreeBSD-runtime >> package. > > Fresh build from today : > > elbarto@wopr> tar tzf FreeBSD-ssh-13.0.s20190726081149.txz /etc/rc.d/sshd > /etc/rc.d/sshd > elbarto@wopr> tar xzf FreeBSD-ssh-13.0.s20190726081149.txz +MANIFEST > elbarto@wopr> jq < +MANIFEST | grep sshd > "/etc/rc.d/sshd": "1$09d051563f89dbae0f54af42add15f9c16d5bf5c63a32d8eadc5127f665e4de9", > "/etc/ssh/sshd_config": "1$7501d70e5186360c812b55cf0f0caff51169ca6764222f3fa668c09e8b5823a8", > "/usr/sbin/sshd": "1$85772d32ba83cf6edd190fe48e949a358b08079a1dcc2c6a0de9addfe5075829", > "/usr/share/man/man5/sshd_config.5.gz": "1$593bcd2338b124faf735825c52da8d9534f3e4b326a573590e8625f364017b57", > "/usr/share/man/man8/sshd.8.gz": "1$729b894da4fa632be0ca6e06897943caca0e9d699a8a3c0ed33393e0b7ecec44", > "/etc/rc.d/sshd", > "/etc/ssh/sshd_config" A new build gives me the same result as you. Unluckily I don't have the old packages without the files anymore (my mistake). I have no idea what has been going on. Sorry for the noise and thanks for having listened to me! -- Guido Falsi From owner-svn-src-all@freebsd.org Fri Jul 26 18:49: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 0730BA6B7D; Fri, 26 Jul 2019 18:49: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 D4CAE75B2A; Fri, 26 Jul 2019 18:49:21 +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 953F51B594; Fri, 26 Jul 2019 18:49:21 +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 x6QInLdM084078; Fri, 26 Jul 2019 18:49:21 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QInLx6084076; Fri, 26 Jul 2019 18:49:21 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201907261849.x6QInLx6084076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 26 Jul 2019 18:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350362 - head/contrib/llvm/lib/CodeGen X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/CodeGen X-SVN-Commit-Revision: 350362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D4CAE75B2A 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]; 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, 26 Jul 2019 18:49:22 -0000 Author: dim Date: Fri Jul 26 18:49:20 2019 New Revision: 350362 URL: https://svnweb.freebsd.org/changeset/base/350362 Log: Pull in r366369 from upstream llvm trunk (by Francis Visoiu Mistrih): [CodeGen][NFC] Simplify checks for stack protector index checking Use `hasStackProtectorIndex()` instead of `getStackProtectorIndex() >= 0`. Pull in r366371 from upstream llvm trunk (by Francis Visoiu Mistrih): [PEI] Don't re-allocate a pre-allocated stack protector slot The LocalStackSlotPass pre-allocates a stack protector and makes sure that it comes before the local variables on the stack. We need to make sure that later during PEI we don't re-allocate a new stack protector slot. If that happens, the new stack protector slot will end up being **after** the local variables that it should be protecting. Therefore, we would have two slots assigned for two different stack protectors, one at the top of the stack, and one at the bottom. Since PEI will overwrite the assigned slot for the stack protector, the load that is used to compare the value of the stack protector will use the slot assigned by PEI, which is wrong. For this, we need to check if the object is pre-allocated, and re-use that pre-allocated slot. Differential Revision: https://reviews.llvm.org/D64757 Pull in r367068 from upstream llvm trunk (by Francis Visoiu Mistrih): [CodeGen] Don't resolve the stack protector frame accesses until PEI Currently, stack protector loads and stores are resolved during LocalStackSlotAllocation (if the pass needs to run). When this is the case, the base register assigned to the frame access is going to be one of the vregs created during LocalStackSlotAllocation. This means that we are keeping a pointer to the stack protector slot, and we're using this pointer to load and store to it. In case register pressure goes up, we may end up spilling this pointer to the stack, which can be a security concern. Instead, leave it to PEI to resolve the frame accesses. In order to do that, we make all stack protector accesses go through frame index operands, then PEI will resolve this using an offset from sp/fp/bp. Differential Revision: https://reviews.llvm.org/D64759 Together, these fix a issue where the stack protection feature in LLVM's ARM backend can be rendered ineffective when the stack protector slot is re-allocated so that it appears after the local variables that it is meant to protect, leaving the function potentially vulnerable to a stack-based buffer overflow. Reported by: andrew Security: https://kb.cert.org/vuls/id/129209/ MFC after: 3 days Modified: head/contrib/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp Modified: head/contrib/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp Fri Jul 26 17:58:46 2019 (r350361) +++ head/contrib/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp Fri Jul 26 18:49:20 2019 (r350362) @@ -200,19 +200,27 @@ void LocalStackSlotPass::calculateFrameObjectOffsets(M // Make sure that the stack protector comes before the local variables on the // stack. SmallSet ProtectedObjs; - if (MFI.getStackProtectorIndex() >= 0) { + if (MFI.hasStackProtectorIndex()) { + int StackProtectorFI = MFI.getStackProtectorIndex(); + + // We need to make sure we didn't pre-allocate the stack protector when + // doing this. + // If we already have a stack protector, this will re-assign it to a slot + // that is **not** covering the protected objects. + assert(!MFI.isObjectPreAllocated(StackProtectorFI) && + "Stack protector pre-allocated in LocalStackSlotAllocation"); + StackObjSet LargeArrayObjs; StackObjSet SmallArrayObjs; StackObjSet AddrOfObjs; - AdjustStackOffset(MFI, MFI.getStackProtectorIndex(), Offset, - StackGrowsDown, MaxAlign); + AdjustStackOffset(MFI, StackProtectorFI, Offset, StackGrowsDown, MaxAlign); // Assign large stack objects first. for (unsigned i = 0, e = MFI.getObjectIndexEnd(); i != e; ++i) { if (MFI.isDeadObjectIndex(i)) continue; - if (MFI.getStackProtectorIndex() == (int)i) + if (StackProtectorFI == (int)i) continue; switch (MFI.getObjectSSPLayout(i)) { @@ -343,6 +351,14 @@ bool LocalStackSlotPass::insertFrameReferenceRegisters int FrameIdx = FR.getFrameIndex(); assert(MFI.isObjectPreAllocated(FrameIdx) && "Only pre-allocated locals expected!"); + + // We need to keep the references to the stack protector slot through frame + // index operands so that it gets resolved by PEI rather than this pass. + // This avoids accesses to the stack protector though virtual base + // registers, and forces PEI to address it using fp/sp/bp. + if (MFI.hasStackProtectorIndex() && + FrameIdx == MFI.getStackProtectorIndex()) + continue; LLVM_DEBUG(dbgs() << "Considering: " << MI); Modified: head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp Fri Jul 26 17:58:46 2019 (r350361) +++ head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp Fri Jul 26 18:49:20 2019 (r350362) @@ -845,18 +845,26 @@ void PEI::calculateFrameObjectOffsets(MachineFunction // Make sure that the stack protector comes before the local variables on the // stack. SmallSet ProtectedObjs; - if (MFI.getStackProtectorIndex() >= 0) { + if (MFI.hasStackProtectorIndex()) { + int StackProtectorFI = MFI.getStackProtectorIndex(); StackObjSet LargeArrayObjs; StackObjSet SmallArrayObjs; StackObjSet AddrOfObjs; - AdjustStackOffset(MFI, MFI.getStackProtectorIndex(), StackGrowsDown, - Offset, MaxAlign, Skew); + // If we need a stack protector, we need to make sure that + // LocalStackSlotPass didn't already allocate a slot for it. + // If we are told to use the LocalStackAllocationBlock, the stack protector + // is expected to be already pre-allocated. + if (!MFI.getUseLocalStackAllocationBlock()) + AdjustStackOffset(MFI, StackProtectorFI, StackGrowsDown, Offset, MaxAlign, + Skew); + else if (!MFI.isObjectPreAllocated(MFI.getStackProtectorIndex())) + llvm_unreachable( + "Stack protector not pre-allocated by LocalStackSlotPass."); // Assign large stack objects first. for (unsigned i = 0, e = MFI.getObjectIndexEnd(); i != e; ++i) { - if (MFI.isObjectPreAllocated(i) && - MFI.getUseLocalStackAllocationBlock()) + if (MFI.isObjectPreAllocated(i) && MFI.getUseLocalStackAllocationBlock()) continue; if (i >= MinCSFrameIndex && i <= MaxCSFrameIndex) continue; @@ -864,8 +872,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction continue; if (MFI.isDeadObjectIndex(i)) continue; - if (MFI.getStackProtectorIndex() == (int)i || - EHRegNodeFrameIndex == (int)i) + if (StackProtectorFI == (int)i || EHRegNodeFrameIndex == (int)i) continue; switch (MFI.getObjectSSPLayout(i)) { @@ -884,6 +891,15 @@ void PEI::calculateFrameObjectOffsets(MachineFunction llvm_unreachable("Unexpected SSPLayoutKind."); } + // We expect **all** the protected stack objects to be pre-allocated by + // LocalStackSlotPass. If it turns out that PEI still has to allocate some + // of them, we may end up messing up the expected order of the objects. + if (MFI.getUseLocalStackAllocationBlock() && + !(LargeArrayObjs.empty() && SmallArrayObjs.empty() && + AddrOfObjs.empty())) + llvm_unreachable("Found protected stack objects not pre-allocated by " + "LocalStackSlotPass."); + AssignProtectedObjSet(LargeArrayObjs, ProtectedObjs, MFI, StackGrowsDown, Offset, MaxAlign, Skew); AssignProtectedObjSet(SmallArrayObjs, ProtectedObjs, MFI, StackGrowsDown, @@ -905,8 +921,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction continue; if (MFI.isDeadObjectIndex(i)) continue; - if (MFI.getStackProtectorIndex() == (int)i || - EHRegNodeFrameIndex == (int)i) + if (MFI.getStackProtectorIndex() == (int)i || EHRegNodeFrameIndex == (int)i) continue; if (ProtectedObjs.count(i)) continue; From owner-svn-src-all@freebsd.org Fri Jul 26 19:14: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 213B5A74CC; Fri, 26 Jul 2019 19:14:13 +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 01B2C76CF1; Fri, 26 Jul 2019 19:14:13 +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 D28501BB1B; Fri, 26 Jul 2019 19:14:12 +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 x6QJEC0X001662; Fri, 26 Jul 2019 19:14:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QJEC2B001660; Fri, 26 Jul 2019 19:14:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201907261914.x6QJEC2B001660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 26 Jul 2019 19:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350363 - in head/sys/cam: ctl scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/cam: ctl scsi X-SVN-Commit-Revision: 350363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01B2C76CF1 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, 26 Jul 2019 19:14:13 -0000 Author: mav Date: Fri Jul 26 19:14:12 2019 New Revision: 350363 URL: https://svnweb.freebsd.org/changeset/base/350363 Log: Add support for Long LBA mode parameter block descriptor. It is formally required for SBC Base 2016 feature set. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Jul 26 18:49:20 2019 (r350362) +++ head/sys/cam/ctl/ctl.c Fri Jul 26 19:14:12 2019 (r350363) @@ -6365,13 +6365,12 @@ int ctl_mode_sense(struct ctl_scsiio *ctsio) { struct ctl_lun *lun = CTL_LUN(ctsio); - int pc, page_code, dbd, subpage; - int alloc_len, page_len, header_len, total_len; - struct scsi_mode_block_descr *block_desc; + int pc, page_code, llba, subpage; + int alloc_len, page_len, header_len, bd_len, total_len; + void *block_desc; struct ctl_page_index *page_index; - dbd = 0; - block_desc = NULL; + llba = 0; CTL_DEBUG_PRINT(("ctl_mode_sense\n")); @@ -6383,9 +6382,10 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) header_len = sizeof(struct scsi_mode_hdr_6); if (cdb->byte2 & SMS_DBD) - dbd = 1; + bd_len = 0; else - header_len += sizeof(struct scsi_mode_block_descr); + bd_len = sizeof(struct scsi_mode_block_descr); + header_len += bd_len; pc = (cdb->page & SMS_PAGE_CTRL_MASK) >> 6; page_code = cdb->page & SMS_PAGE_CODE; @@ -6399,11 +6399,18 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) cdb = (struct scsi_mode_sense_10 *)ctsio->cdb; header_len = sizeof(struct scsi_mode_hdr_10); + if (cdb->byte2 & SMS_DBD) { + bd_len = 0; + } else if (lun->be_lun->lun_type == T_DIRECT) { + if (cdb->byte2 & SMS10_LLBAA) { + llba = 1; + bd_len = sizeof(struct scsi_mode_block_descr_dlong); + } else + bd_len = sizeof(struct scsi_mode_block_descr_dshort); + } else + bd_len = sizeof(struct scsi_mode_block_descr); + header_len += bd_len; - if (cdb->byte2 & SMS_DBD) - dbd = 1; - else - header_len += sizeof(struct scsi_mode_block_descr); pc = (cdb->page & SMS_PAGE_CTRL_MASK) >> 6; page_code = cdb->page & SMS_PAGE_CODE; subpage = cdb->subpage; @@ -6536,12 +6543,8 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) (lun->MODE_CTRL.eca_and_aen & SCP_SWP) != 0) header->dev_specific |= 0x80; /* WP */ } - if (dbd) - header->block_descr_len = 0; - else - header->block_descr_len = - sizeof(struct scsi_mode_block_descr); - block_desc = (struct scsi_mode_block_descr *)&header[1]; + header->block_descr_len = bd_len; + block_desc = &header[1]; break; } case MODE_SENSE_10: { @@ -6558,12 +6561,10 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) (lun->MODE_CTRL.eca_and_aen & SCP_SWP) != 0) header->dev_specific |= 0x80; /* WP */ } - if (dbd) - scsi_ulto2b(0, header->block_descr_len); - else - scsi_ulto2b(sizeof(struct scsi_mode_block_descr), - header->block_descr_len); - block_desc = (struct scsi_mode_block_descr *)&header[1]; + if (llba) + header->flags |= SMH_LONGLBA; + scsi_ulto2b(bd_len, header->block_descr_len); + block_desc = &header[1]; break; } default: @@ -6574,12 +6575,27 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) * If we've got a disk, use its blocksize in the block * descriptor. Otherwise, just set it to 0. */ - if (dbd == 0) { - if (lun->be_lun->lun_type == T_DIRECT) - scsi_ulto3b(lun->be_lun->blocksize, - block_desc->block_len); - else - scsi_ulto3b(0, block_desc->block_len); + if (bd_len > 0) { + if (lun->be_lun->lun_type == T_DIRECT) { + if (llba) { + struct scsi_mode_block_descr_dlong *bd = block_desc; + if (lun->be_lun->maxlba != 0) + scsi_u64to8b(lun->be_lun->maxlba + 1, + bd->num_blocks); + scsi_ulto4b(lun->be_lun->blocksize, + bd->block_len); + } else { + struct scsi_mode_block_descr_dshort *bd = block_desc; + if (lun->be_lun->maxlba != 0) + scsi_ulto4b(MIN(lun->be_lun->maxlba+1, + UINT32_MAX), bd->num_blocks); + scsi_ulto3b(lun->be_lun->blocksize, + bd->block_len); + } + } else { + struct scsi_mode_block_descr *bd = block_desc; + scsi_ulto3b(0, bd->block_len); + } } switch (page_code) { Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Fri Jul 26 18:49:20 2019 (r350362) +++ head/sys/cam/scsi/scsi_all.h Fri Jul 26 19:14:12 2019 (r350363) @@ -264,7 +264,9 @@ struct scsi_mode_hdr_10 u_int8_t datalen[2]; u_int8_t medium_type; u_int8_t dev_specific; - u_int8_t reserved[2]; + u_int8_t flags; +#define SMH_LONGLBA 0x01 + u_int8_t reserved; u_int8_t block_descr_len[2]; }; @@ -274,6 +276,20 @@ struct scsi_mode_block_descr u_int8_t num_blocks[3]; u_int8_t reserved; u_int8_t block_len[3]; +}; + +struct scsi_mode_block_descr_dshort +{ + u_int8_t num_blocks[4]; + u_int8_t reserved; + u_int8_t block_len[3]; +}; + +struct scsi_mode_block_descr_dlong +{ + u_int8_t num_blocks[8]; + u_int8_t reserved[4]; + u_int8_t block_len[4]; }; struct scsi_per_res_in From owner-svn-src-all@freebsd.org Fri Jul 26 19: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 E7002A7586; Fri, 26 Jul 2019 19:16:02 +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 C88B876E75; Fri, 26 Jul 2019 19:16:02 +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 A01301BB1E; Fri, 26 Jul 2019 19:16:02 +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 x6QJG2Wp001817; Fri, 26 Jul 2019 19:16:02 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QJG297001816; Fri, 26 Jul 2019 19:16:02 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201907261916.x6QJG297001816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 26 Jul 2019 19:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350364 - in head/sys/dev/virtio: mmio pci X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys/dev/virtio: mmio pci X-SVN-Commit-Revision: 350364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C88B876E75 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.967,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, 26 Jul 2019 19:16:03 -0000 Author: kp Date: Fri Jul 26 19:16:02 2019 New Revision: 350364 URL: https://svnweb.freebsd.org/changeset/base/350364 Log: virtio: Fix running on machines with memory above 0xffffffff We want to allocate a contiguous memory block anywhere in memory, but expressed this as having to be between 0 and 0xffffffff. This limits us on 64-bit machines, and outright breaks on machines where memory is mapped above that address range. Allow the full address range to be used for this allocation. Sponsored by: Axiado Modified: head/sys/dev/virtio/mmio/virtio_mmio.c head/sys/dev/virtio/pci/virtio_pci.c Modified: head/sys/dev/virtio/mmio/virtio_mmio.c ============================================================================== --- head/sys/dev/virtio/mmio/virtio_mmio.c Fri Jul 26 19:14:12 2019 (r350363) +++ head/sys/dev/virtio/mmio/virtio_mmio.c Fri Jul 26 19:16:02 2019 (r350364) @@ -440,7 +440,7 @@ vtmmio_alloc_virtqueues(device_t dev, int flags, int n size = vtmmio_read_config_4(sc, VIRTIO_MMIO_QUEUE_NUM_MAX); error = virtqueue_alloc(dev, idx, size, - VIRTIO_MMIO_VRING_ALIGN, 0xFFFFFFFFUL, info, &vq); + VIRTIO_MMIO_VRING_ALIGN, ~(vm_paddr_t)0, info, &vq); if (error) { device_printf(dev, "cannot allocate virtqueue %d: %d\n", Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Fri Jul 26 19:14:12 2019 (r350363) +++ head/sys/dev/virtio/pci/virtio_pci.c Fri Jul 26 19:16:02 2019 (r350364) @@ -505,7 +505,7 @@ vtpci_alloc_virtqueues(device_t dev, int flags, int nv size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); error = virtqueue_alloc(dev, idx, size, VIRTIO_PCI_VRING_ALIGN, - 0xFFFFFFFFUL, info, &vq); + ~(vm_paddr_t)0, info, &vq); if (error) { device_printf(dev, "cannot allocate virtqueue %d: %d\n", idx, error); From owner-svn-src-all@freebsd.org Fri Jul 26 19:35: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 68F77A7EA4; Fri, 26 Jul 2019 19:35:35 +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 57B7177BD8; Fri, 26 Jul 2019 19:35:35 +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 2FDB91BEAD; Fri, 26 Jul 2019 19:35:35 +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 x6QJZZf9013373; Fri, 26 Jul 2019 19:35:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QJZXfn013366; Fri, 26 Jul 2019 19:35:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907261935.x6QJZXfn013366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 26 Jul 2019 19:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350365 - in stable/12/sys: amd64/amd64 amd64/include sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 amd64/include sys X-SVN-Commit-Revision: 350365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 57B7177BD8 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.953,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, 26 Jul 2019 19:35:35 -0000 Author: kib Date: Fri Jul 26 19:35:33 2019 New Revision: 350365 URL: https://svnweb.freebsd.org/changeset/base/350365 Log: MFC r347695, r347696, r347697, r347957, r349326: Lockless delayed invalidation for amd64 pmap. Modified: stable/12/sys/amd64/amd64/machdep.c stable/12/sys/amd64/amd64/pmap.c stable/12/sys/amd64/amd64/trap.c stable/12/sys/amd64/amd64/vm_machdep.c stable/12/sys/amd64/include/pmap.h stable/12/sys/amd64/include/proc.h stable/12/sys/sys/proc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Fri Jul 26 19:16:02 2019 (r350364) +++ stable/12/sys/amd64/amd64/machdep.c Fri Jul 26 19:35:33 2019 (r350365) @@ -1618,6 +1618,13 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) physfree += kstack0_sz; /* + * Initialize enough of thread0 for delayed invalidation to + * work very early. Rely on thread0.td_base_pri + * zero-initialization, it is reset to PVM at proc0_init(). + */ + pmap_thread_init_invl_gen(&thread0); + + /* * make gdt memory segments */ for (x = 0; x < NGDT; x++) { Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Fri Jul 26 19:16:02 2019 (r350364) +++ stable/12/sys/amd64/amd64/pmap.c Fri Jul 26 19:35:33 2019 (r350365) @@ -107,6 +107,7 @@ __FBSDID("$FreeBSD$"); * and to when physical maps must be made correct. */ +#include "opt_ddb.h" #include "opt_pmap.h" #include "opt_vm.h" @@ -130,6 +131,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef DDB +#include +#include +#endif #include #include @@ -475,22 +480,100 @@ SYSCTL_PROC(_vm_pmap, OID_AUTO, pcid_save_cnt, CTLTYPE static LIST_HEAD(, pmap_invl_gen) pmap_invl_gen_tracker = LIST_HEAD_INITIALIZER(&pmap_invl_gen_tracker); static struct mtx invl_gen_mtx; -static u_long pmap_invl_gen = 0; /* Fake lock object to satisfy turnstiles interface. */ static struct lock_object invl_gen_ts = { .lo_name = "invlts", }; +static struct pmap_invl_gen pmap_invl_gen_head = { + .gen = 1, + .next = NULL, +}; +static u_long pmap_invl_gen = 1; +static int pmap_invl_waiters; +static struct callout pmap_invl_callout; +static bool pmap_invl_callout_inited; +#define PMAP_ASSERT_NOT_IN_DI() \ + KASSERT(pmap_not_in_di(), ("DI already started")) + static bool -pmap_not_in_di(void) +pmap_di_locked(void) { + int tun; - return (curthread->td_md.md_invl_gen.gen == 0); + if ((cpu_feature2 & CPUID2_CX16) == 0) + return (true); + tun = 0; + TUNABLE_INT_FETCH("vm.pmap.di_locked", &tun); + return (tun != 0); } -#define PMAP_ASSERT_NOT_IN_DI() \ - KASSERT(pmap_not_in_di(), ("DI already started")) +static int +sysctl_pmap_di_locked(SYSCTL_HANDLER_ARGS) +{ + int locked; + locked = pmap_di_locked(); + return (sysctl_handle_int(oidp, &locked, 0, req)); +} +SYSCTL_PROC(_vm_pmap, OID_AUTO, di_locked, CTLTYPE_INT | CTLFLAG_RDTUN | + CTLFLAG_MPSAFE, 0, 0, sysctl_pmap_di_locked, "", + "Locked delayed invalidation"); + +static bool pmap_not_in_di_l(void); +static bool pmap_not_in_di_u(void); +DEFINE_IFUNC(, bool, pmap_not_in_di, (void), static) +{ + + return (pmap_di_locked() ? pmap_not_in_di_l : pmap_not_in_di_u); +} + +static bool +pmap_not_in_di_l(void) +{ + struct pmap_invl_gen *invl_gen; + + invl_gen = &curthread->td_md.md_invl_gen; + return (invl_gen->gen == 0); +} + +static void +pmap_thread_init_invl_gen_l(struct thread *td) +{ + struct pmap_invl_gen *invl_gen; + + invl_gen = &td->td_md.md_invl_gen; + invl_gen->gen = 0; +} + +static void +pmap_delayed_invl_wait_block(u_long *m_gen, u_long *invl_gen) +{ + struct turnstile *ts; + + ts = turnstile_trywait(&invl_gen_ts); + if (*m_gen > atomic_load_long(invl_gen)) + turnstile_wait(ts, NULL, TS_SHARED_QUEUE); + else + turnstile_cancel(ts); +} + +static void +pmap_delayed_invl_finish_unblock(u_long new_gen) +{ + struct turnstile *ts; + + turnstile_chain_lock(&invl_gen_ts); + ts = turnstile_lookup(&invl_gen_ts); + if (new_gen != 0) + pmap_invl_gen = new_gen; + if (ts != NULL) { + turnstile_broadcast(ts, TS_SHARED_QUEUE); + turnstile_unpend(ts); + } + turnstile_chain_unlock(&invl_gen_ts); +} + /* * Start a new Delayed Invalidation (DI) block of code, executed by * the current thread. Within a DI block, the current thread may @@ -500,7 +583,7 @@ pmap_not_in_di(void) * pmap active. */ static void -pmap_delayed_invl_started(void) +pmap_delayed_invl_start_l(void) { struct pmap_invl_gen *invl_gen; u_long currgen; @@ -532,36 +615,311 @@ pmap_delayed_invl_started(void) * current thread's DI. */ static void -pmap_delayed_invl_finished(void) +pmap_delayed_invl_finish_l(void) { struct pmap_invl_gen *invl_gen, *next; - struct turnstile *ts; invl_gen = &curthread->td_md.md_invl_gen; - KASSERT(invl_gen->gen != 0, ("missed invl_started")); + KASSERT(invl_gen->gen != 0, ("missed invl_start")); mtx_lock(&invl_gen_mtx); next = LIST_NEXT(invl_gen, link); - if (next == NULL) { - turnstile_chain_lock(&invl_gen_ts); - ts = turnstile_lookup(&invl_gen_ts); - pmap_invl_gen = invl_gen->gen; - if (ts != NULL) { - turnstile_broadcast(ts, TS_SHARED_QUEUE); - turnstile_unpend(ts); - } - turnstile_chain_unlock(&invl_gen_ts); - } else { + if (next == NULL) + pmap_delayed_invl_finish_unblock(invl_gen->gen); + else next->gen = invl_gen->gen; - } LIST_REMOVE(invl_gen, link); mtx_unlock(&invl_gen_mtx); invl_gen->gen = 0; } +static bool +pmap_not_in_di_u(void) +{ + struct pmap_invl_gen *invl_gen; + + invl_gen = &curthread->td_md.md_invl_gen; + return (((uintptr_t)invl_gen->next & PMAP_INVL_GEN_NEXT_INVALID) != 0); +} + +static void +pmap_thread_init_invl_gen_u(struct thread *td) +{ + struct pmap_invl_gen *invl_gen; + + invl_gen = &td->td_md.md_invl_gen; + invl_gen->gen = 0; + invl_gen->next = (void *)PMAP_INVL_GEN_NEXT_INVALID; +} + +static bool +pmap_di_load_invl(struct pmap_invl_gen *ptr, struct pmap_invl_gen *out) +{ + uint64_t new_high, new_low, old_high, old_low; + char res; + + old_low = new_low = 0; + old_high = new_high = (uintptr_t)0; + + __asm volatile("lock;cmpxchg16b\t%1;sete\t%0" + : "=r" (res), "+m" (*ptr), "+a" (old_low), "+d" (old_high) + : "b"(new_low), "c" (new_high) + : "memory", "cc"); + if (res == 0) { + if ((old_high & PMAP_INVL_GEN_NEXT_INVALID) != 0) + return (false); + out->gen = old_low; + out->next = (void *)old_high; + } else { + out->gen = new_low; + out->next = (void *)new_high; + } + return (true); +} + +static bool +pmap_di_store_invl(struct pmap_invl_gen *ptr, struct pmap_invl_gen *old_val, + struct pmap_invl_gen *new_val) +{ + uint64_t new_high, new_low, old_high, old_low; + char res; + + new_low = new_val->gen; + new_high = (uintptr_t)new_val->next; + old_low = old_val->gen; + old_high = (uintptr_t)old_val->next; + + __asm volatile("lock;cmpxchg16b\t%1;sete\t%0" + : "=r" (res), "+m" (*ptr), "+a" (old_low), "+d" (old_high) + : "b"(new_low), "c" (new_high) + : "memory", "cc"); + return (res); +} + #ifdef PV_STATS +static long invl_start_restart; +SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_start_restart, CTLFLAG_RD, + &invl_start_restart, 0, + ""); +static long invl_finish_restart; +SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_finish_restart, CTLFLAG_RD, + &invl_finish_restart, 0, + ""); +static int invl_max_qlen; +SYSCTL_INT(_vm_pmap, OID_AUTO, invl_max_qlen, CTLFLAG_RD, + &invl_max_qlen, 0, + ""); +#endif + +static struct lock_delay_config __read_frequently di_delay; +LOCK_DELAY_SYSINIT_DEFAULT(di_delay); + +static void +pmap_delayed_invl_start_u(void) +{ + struct pmap_invl_gen *invl_gen, *p, prev, new_prev; + struct thread *td; + struct lock_delay_arg lda; + uintptr_t prevl; + u_char pri; +#ifdef PV_STATS + int i, ii; +#endif + + td = curthread; + invl_gen = &td->td_md.md_invl_gen; + PMAP_ASSERT_NOT_IN_DI(); + lock_delay_arg_init(&lda, &di_delay); + invl_gen->saved_pri = 0; + pri = td->td_base_pri; + if (pri > PVM) { + thread_lock(td); + pri = td->td_base_pri; + if (pri > PVM) { + invl_gen->saved_pri = pri; + sched_prio(td, PVM); + } + thread_unlock(td); + } +again: + PV_STAT(i = 0); + for (p = &pmap_invl_gen_head;; p = prev.next) { + PV_STAT(i++); + prevl = atomic_load_ptr(&p->next); + if ((prevl & PMAP_INVL_GEN_NEXT_INVALID) != 0) { + PV_STAT(atomic_add_long(&invl_start_restart, 1)); + lock_delay(&lda); + goto again; + } + if (prevl == 0) + break; + prev.next = (void *)prevl; + } +#ifdef PV_STATS + if ((ii = invl_max_qlen) < i) + atomic_cmpset_int(&invl_max_qlen, ii, i); +#endif + + if (!pmap_di_load_invl(p, &prev) || prev.next != NULL) { + PV_STAT(atomic_add_long(&invl_start_restart, 1)); + lock_delay(&lda); + goto again; + } + + new_prev.gen = prev.gen; + new_prev.next = invl_gen; + invl_gen->gen = prev.gen + 1; + + /* Formal fence between store to invl->gen and updating *p. */ + atomic_thread_fence_rel(); + + /* + * After inserting an invl_gen element with invalid bit set, + * this thread blocks any other thread trying to enter the + * delayed invalidation block. Do not allow to remove us from + * the CPU, because it causes starvation for other threads. + */ + critical_enter(); + + /* + * ABA for *p is not possible there, since p->gen can only + * increase. So if the *p thread finished its di, then + * started a new one and got inserted into the list at the + * same place, its gen will appear greater than the previously + * read gen. + */ + if (!pmap_di_store_invl(p, &prev, &new_prev)) { + critical_exit(); + PV_STAT(atomic_add_long(&invl_start_restart, 1)); + lock_delay(&lda); + goto again; + } + + /* + * There we clear PMAP_INVL_GEN_NEXT_INVALID in + * invl_gen->next, allowing other threads to iterate past us. + * pmap_di_store_invl() provides fence between the generation + * write and the update of next. + */ + invl_gen->next = NULL; + critical_exit(); +} + +static bool +pmap_delayed_invl_finish_u_crit(struct pmap_invl_gen *invl_gen, + struct pmap_invl_gen *p) +{ + struct pmap_invl_gen prev, new_prev; + u_long mygen; + + /* + * Load invl_gen->gen after setting invl_gen->next + * PMAP_INVL_GEN_NEXT_INVALID. This prevents larger + * generations to propagate to our invl_gen->gen. Lock prefix + * in atomic_set_ptr() worked as seq_cst fence. + */ + mygen = atomic_load_long(&invl_gen->gen); + + if (!pmap_di_load_invl(p, &prev) || prev.next != invl_gen) + return (false); + + KASSERT(prev.gen < mygen, + ("invalid di gen sequence %lu %lu", prev.gen, mygen)); + new_prev.gen = mygen; + new_prev.next = (void *)((uintptr_t)invl_gen->next & + ~PMAP_INVL_GEN_NEXT_INVALID); + + /* Formal fence between load of prev and storing update to it. */ + atomic_thread_fence_rel(); + + return (pmap_di_store_invl(p, &prev, &new_prev)); +} + +static void +pmap_delayed_invl_finish_u(void) +{ + struct pmap_invl_gen *invl_gen, *p; + struct thread *td; + struct lock_delay_arg lda; + uintptr_t prevl; + + td = curthread; + invl_gen = &td->td_md.md_invl_gen; + KASSERT(invl_gen->gen != 0, ("missed invl_start: gen 0")); + KASSERT(((uintptr_t)invl_gen->next & PMAP_INVL_GEN_NEXT_INVALID) == 0, + ("missed invl_start: INVALID")); + lock_delay_arg_init(&lda, &di_delay); + +again: + for (p = &pmap_invl_gen_head; p != NULL; p = (void *)prevl) { + prevl = atomic_load_ptr(&p->next); + if ((prevl & PMAP_INVL_GEN_NEXT_INVALID) != 0) { + PV_STAT(atomic_add_long(&invl_finish_restart, 1)); + lock_delay(&lda); + goto again; + } + if ((void *)prevl == invl_gen) + break; + } + + /* + * It is legitimate to not find ourself on the list if a + * thread before us finished its DI and started it again. + */ + if (__predict_false(p == NULL)) { + PV_STAT(atomic_add_long(&invl_finish_restart, 1)); + lock_delay(&lda); + goto again; + } + + critical_enter(); + atomic_set_ptr((uintptr_t *)&invl_gen->next, + PMAP_INVL_GEN_NEXT_INVALID); + if (!pmap_delayed_invl_finish_u_crit(invl_gen, p)) { + atomic_clear_ptr((uintptr_t *)&invl_gen->next, + PMAP_INVL_GEN_NEXT_INVALID); + critical_exit(); + PV_STAT(atomic_add_long(&invl_finish_restart, 1)); + lock_delay(&lda); + goto again; + } + critical_exit(); + if (atomic_load_int(&pmap_invl_waiters) > 0) + pmap_delayed_invl_finish_unblock(0); + if (invl_gen->saved_pri != 0) { + thread_lock(td); + sched_prio(td, invl_gen->saved_pri); + thread_unlock(td); + } +} + +#ifdef DDB +DB_SHOW_COMMAND(di_queue, pmap_di_queue) +{ + struct pmap_invl_gen *p, *pn; + struct thread *td; + uintptr_t nextl; + bool first; + + for (p = &pmap_invl_gen_head, first = true; p != NULL; p = pn, + first = false) { + nextl = atomic_load_ptr(&p->next); + pn = (void *)(nextl & ~PMAP_INVL_GEN_NEXT_INVALID); + td = first ? NULL : __containerof(p, struct thread, + td_md.md_invl_gen); + db_printf("gen %lu inv %d td %p tid %d\n", p->gen, + (nextl & PMAP_INVL_GEN_NEXT_INVALID) != 0, td, + td != NULL ? td->td_tid : -1); + } +} +#endif + +#ifdef PV_STATS static long invl_wait; SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_wait, CTLFLAG_RD, &invl_wait, 0, "Number of times DI invalidation blocked pmap_remove_all/write"); +static long invl_wait_slow; +SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_wait_slow, CTLFLAG_RD, &invl_wait_slow, 0, + "Number of slow invalidation waits for lockless DI"); #endif static u_long * @@ -571,6 +929,27 @@ pmap_delayed_invl_genp(vm_page_t m) return (&pv_invl_gen[pa_index(VM_PAGE_TO_PHYS(m)) % NPV_LIST_LOCKS]); } +static void +pmap_delayed_invl_callout_func(void *arg __unused) +{ + + if (atomic_load_int(&pmap_invl_waiters) == 0) + return; + pmap_delayed_invl_finish_unblock(0); +} + +static void +pmap_delayed_invl_callout_init(void *arg __unused) +{ + + if (pmap_di_locked()) + return; + callout_init(&pmap_invl_callout, 1); + pmap_invl_callout_inited = true; +} +SYSINIT(pmap_di_callout, SI_SUB_CPU + 1, SI_ORDER_ANY, + pmap_delayed_invl_callout_init, NULL); + /* * Ensure that all currently executing DI blocks, that need to flush * TLB for the given page m, actually flushed the TLB at the time the @@ -586,9 +965,8 @@ pmap_delayed_invl_genp(vm_page_t m) * processor. */ static void -pmap_delayed_invl_wait(vm_page_t m) +pmap_delayed_invl_wait_l(vm_page_t m) { - struct turnstile *ts; u_long *m_gen; #ifdef PV_STATS bool accounted = false; @@ -602,14 +980,92 @@ pmap_delayed_invl_wait(vm_page_t m) accounted = true; } #endif - ts = turnstile_trywait(&invl_gen_ts); - if (*m_gen > pmap_invl_gen) - turnstile_wait(ts, NULL, TS_SHARED_QUEUE); - else - turnstile_cancel(ts); + pmap_delayed_invl_wait_block(m_gen, &pmap_invl_gen); } } +static void +pmap_delayed_invl_wait_u(vm_page_t m) +{ + u_long *m_gen; + struct lock_delay_arg lda; + bool fast; + + fast = true; + m_gen = pmap_delayed_invl_genp(m); + lock_delay_arg_init(&lda, &di_delay); + while (*m_gen > atomic_load_long(&pmap_invl_gen_head.gen)) { + if (fast || !pmap_invl_callout_inited) { + PV_STAT(atomic_add_long(&invl_wait, 1)); + lock_delay(&lda); + fast = false; + } else { + /* + * The page's invalidation generation number + * is still below the current thread's number. + * Prepare to block so that we do not waste + * CPU cycles or worse, suffer livelock. + * + * Since it is impossible to block without + * racing with pmap_delayed_invl_finish_u(), + * prepare for the race by incrementing + * pmap_invl_waiters and arming a 1-tick + * callout which will unblock us if we lose + * the race. + */ + atomic_add_int(&pmap_invl_waiters, 1); + + /* + * Re-check the current thread's invalidation + * generation after incrementing + * pmap_invl_waiters, so that there is no race + * with pmap_delayed_invl_finish_u() setting + * the page generation and checking + * pmap_invl_waiters. The only race allowed + * is for a missed unblock, which is handled + * by the callout. + */ + if (*m_gen > + atomic_load_long(&pmap_invl_gen_head.gen)) { + callout_reset(&pmap_invl_callout, 1, + pmap_delayed_invl_callout_func, NULL); + PV_STAT(atomic_add_long(&invl_wait_slow, 1)); + pmap_delayed_invl_wait_block(m_gen, + &pmap_invl_gen_head.gen); + } + atomic_add_int(&pmap_invl_waiters, -1); + } + } +} + +DEFINE_IFUNC(, void, pmap_thread_init_invl_gen, (struct thread *), static) +{ + + return (pmap_di_locked() ? pmap_thread_init_invl_gen_l : + pmap_thread_init_invl_gen_u); +} + +DEFINE_IFUNC(static, void, pmap_delayed_invl_start, (void), static) +{ + + return (pmap_di_locked() ? pmap_delayed_invl_start_l : + pmap_delayed_invl_start_u); +} + +DEFINE_IFUNC(static, void, pmap_delayed_invl_finish, (void), static) +{ + + return (pmap_di_locked() ? pmap_delayed_invl_finish_l : + pmap_delayed_invl_finish_u); +} + +DEFINE_IFUNC(static, void, pmap_delayed_invl_wait, (vm_page_t), static) +{ + + return (pmap_di_locked() ? pmap_delayed_invl_wait_l : + pmap_delayed_invl_wait_u); +} + /* * Mark the page m's PV list as participating in the current thread's * DI block. Any threads concurrently using m's PV list to remove or @@ -619,7 +1075,7 @@ pmap_delayed_invl_wait(vm_page_t m) * The function works by setting the DI generation number for m's PV * list to at least the DI generation number of the current thread. * This forces a caller of pmap_delayed_invl_wait() to block until - * current thread calls pmap_delayed_invl_finished(). + * current thread calls pmap_delayed_invl_finish(). */ static void pmap_delayed_invl_page(vm_page_t m) @@ -2869,6 +3325,7 @@ void pmap_pinit0(pmap_t pmap) { struct proc *p; + struct thread *td; int i; PMAP_LOCK_INIT(pmap); @@ -2887,12 +3344,14 @@ pmap_pinit0(pmap_t pmap) pmap->pm_pcids[i].pm_gen = 1; } pmap_activate_boot(pmap); + td = curthread; if (pti) { - p = curproc; + p = td->td_proc; PROC_LOCK(p); p->p_amd64_md_flags |= P_MD_KPTI; PROC_UNLOCK(p); } + pmap_thread_init_invl_gen(td); if ((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) { pmap_pkru_ranges_zone = uma_zcreate("pkru ranges", @@ -3450,7 +3909,7 @@ reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked if (pmap != locked_pmap) PMAP_UNLOCK(pmap); if (start_di) - pmap_delayed_invl_finished(); + pmap_delayed_invl_finish(); } /* @@ -3533,13 +3992,13 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l RELEASE_PV_LIST_LOCK(lockp); PMAP_LOCK(pmap); if (start_di) - pmap_delayed_invl_started(); + pmap_delayed_invl_start(); mtx_lock(&pv_chunks_mutex); continue; } else if (pmap != locked_pmap) { if (PMAP_TRYLOCK(pmap)) { if (start_di) - pmap_delayed_invl_started(); + pmap_delayed_invl_start(); mtx_lock(&pv_chunks_mutex); continue; } else { @@ -3552,7 +4011,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l goto next_chunk; } } else if (start_di) - pmap_delayed_invl_started(); + pmap_delayed_invl_start(); PG_G = pmap_global_bit(pmap); PG_A = pmap_accessed_bit(pmap); PG_M = pmap_modified_bit(pmap); @@ -4531,7 +4990,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t anyvalid = 0; SLIST_INIT(&free); - pmap_delayed_invl_started(); + pmap_delayed_invl_start(); PMAP_LOCK(pmap); pmap_pkru_on_remove(pmap, sva, eva); @@ -4628,7 +5087,7 @@ out: if (anyvalid) pmap_invalidate_all(pmap); PMAP_UNLOCK(pmap); - pmap_delayed_invl_finished(); + pmap_delayed_invl_finish(); vm_page_free_pages_toq(&free, true); } @@ -4812,8 +5271,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t /* * Although this function delays and batches the invalidation * of stale TLB entries, it does not need to call - * pmap_delayed_invl_started() and - * pmap_delayed_invl_finished(), because it does not + * pmap_delayed_invl_start() and + * pmap_delayed_invl_finish(), because it does not * ordinarily destroy mappings. Stale TLB entries from * protection-only changes need only be invalidated before the * pmap lock is released, because protection-only changes do @@ -5440,11 +5899,11 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t if ((oldpde & PG_G) == 0) pmap_invalidate_pde_page(pmap, va, oldpde); } else { - pmap_delayed_invl_started(); + pmap_delayed_invl_start(); if (pmap_remove_ptes(pmap, va, va + NBPDR, pde, &free, lockp)) pmap_invalidate_all(pmap); - pmap_delayed_invl_finished(); + pmap_delayed_invl_finish(); } vm_page_free_pages_toq(&free, true); if (va >= VM_MAXUSER_ADDRESS) { @@ -5800,7 +6259,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_ * The wired attribute of the page table entry is not a hardware * feature, so there is no need to invalidate any TLB entries. * Since pmap_demote_pde() for the wired entry must never fail, - * pmap_delayed_invl_started()/finished() calls around the + * pmap_delayed_invl_start()/finish() calls around the * function are not needed. */ void @@ -6299,8 +6758,8 @@ pmap_page_is_mapped(vm_page_t m) * * Although this function destroys all of the pmap's managed, * non-wired mappings, it can delay and batch the invalidation of TLB - * entries without calling pmap_delayed_invl_started() and - * pmap_delayed_invl_finished(). Because the pmap is not active on + * entries without calling pmap_delayed_invl_start() and + * pmap_delayed_invl_finish(). Because the pmap is not active on * any other processor, none of these TLB entries will ever be used * before their eventual invalidation. Consequently, there is no need * for either pmap_remove_all() or pmap_remove_write() to wait for @@ -7005,7 +7464,7 @@ pmap_advise(pmap_t pmap, vm_offset_t sva, vm_offset_t PG_V = pmap_valid_bit(pmap); PG_RW = pmap_rw_bit(pmap); anychanged = FALSE; - pmap_delayed_invl_started(); + pmap_delayed_invl_start(); PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { pml4e = pmap_pml4e(pmap, sva); @@ -7102,7 +7561,7 @@ maybe_invlrng: if (anychanged) pmap_invalidate_all(pmap); PMAP_UNLOCK(pmap); - pmap_delayed_invl_finished(); + pmap_delayed_invl_finish(); } /* @@ -9433,11 +9892,7 @@ pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, vm_offse return (error); } -#include "opt_ddb.h" #ifdef DDB -#include -#include - DB_SHOW_COMMAND(pte, pmap_print_pte) { pmap_t pmap; Modified: stable/12/sys/amd64/amd64/trap.c ============================================================================== --- stable/12/sys/amd64/amd64/trap.c Fri Jul 26 19:16:02 2019 (r350364) +++ stable/12/sys/amd64/amd64/trap.c Fri Jul 26 19:35:33 2019 (r350365) @@ -1203,7 +1203,7 @@ amd64_syscall(struct thread *td, int traced) KASSERT(td->td_pcb->pcb_save == get_pcb_user_save_td(td), ("System call %s returning with mangled pcb_save", syscallname(td->td_proc, td->td_sa.code))); - KASSERT(td->td_md.md_invl_gen.gen == 0, + KASSERT(pmap_not_in_di(), ("System call %s returning with leaked invl_gen %lu", syscallname(td->td_proc, td->td_sa.code), td->td_md.md_invl_gen.gen)); Modified: stable/12/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/vm_machdep.c Fri Jul 26 19:16:02 2019 (r350364) +++ stable/12/sys/amd64/amd64/vm_machdep.c Fri Jul 26 19:35:33 2019 (r350365) @@ -229,7 +229,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I; - td2->td_md.md_invl_gen.gen = 0; + pmap_thread_init_invl_gen(td2); /* As an i386, do not copy io permission bitmap. */ pcb2->pcb_tssp = NULL; @@ -545,6 +545,7 @@ cpu_copy_thread(struct thread *td, struct thread *td0) /* Setup to release spin count in fork_exit(). */ td->td_md.md_spinlock_count = 1; td->td_md.md_saved_flags = PSL_KERNEL | PSL_I; + pmap_thread_init_invl_gen(td); } /* Modified: stable/12/sys/amd64/include/pmap.h ============================================================================== --- stable/12/sys/amd64/include/pmap.h Fri Jul 26 19:16:02 2019 (r350364) +++ stable/12/sys/amd64/include/pmap.h Fri Jul 26 19:35:33 2019 (r350365) @@ -442,6 +442,7 @@ void *pmap_mapbios(vm_paddr_t, vm_size_t); void *pmap_mapdev(vm_paddr_t, vm_size_t); void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); void *pmap_mapdev_pciecfg(vm_paddr_t pa, vm_size_t size); +bool pmap_not_in_di(void); boolean_t pmap_page_is_mapped(vm_page_t m); void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma); void pmap_pinit_pml4(vm_page_t); @@ -466,6 +467,7 @@ void pmap_pti_pcid_invlrng(uint64_t ucr3, uint64_t kcr int pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); int pmap_pkru_set(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, u_int keyidx, int flags); +void pmap_thread_init_invl_gen(struct thread *td); int pmap_vmspace_copy(pmap_t dst_pmap, pmap_t src_pmap); #endif /* _KERNEL */ Modified: stable/12/sys/amd64/include/proc.h ============================================================================== --- stable/12/sys/amd64/include/proc.h Fri Jul 26 19:16:02 2019 (r350364) +++ stable/12/sys/amd64/include/proc.h Fri Jul 26 19:35:33 2019 (r350365) @@ -50,10 +50,17 @@ struct proc_ldt { int ldt_refcnt; }; +#define PMAP_INVL_GEN_NEXT_INVALID 0x1ULL struct pmap_invl_gen { u_long gen; /* (k) */ - LIST_ENTRY(pmap_invl_gen) link; /* (pp) */ -}; + union { + LIST_ENTRY(pmap_invl_gen) link; /* (pp) */ + struct { + struct pmap_invl_gen *next; + u_char saved_pri; + }; + }; +} __aligned(16); /* * Machine-dependent part of the proc structure for AMD64. Modified: stable/12/sys/sys/proc.h ============================================================================== --- stable/12/sys/sys/proc.h Fri Jul 26 19:16:02 2019 (r350364) +++ stable/12/sys/sys/proc.h Fri Jul 26 19:35:33 2019 (r350365) @@ -343,7 +343,11 @@ struct thread { vm_offset_t td_kstack; /* (a) Kernel VA of kstack. */ int td_kstack_pages; /* (a) Size of the kstack. */ volatile u_int td_critnest; /* (k*) Critical section nest level. */ +#ifdef __amd64__ + uint32_t td_md_pad0[16]; +#else struct mdthread td_md; /* (k) Any machine-dependent fields. */ +#endif 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. */ @@ -361,6 +365,9 @@ struct thread { int td_oncpu; /* (t) Which cpu we are on. */ void *td_lkpi_task; /* LinuxKPI task struct pointer */ int td_pmcpend; +#ifdef __amd64__ + struct mdthread td_md; /* (k) Any machine-dependent fields. */ +#endif }; struct thread0_storage { From owner-svn-src-all@freebsd.org Fri Jul 26 21:08: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 6E065A9670; Fri, 26 Jul 2019 21:08:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 4EB0C82FEC; Fri, 26 Jul 2019 21:08:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19CC11CEB6; Fri, 26 Jul 2019 21:08:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6QL81p3048848; Fri, 26 Jul 2019 21:08:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6QL815X048847; Fri, 26 Jul 2019 21:08:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201907262108.x6QL815X048847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 26 Jul 2019 21:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350366 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 350366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EB0C82FEC 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]; 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, 26 Jul 2019 21:08:02 -0000 Author: pfg Date: Fri Jul 26 21:08:01 2019 New Revision: 350366 URL: https://svnweb.freebsd.org/changeset/base/350366 Log: MFC r349802 (from fsu@): Add additional check for 'blocks per group' and 'fragments per group' superblock fields. These fields will not be equal only in case if bigalloc filesystem feature is turned on. This feature is not supported for now. Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE Reported as: FS-27-EXT2-12: Denial of Service in openat-0 (vm_fault_hold/ext2_clusteracct) Modified: stable/12/sys/fs/ext2fs/ext2_vfsops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_vfsops.c Fri Jul 26 19:35:33 2019 (r350365) +++ stable/12/sys/fs/ext2fs/ext2_vfsops.c Fri Jul 26 21:08:01 2019 (r350366) @@ -559,7 +559,12 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, "zero blocks/fragments per group"); return (EINVAL); + } else if (fs->e2fs_bpg != fs->e2fs_fpg) { + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "blocks per group not equal fragments per group"); + return (EINVAL); } + if (fs->e2fs_bpg != fs->e2fs_bsize * 8) { SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, "non-standard group size unsupported"); From owner-svn-src-all@freebsd.org Fri Jul 26 21:11: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 494D2A97A7; Fri, 26 Jul 2019 21:11:06 +0000 (UTC) (envelope-from pfg@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 ECEEF83245; Fri, 26 Jul 2019 21:11:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id 3A8781510D; Fri, 26 Jul 2019 21:11:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r349802 - head/sys/fs/ext2fs To: Ed Maste , Fedor Uporov Cc: src-committers , svn-src-all , svn-src-head References: <201907070858.x678w3go067222@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Message-ID: Date: Fri, 26 Jul 2019 16:11:04 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: ECEEF83245 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.971,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, 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, 26 Jul 2019 21:11:06 -0000 Hi; On 2019-07-24 08:21, Ed Maste wrote: > On Sun, 7 Jul 2019 at 04:58, Fedor Uporov wrote: >> Author: fsu >> Date: Sun Jul 7 08:58:02 2019 >> New Revision: 349802 >> URL: https://svnweb.freebsd.org/changeset/base/349802 >> >> Log: >> Add additional check for 'blocks per group' and 'fragments per group' superblock fields. > Will you MFC this to stable/12 and stable/11? > After light testing, I committed it to stable/12. stable/11 has diverged a lot (the patch doesn't apply cleanly) and since the patch is not critical, it don't think it is worth merging. Cheers, Pedro. From owner-svn-src-all@freebsd.org Fri Jul 26 21:56: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 86DA9AAA34; Fri, 26 Jul 2019 21:56:37 +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 E9CE884E22; Fri, 26 Jul 2019 21:56: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 x6QLuS1G025275 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 27 Jul 2019 00:56:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x6QLuS1G025275 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x6QLuSnG025274; Sat, 27 Jul 2019 00:56:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 27 Jul 2019 00:56:28 +0300 From: Konstantin Belousov To: Rick Macklem Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350315 - in head/sys: kern sys Message-ID: <20190726215628.GE2731@kib.kiev.ua> References: <201907250546.x6P5kHWq076756@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201907250546.x6P5kHWq076756@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: Fri, 26 Jul 2019 21:56:37 -0000 On Thu, Jul 25, 2019 at 05:46:17AM +0000, Rick Macklem wrote: > Author: rmacklem > Date: Thu Jul 25 05:46:16 2019 > New Revision: 350315 > URL: https://svnweb.freebsd.org/changeset/base/350315 > > Log: > Add kernel support for a Linux compatible copy_file_range(2) syscall. > Modified: head/sys/kern/syscalls.master > ============================================================================== > --- head/sys/kern/syscalls.master Thu Jul 25 03:55:05 2019 (r350314) > +++ head/sys/kern/syscalls.master Thu Jul 25 05:46:16 2019 (r350315) > @@ -3175,6 +3175,16 @@ > int flag > ); > } > +569 AUE_NULL STD { > + ssize_t copy_file_range( > + int infd, > + _Inout_opt_ off_t *inoffp, > + int outfd, > + _Inout_opt_ off_t *outoffp, > + size_t len, > + unsigned int flags > + ); > + } I sat to write the compat32 shims, and only then noted that len has size_t type. Why is it size_t and not off_t ? From owner-svn-src-all@freebsd.org Sat Jul 27 01:35: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 C5C7EADD5C; Sat, 27 Jul 2019 01:35:08 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670060.outbound.protection.outlook.com [40.107.67.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93C168B55F; Sat, 27 Jul 2019 01:35:08 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FguftwrYaHT8WsBfQwTIbchYd6JAUp/CsLo6YTOCCsxpg5Ru+9iTaOQfcNYf6qApmLeqrC+opprkGu4vJmYlgdnQ1YZtiPBZT2KTFToH/sNqPZq5mCOFdVU66Wl2mltI6ngUGg6y+XPPkqP1eEIOOMnnynliQwrQkb5Oilx0wbL6lG56wCAXkx90bafBFbWhFgvJrV0SQ+QZmVDtzqBlxKiQh86McQPLpJBgLWONUST0xo4mZUuzS7B81hn4aLEsjBC7PnBek3tQ4dfmdzxGiagsHq+YagM/qz+BbD5TcSsXb6hBNKlr17S9vb8TWCnB54hAQdBPtz04b/dE1o92Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gGbIl/w7eO6GiSVuDUdKXzwlVsh1pZSA0cUVeCKgnZo=; b=a2Jo4F+3I964P9pvaDjo02XQA4JhUnw8tUvIhzZu7VbxghCBUKdOj9sgmtviAw9MlPw9/SCMtWoBBUUNirz8uiXQkleqargOLdZjkZdfO5fSRAYYU29X3/wXtKutBQ5XXKpfaZUUnrjEdZpzKj+GpUFUvH2WQrLqovGfqtovhu5ZX/O3GZLMm+oTZ1Nxi8XpXUwXtBfuH7VbaLBDhrBYkAjYsnFoMrs1rLS/yX1UnyMb00vAB/AsQvfxEyGsKSn1OPUUyhyhL1ZB3Jt/QORfOgWMD8r36iPSzXyXTNollbrbXm/1tmRPt7D6KwAuHEqS2Y7fhLbxMLoMucx48WAHTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=uoguelph.ca;dmarc=pass action=none header.from=uoguelph.ca;dkim=pass header.d=uoguelph.ca;arc=none Received: from YTBPR01MB3312.CANPRD01.PROD.OUTLOOK.COM (10.255.13.158) by YTBPR01MB3486.CANPRD01.PROD.OUTLOOK.COM (10.255.47.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2115.10; Sat, 27 Jul 2019 01:35:06 +0000 Received: from YTBPR01MB3312.CANPRD01.PROD.OUTLOOK.COM ([fe80::70d6:627b:b391:3977]) by YTBPR01MB3312.CANPRD01.PROD.OUTLOOK.COM ([fe80::70d6:627b:b391:3977%7]) with mapi id 15.20.2115.005; Sat, 27 Jul 2019 01:35:06 +0000 From: Rick Macklem To: Konstantin Belousov , Rick Macklem CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r350315 - in head/sys: kern sys Thread-Topic: svn commit: r350315 - in head/sys: kern sys Thread-Index: AQHVQ/0DsB7s4Yi/T0Guwd+l7YYIgqbdrdDe Date: Sat, 27 Jul 2019 01:35:06 +0000 Message-ID: References: <201907250546.x6P5kHWq076756@repo.freebsd.org>, <20190726215628.GE2731@kib.kiev.ua> In-Reply-To: <20190726215628.GE2731@kib.kiev.ua> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f9acca05-368a-4118-0a42-08d71232a7a3 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:YTBPR01MB3486; x-ms-traffictypediagnostic: YTBPR01MB3486: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:913; x-forefront-prvs: 01110342A5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(366004)(396003)(39860400002)(189003)(199004)(305945005)(966005)(6246003)(6506007)(76116006)(52536014)(8936002)(316002)(66556008)(66446008)(5660300002)(14454004)(786003)(64756008)(66476007)(74316002)(66946007)(86362001)(229853002)(99286004)(6436002)(76176011)(7696005)(25786009)(256004)(33656002)(4326008)(9686003)(71200400001)(110136005)(53936002)(68736007)(81166006)(11346002)(54906003)(446003)(71190400001)(2906002)(81156014)(102836004)(186003)(6306002)(55016002)(478600001)(486006)(46003)(476003)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:YTBPR01MB3486; H:YTBPR01MB3312.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: jhtzy5dQY+74HE6W4dx6jWqK1D0N4GebcFQCMCD+HpdTQ+w9BtruxcUqCtCbjEsc91OxQ1V4drHtYCtVhnUrrDgUVT2o7Xo2YuRg4qApDgIStPMGHiEtExlAhNBJHiDW1+lriWzVKF7Q2mpa/0QSSQjrLL1gE+eauQsd9eqr100QfJCpji/HuO6a6DaB1ckC0HBv+sE/iuJ/OI1X2gup1PxFF0qHtZWDI97hXUwS+jdkdfsCkC4ACKBnDmX8i7QWHN1TWzw65rJxEIS+E7b7IS6U3DRf9S8EWJ/hdfcV6au9YNIZcAELUWAKUe30vvrXFJuKGLYIneLnp2pRfk4NgyNOQ9lgb+A5pufkRFGHpOvZaxlOfQ3jnTR7H+62BMAMS3dr8FP2Hz4/qXz6RPTLBERqfhCHaGmVAnsHQs+2NwQ= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: f9acca05-368a-4118-0a42-08d71232a7a3 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2019 01:35:06.5379 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rmacklem@uoguelph.ca X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTBPR01MB3486 X-Rspamd-Queue-Id: 93C168B55F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.89 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.89)[-0.894,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.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, 27 Jul 2019 01:35:08 -0000 Konstantin Belousov wrote: >On Thu, Jul 25, 2019 at 05:46:17AM +0000, Rick Macklem wrote: >> Author: rmacklem >> Date: Thu Jul 25 05:46:16 2019 >> New Revision: 350315 >> URL: https://svnweb.freebsd.org/changeset/base/350315 >> >> Log: >> Add kernel support for a Linux compatible copy_file_range(2) syscall. > >> Modified: head/sys/kern/syscalls.master >> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D>=3D=3D=3D= =3D=3D=3D=3D=3D=3D >> --- head/sys/kern/syscalls.master Thu Jul 25 03:55:05 2019 (r= 350314) >> +++ head/sys/kern/syscalls.master Thu Jul 25 05:46:16 2019 (r= 350315) >> @@ -3175,6 +3175,16 @@ >> int flag >> ); >> } >> +569 AUE_NULL STD { >> + ssize_t copy_file_range( >> + int infd, >> + _Inout_opt_ off_t *inoffp, >> + int outfd, >> + _Inout_opt_ off_t *outoffp, >> + size_t len, >> + unsigned int flags >> + ); >> + } > >I sat to write the compat32 shims, and only then noted that len has size_t >type. Why is it size_t and not off_t ? Well, that's what Linux did. Also, since it returns ssize_t, it can't do more than SSIZE_MAX (generally = 1/2 of SIZE_T_MAX). Returning ssize_t is also what Linux does and is consistent wi= th read(2)/write(2). rick From owner-svn-src-all@freebsd.org Sat Jul 27 01:52: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 4DE12AE51D; Sat, 27 Jul 2019 01:52:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 2FC6C8C131; Sat, 27 Jul 2019 01:52:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 082C420267; Sat, 27 Jul 2019 01:52:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6R1qYMT020083; Sat, 27 Jul 2019 01:52:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6R1qYo4020082; Sat, 27 Jul 2019 01:52:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201907270152.x6R1qYo4020082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 27 Jul 2019 01:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350367 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 350367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FC6C8C131 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.906,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, 27 Jul 2019 01:52:35 -0000 Author: rmacklem Date: Sat Jul 27 01:52:34 2019 New Revision: 350367 URL: https://svnweb.freebsd.org/changeset/base/350367 Log: Lock the vnode before calling ufs_bmap_seekdata(). r346932 replaced a call to vn_bmap_seekhole() with a call to ufs_bmap_seekdata(). Although vn_bmap_seekhole() locks the vnode, ufs_bmap_seekdata() assumes it is already locked. This patch adds locking of the vnode before the ufs_bmap_seekdata() call. If the vn_lock() call fails, it returns EBADF since that is the normal error returned when a file system is forced dismounted and is already listed as an error return in the lseek(2) man page. Discussed with: markj Reviewed by: kib Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Fri Jul 26 21:08:01 2019 (r350366) +++ head/sys/ufs/ufs/ufs_vnops.c Sat Jul 27 01:52:34 2019 (r350367) @@ -2702,11 +2702,18 @@ static int ufs_ioctl(struct vop_ioctl_args *ap) { struct vnode *vp; + int error; vp = ap->a_vp; switch (ap->a_command) { case FIOSEEKDATA: - return (ufs_bmap_seekdata(vp, (off_t *)ap->a_data)); + error = vn_lock(vp, LK_SHARED); + if (error == 0) { + error = ufs_bmap_seekdata(vp, (off_t *)ap->a_data); + VOP_UNLOCK(vp, 0); + } else + error = EBADF; + return (error); case FIOSEEKHOLE: return (vn_bmap_seekhole(vp, ap->a_command, (off_t *)ap->a_data, ap->a_cred)); From owner-svn-src-all@freebsd.org Sat Jul 27 09:36: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 DCF14B51AD; Sat, 27 Jul 2019 09:36:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 BF8BB73513; Sat, 27 Jul 2019 09:36:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90CF025566; Sat, 27 Jul 2019 09:36:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6R9aTiq093203; Sat, 27 Jul 2019 09:36:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6R9aRm5093194; Sat, 27 Jul 2019 09:36:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201907270936.x6R9aRm5093194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 27 Jul 2019 09:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350369 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 350369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF8BB73513 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,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, 27 Jul 2019 09:36:29 -0000 Author: arybchik Date: Sat Jul 27 09:36:27 2019 New Revision: 350369 URL: https://svnweb.freebsd.org/changeset/base/350369 Log: sfxge(4): fix power of 2 round up when align has smaller type Substitute driver-defined P2ROUNDUP() h with EFX_P2ROUNDUP() defined in libefx. Cast value and alignment to one specified type to guarantee result correctness. Reported by: Andrea Valsania Reviewed by: philip Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D21074 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/sfxge_port.c head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Jul 27 02:23:05 2019 (r350368) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Jul 27 09:36:27 2019 (r350369) @@ -1269,10 +1269,11 @@ efx_mcdi_set_nic_global( #define EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE 8 /* Minimum space for packet in packed stream mode */ -#define EFX_RX_PACKED_STREAM_MIN_PACKET_SPACE \ - P2ROUNDUP(EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE + \ - EFX_MAC_PDU_MIN + \ - EFX_RX_PACKED_STREAM_ALIGNMENT, \ +#define EFX_RX_PACKED_STREAM_MIN_PACKET_SPACE \ + EFX_P2ROUNDUP(size_t, \ + EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE + \ + EFX_MAC_PDU_MIN + \ + EFX_RX_PACKED_STREAM_ALIGNMENT, \ EFX_RX_PACKED_STREAM_ALIGNMENT) /* Maximum number of credits */ Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Sat Jul 27 02:23:05 2019 (r350368) +++ head/sys/dev/sfxge/common/ef10_nvram.c Sat Jul 27 09:36:27 2019 (r350369) @@ -394,7 +394,8 @@ tlv_write( if (len > 0) { ptr[(len - 1) / sizeof (uint32_t)] = 0; memcpy(ptr, data, len); - ptr += P2ROUNDUP(len, sizeof (uint32_t)) / sizeof (*ptr); + ptr += EFX_P2ROUNDUP(uint32_t, len, + sizeof (uint32_t)) / sizeof (*ptr); } return (ptr); Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Jul 27 02:23:05 2019 (r350368) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Jul 27 09:36:27 2019 (r350369) @@ -957,8 +957,9 @@ ef10_rx_qps_packet_info( *lengthp = EFX_QWORD_FIELD(*qwordp, ES_DZ_PS_RX_PREFIX_ORIG_LEN); buf_len = EFX_QWORD_FIELD(*qwordp, ES_DZ_PS_RX_PREFIX_CAP_LEN); - buf_len = P2ROUNDUP(buf_len + EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE, - EFX_RX_PACKED_STREAM_ALIGNMENT); + buf_len = EFX_P2ROUNDUP(uint16_t, + buf_len + EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE, + EFX_RX_PACKED_STREAM_ALIGNMENT); *next_offsetp = current_offset + buf_len + EFX_RX_PACKED_STREAM_ALIGNMENT; Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Sat Jul 27 02:23:05 2019 (r350368) +++ head/sys/dev/sfxge/common/efsys.h Sat Jul 27 09:36:27 2019 (r350369) @@ -88,10 +88,6 @@ extern "C" { #define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0) #endif -#ifndef P2ROUNDUP -#define P2ROUNDUP(x, align) (-(-(x) & -(align))) -#endif - #ifndef P2ALIGN #define P2ALIGN(_x, _a) ((_x) & -(_a)) #endif Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Jul 27 02:23:05 2019 (r350368) +++ head/sys/dev/sfxge/common/efx.h Sat Jul 27 09:36:27 2019 (r350369) @@ -56,6 +56,10 @@ extern "C" { /* The macro expands divider twice */ #define EFX_DIV_ROUND_UP(_n, _d) (((_n) + (_d) - 1) / (_d)) +/* Round value up to the nearest power of two. */ +#define EFX_P2ROUNDUP(_type, _value, _align) \ + (-(-(_type)(_value) & -(_type)(_align))) + /* Return codes */ typedef __success(return == 0) int efx_rc_t; @@ -522,10 +526,10 @@ typedef enum efx_link_mode_e { + /* bug16011 */ 16) \ #define EFX_MAC_PDU(_sdu) \ - P2ROUNDUP((_sdu) + EFX_MAC_PDU_ADJUSTMENT, 8) + EFX_P2ROUNDUP(size_t, (_sdu) + EFX_MAC_PDU_ADJUSTMENT, 8) /* - * Due to the P2ROUNDUP in EFX_MAC_PDU(), EFX_MAC_SDU_FROM_PDU() may give + * Due to the EFX_P2ROUNDUP in EFX_MAC_PDU(), EFX_MAC_SDU_FROM_PDU() may give * the SDU rounded up slightly. */ #define EFX_MAC_SDU_FROM_PDU(_pdu) ((_pdu) - EFX_MAC_PDU_ADJUSTMENT) @@ -611,8 +615,9 @@ efx_mac_stat_name( #define EFX_MAC_STATS_MASK_BITS_PER_PAGE (8 * sizeof (uint32_t)) -#define EFX_MAC_STATS_MASK_NPAGES \ - (P2ROUNDUP(EFX_MAC_NSTATS, EFX_MAC_STATS_MASK_BITS_PER_PAGE) / \ +#define EFX_MAC_STATS_MASK_NPAGES \ + (EFX_P2ROUNDUP(uint32_t, EFX_MAC_NSTATS, \ + EFX_MAC_STATS_MASK_BITS_PER_PAGE) / \ EFX_MAC_STATS_MASK_BITS_PER_PAGE) /* Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Sat Jul 27 02:23:05 2019 (r350368) +++ head/sys/dev/sfxge/common/efx_mcdi.h Sat Jul 27 09:36:27 2019 (r350369) @@ -412,6 +412,11 @@ efx_mcdi_phy_module_get_info( (((mask) & (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) == \ (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) +#define EFX_MCDI_BUF_SIZE(_in_len, _out_len) \ + EFX_P2ROUNDUP(size_t, \ + MAX(MAX(_in_len, _out_len), (2 * sizeof (efx_dword_t))),\ + sizeof (efx_dword_t)) + /* * The buffer size must be a multiple of dword to ensure that MCDI works * properly with Siena based boards (which use on-chip buffer). Also, it @@ -419,9 +424,7 @@ efx_mcdi_phy_module_get_info( * error responses if the request/response buffer sizes are smaller. */ #define EFX_MCDI_DECLARE_BUF(_name, _in_len, _out_len) \ - uint8_t _name[P2ROUNDUP(MAX(MAX(_in_len, _out_len), \ - (2 * sizeof (efx_dword_t))), \ - sizeof (efx_dword_t))] = {0} + uint8_t _name[EFX_MCDI_BUF_SIZE(_in_len, _out_len)] = {0} typedef enum efx_mcdi_feature_id_e { EFX_MCDI_FEATURE_FW_UPDATE = 0, Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Sat Jul 27 02:23:05 2019 (r350368) +++ head/sys/dev/sfxge/common/efx_tx.c Sat Jul 27 09:36:27 2019 (r350369) @@ -797,7 +797,7 @@ siena_tx_qpost( * Fragments must not span 4k boundaries. * Here it is a stricter requirement than the maximum length. */ - EFSYS_ASSERT(P2ROUNDUP(start + 1, + EFSYS_ASSERT(EFX_P2ROUNDUP(efsys_dma_addr_t, start + 1, etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= end); EFX_TX_DESC(etp, start, size, ebp->eb_eop, added); @@ -1067,7 +1067,7 @@ siena_tx_qdesc_dma_create( * Fragments must not span 4k boundaries. * Here it is a stricter requirement than the maximum length. */ - EFSYS_ASSERT(P2ROUNDUP(addr + 1, + EFSYS_ASSERT(EFX_P2ROUNDUP(efsys_dma_addr_t, addr + 1, etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= addr + size); EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index, Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Sat Jul 27 02:23:05 2019 (r350368) +++ head/sys/dev/sfxge/sfxge_port.c Sat Jul 27 09:36:27 2019 (r350369) @@ -798,7 +798,8 @@ sfxge_port_init(struct sfxge_softc *sc) port->mac_stats.decode_buf = malloc(EFX_MAC_NSTATS * sizeof(uint64_t), M_SFXGE, M_WAITOK | M_ZERO); mac_nstats = efx_nic_cfg_get(sc->enp)->enc_mac_stats_nstats; - mac_stats_size = P2ROUNDUP(mac_nstats * sizeof(uint64_t), EFX_BUF_SIZE); + mac_stats_size = EFX_P2ROUNDUP(size_t, mac_nstats * sizeof(uint64_t), + EFX_BUF_SIZE); if ((rc = sfxge_dma_alloc(sc, mac_stats_size, mac_stats_buf)) != 0) goto fail2; port->stats_update_period_ms = sfxge_port_stats_update_period_ms(sc); Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Sat Jul 27 02:23:05 2019 (r350368) +++ head/sys/dev/sfxge/sfxge_rx.c Sat Jul 27 09:36:27 2019 (r350369) @@ -273,7 +273,8 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, unsigned int tar /* m_len specifies length of area to be mapped for DMA */ m->m_len = mblksize; - m->m_data = (caddr_t)P2ROUNDUP((uintptr_t)m->m_data, CACHE_LINE_SIZE); + m->m_data = (caddr_t)EFX_P2ROUNDUP(uintptr_t, m->m_data, + CACHE_LINE_SIZE); m->m_data += sc->rx_buffer_align; sfxge_map_mbuf_fast(rxq->mem.esm_tag, rxq->mem.esm_map, m, &seg); @@ -1103,14 +1104,14 @@ sfxge_rx_start(struct sfxge_softc *sc) /* Ensure IP headers are 32bit aligned */ hdrlen = sc->rx_prefix_size + sizeof (struct ether_header); - sc->rx_buffer_align = P2ROUNDUP(hdrlen, 4) - hdrlen; + sc->rx_buffer_align = EFX_P2ROUNDUP(size_t, hdrlen, 4) - hdrlen; sc->rx_buffer_size += sc->rx_buffer_align; /* Align end of packet buffer for RX DMA end padding */ align = MAX(1, encp->enc_rx_buf_align_end); EFSYS_ASSERT(ISP2(align)); - sc->rx_buffer_size = P2ROUNDUP(sc->rx_buffer_size, align); + sc->rx_buffer_size = EFX_P2ROUNDUP(size_t, sc->rx_buffer_size, align); /* * Standard mbuf zones only guarantee pointer-size alignment; From owner-svn-src-all@freebsd.org Sat Jul 27 09:36:46 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 72AC1B51E4; Sat, 27 Jul 2019 09:36:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 2CA807364C; Sat, 27 Jul 2019 09:36:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F28CB25568; Sat, 27 Jul 2019 09:36:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6R9aj4r093317; Sat, 27 Jul 2019 09:36:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6R9ajKN093314; Sat, 27 Jul 2019 09:36:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201907270936.x6R9ajKN093314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 27 Jul 2019 09:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350371 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 350371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2CA807364C 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,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, 27 Jul 2019 09:36:46 -0000 Author: arybchik Date: Sat Jul 27 09:36:45 2019 New Revision: 350371 URL: https://svnweb.freebsd.org/changeset/base/350371 Log: sfxge(4): unify power of 2 alignment check macro Substitute driver-defined IS_P2ALIGNED() with EFX_IS_P2ALIGNED() defined in libefx. Add type argument and cast value and alignment to one specified type. Reported by: Andrea Valsania Reviewed by: philip Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D21076 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Jul 27 09:36:36 2019 (r350370) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Jul 27 09:36:45 2019 (r350371) @@ -1131,12 +1131,12 @@ ef10_rx_qcreate( rc = ENOTSUP; goto fail9; } - if (!IS_P2ALIGNED(es_max_dma_len, + if (!EFX_IS_P2ALIGNED(uint32_t, es_max_dma_len, EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) { rc = EINVAL; goto fail10; } - if (!IS_P2ALIGNED(es_buf_stride, + if (!EFX_IS_P2ALIGNED(uint32_t, es_buf_stride, EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) { rc = EINVAL; goto fail11; Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Sat Jul 27 09:36:36 2019 (r350370) +++ head/sys/dev/sfxge/common/efsys.h Sat Jul 27 09:36:45 2019 (r350371) @@ -84,10 +84,6 @@ extern "C" { #define B_TRUE TRUE #endif -#ifndef IS_P2ALIGNED -#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0) -#endif - #ifndef IS2P #define ISP2(x) (((x) & ((x) - 1)) == 0) #endif @@ -375,7 +371,8 @@ typedef struct efsys_mem_s { uint32_t *addr; \ \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_dword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_dword_t)), \ ("not power of 2 aligned")); \ \ addr = (void *)((_esmp)->esm_base + (_offset)); \ @@ -394,7 +391,8 @@ typedef struct efsys_mem_s { uint64_t *addr; \ \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ addr = (void *)((_esmp)->esm_base + (_offset)); \ @@ -413,7 +411,8 @@ typedef struct efsys_mem_s { uint32_t *addr; \ \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ addr = (void *)((_esmp)->esm_base + (_offset)); \ @@ -435,7 +434,8 @@ typedef struct efsys_mem_s { uint64_t *addr; \ \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_oword_t)), \ ("not power of 2 aligned")); \ \ addr = (void *)((_esmp)->esm_base + (_offset)); \ @@ -457,7 +457,8 @@ typedef struct efsys_mem_s { uint32_t *addr; \ \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_oword_t)), \ ("not power of 2 aligned")); \ \ addr = (void *)((_esmp)->esm_base + (_offset)); \ @@ -482,7 +483,8 @@ typedef struct efsys_mem_s { uint32_t *addr; \ \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_dword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_dword_t)), \ ("not power of 2 aligned")); \ \ EFSYS_PROBE2(mem_writed, unsigned int, (_offset), \ @@ -501,7 +503,8 @@ typedef struct efsys_mem_s { uint64_t *addr; \ \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ EFSYS_PROBE3(mem_writeq, unsigned int, (_offset), \ @@ -521,7 +524,8 @@ typedef struct efsys_mem_s { uint32_t *addr; \ \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ EFSYS_PROBE3(mem_writeq, unsigned int, (_offset), \ @@ -543,7 +547,8 @@ typedef struct efsys_mem_s { uint64_t *addr; \ \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_oword_t)), \ ("not power of 2 aligned")); \ \ EFSYS_PROBE5(mem_writeo, unsigned int, (_offset), \ @@ -565,7 +570,8 @@ typedef struct efsys_mem_s { uint32_t *addr; \ \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_oword_t)), \ ("not power of 2 aligned")); \ \ EFSYS_PROBE5(mem_writeo, unsigned int, (_offset), \ @@ -617,7 +623,8 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_READD(_esbp, _offset, _edp, _lock) \ do { \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_dword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_dword_t)), \ ("not power of 2 aligned")); \ \ _NOTE(CONSTANTCONDITION) \ @@ -641,7 +648,8 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_READQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ SFXGE_BAR_LOCK(_esbp); \ @@ -661,7 +669,8 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_READO(_esbp, _offset, _eop, _lock) \ do { \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_oword_t)), \ ("not power of 2 aligned")); \ \ _NOTE(CONSTANTCONDITION) \ @@ -691,7 +700,8 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_READQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ SFXGE_BAR_LOCK(_esbp); \ @@ -714,7 +724,8 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_READO(_esbp, _offset, _eop, _lock) \ do { \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_oword_t)), \ ("not power of 2 aligned")); \ \ _NOTE(CONSTANTCONDITION) \ @@ -750,7 +761,8 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_WRITED(_esbp, _offset, _edp, _lock) \ do { \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_dword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_dword_t)), \ ("not power of 2 aligned")); \ \ _NOTE(CONSTANTCONDITION) \ @@ -782,7 +794,8 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_WRITEQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ SFXGE_BAR_LOCK(_esbp); \ @@ -810,7 +823,8 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_WRITEQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ SFXGE_BAR_LOCK(_esbp); \ @@ -854,7 +868,8 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_WC_WRITEQ(_esbp, _offset, _eqp) \ do { \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_qword_t)), \ ("not power of 2 aligned")); \ \ (void) (_esbp); \ @@ -869,7 +884,8 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_WRITEO(_esbp, _offset, _eop, _lock) \ do { \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_oword_t)), \ ("not power of 2 aligned")); \ \ _NOTE(CONSTANTCONDITION) \ @@ -915,7 +931,8 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_WRITEO(_esbp, _offset, _eop, _lock) \ do { \ _NOTE(CONSTANTCONDITION) \ - KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + KASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ + sizeof (efx_oword_t)), \ ("not power of 2 aligned")); \ \ _NOTE(CONSTANTCONDITION) \ Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Jul 27 09:36:36 2019 (r350370) +++ head/sys/dev/sfxge/common/efx.h Sat Jul 27 09:36:45 2019 (r350371) @@ -64,6 +64,10 @@ extern "C" { #define EFX_P2ALIGN(_type, _value, _align) \ ((_type)(_value) & -(_type)(_align)) +/* Test if value is power of 2 aligned. */ +#define EFX_IS_P2ALIGNED(_type, _value, _align) \ + ((((_type)(_value)) & ((_type)(_align) - 1)) == 0) + /* Return codes */ typedef __success(return == 0) int efx_rc_t; From owner-svn-src-all@freebsd.org Sat Jul 27 09:36: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 93D9EB51CF; Sat, 27 Jul 2019 09:36:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 3F209735DB; Sat, 27 Jul 2019 09:36:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59BA625567; Sat, 27 Jul 2019 09:36:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6R9abmn093261; Sat, 27 Jul 2019 09:36:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6R9aa2q093258; Sat, 27 Jul 2019 09:36:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201907270936.x6R9aa2q093258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 27 Jul 2019 09:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350370 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 350370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F209735DB 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.950,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, 27 Jul 2019 09:36:45 -0000 Author: arybchik Date: Sat Jul 27 09:36:36 2019 New Revision: 350370 URL: https://svnweb.freebsd.org/changeset/base/350370 Log: sfxge(4): fix align to power of 2 when align has smaller type Substitute driver-defined P2ALIGN() with EFX_P2ALIGN() defined in libefx. Cast value and alignment to one specified type to guarantee result correctness. Reported by: Andrea Valsania Reviewed by: philip Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D21075 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Jul 27 09:36:27 2019 (r350369) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Jul 27 09:36:36 2019 (r350370) @@ -869,7 +869,7 @@ ef10_rx_qpush( efx_dword_t dword; /* Hardware has alignment restriction for WPTR */ - wptr = P2ALIGN(added, EF10_RX_WPTR_ALIGN); + wptr = EFX_P2ALIGN(unsigned int, added, EF10_RX_WPTR_ALIGN); if (pushed == wptr) return; Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Sat Jul 27 09:36:27 2019 (r350369) +++ head/sys/dev/sfxge/common/efsys.h Sat Jul 27 09:36:36 2019 (r350370) @@ -88,10 +88,6 @@ extern "C" { #define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0) #endif -#ifndef P2ALIGN -#define P2ALIGN(_x, _a) ((_x) & -(_a)) -#endif - #ifndef IS2P #define ISP2(x) (((x) & ((x) - 1)) == 0) #endif Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Jul 27 09:36:27 2019 (r350369) +++ head/sys/dev/sfxge/common/efx.h Sat Jul 27 09:36:36 2019 (r350370) @@ -60,6 +60,10 @@ extern "C" { #define EFX_P2ROUNDUP(_type, _value, _align) \ (-(-(_type)(_value) & -(_type)(_align))) +/* Align value down to the nearest power of two. */ +#define EFX_P2ALIGN(_type, _value, _align) \ + ((_type)(_value) & -(_type)(_align)) + /* Return codes */ typedef __success(return == 0) int efx_rc_t; From owner-svn-src-all@freebsd.org Sat Jul 27 13:48: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 34D67BA4DE; Sat, 27 Jul 2019 13:48:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 992DC86341; Sat, 27 Jul 2019 13:48:13 +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 x6RDm5mO048122 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 27 Jul 2019 16:48:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x6RDm5mO048122 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x6RDm4np048121; Sat, 27 Jul 2019 16:48:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 27 Jul 2019 16:48:04 +0300 From: Konstantin Belousov To: Rick Macklem Cc: Rick Macklem , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r350315 - in head/sys: kern sys Message-ID: <20190727134804.GF2731@kib.kiev.ua> References: <201907250546.x6P5kHWq076756@repo.freebsd.org> <20190726215628.GE2731@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: Sat, 27 Jul 2019 13:48:14 -0000 On Sat, Jul 27, 2019 at 01:35:06AM +0000, Rick Macklem wrote: > Konstantin Belousov wrote: > >On Thu, Jul 25, 2019 at 05:46:17AM +0000, Rick Macklem wrote: > >> Author: rmacklem > >> Date: Thu Jul 25 05:46:16 2019 > >> New Revision: 350315 > >> URL: https://svnweb.freebsd.org/changeset/base/350315 > >> > >> Log: > >> Add kernel support for a Linux compatible copy_file_range(2) syscall. > > > >> Modified: head/sys/kern/syscalls.master > >> >=====================================================================>========= > >> --- head/sys/kern/syscalls.master Thu Jul 25 03:55:05 2019 (r350314) > >> +++ head/sys/kern/syscalls.master Thu Jul 25 05:46:16 2019 (r350315) > >> @@ -3175,6 +3175,16 @@ > >> int flag > >> ); > >> } > >> +569 AUE_NULL STD { > >> + ssize_t copy_file_range( > >> + int infd, > >> + _Inout_opt_ off_t *inoffp, > >> + int outfd, > >> + _Inout_opt_ off_t *outoffp, > >> + size_t len, > >> + unsigned int flags > >> + ); > >> + } > > > >I sat to write the compat32 shims, and only then noted that len has size_t > >type. Why is it size_t and not off_t ? > Well, that's what Linux did. > > Also, since it returns ssize_t, it can't do more than SSIZE_MAX > (generally 1/2 of SIZE_T_MAX). Returning ssize_t is also what Linux > does and is consistent with read(2)/write(2). If changing the length argument type to off_t, it is reasonable to change the return type to off_t as well. We already have the lseek(2) syscall that requires two return registers on 32bit. Note that it is reasonable for read(2) to take length as size_t-typed parameter, because size_t is the type for object sizes. There is no object in user address space for copy_file_range(2) API, so potentially wider off_t is acceptable and is in fact useful there. It is useful on 32bit machines where FreeBSD size_t is 32bit, while off_t is 64bit. From owner-svn-src-all@freebsd.org Sat Jul 27 15:04: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 CE29FBBA77; Sat, 27 Jul 2019 15:04:10 +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 AFEB8893AB; Sat, 27 Jul 2019 15:04:10 +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 8ACE71172; Sat, 27 Jul 2019 15:04:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6RF4ASs094925; Sat, 27 Jul 2019 15:04:10 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RF4ABi094924; Sat, 27 Jul 2019 15:04:10 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201907271504.x6RF4ABi094924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 27 Jul 2019 15:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350372 - 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: 350372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFEB8893AB 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.923,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, 27 Jul 2019 15:04:10 -0000 Author: manu Date: Sat Jul 27 15:04:10 2019 New Revision: 350372 URL: https://svnweb.freebsd.org/changeset/base/350372 Log: arm: Fix TEGRA124 kernel Since r350162 device syscon is needed for sdhci driver. Add it to the config file. Reported by: dim Modified: head/sys/arm/conf/TEGRA124 Modified: head/sys/arm/conf/TEGRA124 ============================================================================== --- head/sys/arm/conf/TEGRA124 Sat Jul 27 09:36:45 2019 (r350371) +++ head/sys/arm/conf/TEGRA124 Sat Jul 27 15:04:10 2019 (r350372) @@ -40,6 +40,7 @@ device clk device phy device hwreset device regulator +device syscon # Pseudo devices. device loop # Network loopback From owner-svn-src-all@freebsd.org Sat Jul 27 16:11: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 84610BCC35; Sat, 27 Jul 2019 16:11:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 672448B2F7; Sat, 27 Jul 2019 16:11:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 389701CA3; Sat, 27 Jul 2019 16:11:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6RGB5Li032306; Sat, 27 Jul 2019 16:11:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RGB4cJ032303; Sat, 27 Jul 2019 16:11:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907271611.x6RGB4cJ032303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 27 Jul 2019 16:11: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: r350373 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 350373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 672448B2F7 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_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,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, 27 Jul 2019 16:11:05 -0000 Author: markj Date: Sat Jul 27 16:11:04 2019 New Revision: 350373 URL: https://svnweb.freebsd.org/changeset/base/350373 Log: MFC r350310: Fix the turnstile_lock() KPI. Modified: stable/12/sys/kern/subr_epoch.c stable/12/sys/kern/subr_turnstile.c stable/12/sys/sys/turnstile.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_epoch.c ============================================================================== --- stable/12/sys/kern/subr_epoch.c Sat Jul 27 15:04:10 2019 (r350372) +++ stable/12/sys/kern/subr_epoch.c Sat Jul 27 16:11:04 2019 (r350373) @@ -440,26 +440,20 @@ epoch_block_handler_preempt(struct ck_epoch *global __ */ critical_enter(); thread_unlock(td); - owner = turnstile_lock(ts, &lock); - /* - * The owner pointer indicates that the lock succeeded. - * Only in case we hold the lock and the turnstile we - * locked is still the one that curwaittd is blocked on - * can we continue. Otherwise the turnstile pointer has - * been changed out from underneath us, as in the case - * where the lock holder has signalled curwaittd, - * and we need to continue. - */ - if (owner != NULL && ts == curwaittd->td_blocked) { - MPASS(TD_IS_INHIBITED(curwaittd) && - TD_ON_LOCK(curwaittd)); - critical_exit(); - turnstile_wait(ts, owner, curwaittd->td_tsqueue); - counter_u64_add(turnstile_count, 1); - thread_lock(td); - return; - } else if (owner != NULL) + + if (turnstile_lock(ts, &lock, &owner)) { + if (ts == curwaittd->td_blocked) { + MPASS(TD_IS_INHIBITED(curwaittd) && + TD_ON_LOCK(curwaittd)); + critical_exit(); + turnstile_wait(ts, owner, + curwaittd->td_tsqueue); + counter_u64_add(turnstile_count, 1); + thread_lock(td); + return; + } turnstile_unlock(ts, lock); + } thread_lock(td); critical_exit(); KASSERT(td->td_locks == locksheld, Modified: stable/12/sys/kern/subr_turnstile.c ============================================================================== --- stable/12/sys/kern/subr_turnstile.c Sat Jul 27 15:04:10 2019 (r350372) +++ stable/12/sys/kern/subr_turnstile.c Sat Jul 27 16:11:04 2019 (r350373) @@ -566,24 +566,26 @@ turnstile_trywait(struct lock_object *lock) return (ts); } -struct thread * -turnstile_lock(struct turnstile *ts, struct lock_object **lockp) +bool +turnstile_lock(struct turnstile *ts, struct lock_object **lockp, + struct thread **tdp) { struct turnstile_chain *tc; struct lock_object *lock; if ((lock = ts->ts_lockobj) == NULL) - return (NULL); + return (false); tc = TC_LOOKUP(lock); mtx_lock_spin(&tc->tc_lock); mtx_lock_spin(&ts->ts_lock); if (__predict_false(lock != ts->ts_lockobj)) { mtx_unlock_spin(&tc->tc_lock); mtx_unlock_spin(&ts->ts_lock); - return (NULL); + return (false); } *lockp = lock; - return (ts->ts_owner); + *tdp = ts->ts_owner; + return (true); } void Modified: stable/12/sys/sys/turnstile.h ============================================================================== --- stable/12/sys/sys/turnstile.h Sat Jul 27 15:04:10 2019 (r350372) +++ stable/12/sys/sys/turnstile.h Sat Jul 27 16:11:04 2019 (r350373) @@ -100,7 +100,8 @@ int turnstile_signal(struct turnstile *, int); struct turnstile *turnstile_trywait(struct lock_object *); void turnstile_unpend(struct turnstile *); void turnstile_wait(struct turnstile *, struct thread *, int); -struct thread *turnstile_lock(struct turnstile *, struct lock_object **); +bool turnstile_lock(struct turnstile *, struct lock_object **, + struct thread **); void turnstile_unlock(struct turnstile *, struct lock_object *); void turnstile_assert(struct turnstile *); #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Sat Jul 27 16:33: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 2870CBD412; Sat, 27 Jul 2019 16:33: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 080B08C170; Sat, 27 Jul 2019 16:33: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 D678821E0; Sat, 27 Jul 2019 16:33: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 x6RGXBCR048041; Sat, 27 Jul 2019 16:33:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RGXBOO048038; Sat, 27 Jul 2019 16:33:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907271633.x6RGXBOO048038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 27 Jul 2019 16:33: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: r350374 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 350374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 080B08C170 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.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: Sat, 27 Jul 2019 16:33:12 -0000 Author: markj Date: Sat Jul 27 16:33:11 2019 New Revision: 350374 URL: https://svnweb.freebsd.org/changeset/base/350374 Log: MFC r349840: Add a per-CPU page cache per VM free pool. Modified: stable/12/sys/vm/vm_page.c stable/12/sys/vm/vm_page.h stable/12/sys/vm/vm_pagequeue.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Sat Jul 27 16:11:04 2019 (r350373) +++ stable/12/sys/vm/vm_page.c Sat Jul 27 16:33:11 2019 (r350374) @@ -192,20 +192,28 @@ static void vm_page_init_cache_zones(void *dummy __unused) { struct vm_domain *vmd; - int i; + struct vm_pgcache *pgcache; + int domain, pool; - for (i = 0; i < vm_ndomains; i++) { - vmd = VM_DOMAIN(i); + for (domain = 0; domain < vm_ndomains; domain++) { + vmd = VM_DOMAIN(domain); + /* - * Don't allow the page cache to take up more than .25% of + * Don't allow the page caches to take up more than .25% of * memory. */ - if (vmd->vmd_page_count / 400 < 256 * mp_ncpus) + if (vmd->vmd_page_count / 400 < 256 * mp_ncpus * VM_NFREEPOOL) continue; - vmd->vmd_pgcache = uma_zcache_create("vm pgcache", - sizeof(struct vm_page), NULL, NULL, NULL, NULL, - vm_page_import, vm_page_release, vmd, - UMA_ZONE_NOBUCKETCACHE | UMA_ZONE_MAXBUCKET | UMA_ZONE_VM); + for (pool = 0; pool < VM_NFREEPOOL; pool++) { + pgcache = &vmd->vmd_pgcache[pool]; + pgcache->domain = domain; + 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, + UMA_ZONE_NOBUCKETCACHE | UMA_ZONE_MAXBUCKET | + UMA_ZONE_VM); + } } } SYSINIT(vm_page2, SI_SUB_VM_CONF, SI_ORDER_ANY, vm_page_init_cache_zones, NULL); @@ -1793,7 +1801,7 @@ vm_page_alloc_domain_after(vm_object_t object, vm_pind { struct vm_domain *vmd; vm_page_t m; - int flags; + int flags, pool; KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && (object != NULL || (req & VM_ALLOC_SBUSY) == 0) && @@ -1810,6 +1818,7 @@ vm_page_alloc_domain_after(vm_object_t object, vm_pind flags = 0; m = NULL; + pool = object != NULL ? VM_FREEPOOL_DEFAULT : VM_FREEPOOL_DIRECT; again: #if VM_NRESERVLEVEL > 0 /* @@ -1824,8 +1833,8 @@ again: } #endif vmd = VM_DOMAIN(domain); - if (object != NULL && vmd->vmd_pgcache != NULL) { - m = uma_zalloc(vmd->vmd_pgcache, M_NOWAIT); + if (vmd->vmd_pgcache[pool].zone != NULL) { + m = uma_zalloc(vmd->vmd_pgcache[pool].zone, M_NOWAIT); if (m != NULL) { flags |= PG_PCPU_CACHE; goto found; @@ -1836,8 +1845,7 @@ again: * If not, allocate it from the free page queues. */ vm_domain_free_lock(vmd); - m = vm_phys_alloc_pages(domain, object != NULL ? - VM_FREEPOOL_DEFAULT : VM_FREEPOOL_DIRECT, 0); + m = vm_phys_alloc_pages(domain, pool, 0); vm_domain_free_unlock(vmd); if (m == NULL) { vm_domain_freecnt_inc(vmd, 1); @@ -2229,15 +2237,17 @@ static int vm_page_import(void *arg, void **store, int cnt, int domain, int flags) { struct vm_domain *vmd; + struct vm_pgcache *pgcache; int i; - vmd = arg; + pgcache = arg; + vmd = VM_DOMAIN(pgcache->domain); /* Only import if we can bring in a full bucket. */ if (cnt == 1 || !vm_domain_allocate(vmd, VM_ALLOC_NORMAL, cnt)) return (0); domain = vmd->vmd_domain; vm_domain_free_lock(vmd); - i = vm_phys_alloc_npages(domain, VM_FREEPOOL_DEFAULT, cnt, + i = vm_phys_alloc_npages(domain, pgcache->pool, cnt, (vm_page_t *)store); vm_domain_free_unlock(vmd); if (cnt != i) @@ -2250,10 +2260,12 @@ static void vm_page_release(void *arg, void **store, int cnt) { struct vm_domain *vmd; + struct vm_pgcache *pgcache; vm_page_t m; int i; - vmd = arg; + pgcache = arg; + vmd = VM_DOMAIN(pgcache->domain); vm_domain_free_lock(vmd); for (i = 0; i < cnt; i++) { m = (vm_page_t)store[i]; @@ -3469,13 +3481,15 @@ void vm_page_free_toq(vm_page_t m) { struct vm_domain *vmd; + uma_zone_t zone; if (!vm_page_free_prep(m)) return; vmd = vm_pagequeue_domain(m); - if ((m->flags & PG_PCPU_CACHE) != 0 && vmd->vmd_pgcache != NULL) { - uma_zfree(vmd->vmd_pgcache, m); + zone = vmd->vmd_pgcache[m->pool].zone; + if ((m->flags & PG_PCPU_CACHE) != 0 && zone != NULL) { + uma_zfree(zone, m); return; } vm_domain_free_lock(vmd); Modified: stable/12/sys/vm/vm_page.h ============================================================================== --- stable/12/sys/vm/vm_page.h Sat Jul 27 16:11:04 2019 (r350373) +++ stable/12/sys/vm/vm_page.h Sat Jul 27 16:33:11 2019 (r350374) @@ -376,6 +376,10 @@ extern struct mtx_padalign pa_lock[]; /* * Page flags. If changed at any other time than page allocation or * freeing, the modification must be protected by the vm_page lock. + * + * The PG_PCPU_CACHE flag is set at allocation time if the page was + * allocated from a per-CPU cache. It is cleared the next time that the + * page is allocated from the physical memory allocator. */ #define PG_PCPU_CACHE 0x0001 /* was allocated from per-CPU caches */ #define PG_FICTITIOUS 0x0004 /* physical page doesn't exist */ Modified: stable/12/sys/vm/vm_pagequeue.h ============================================================================== --- stable/12/sys/vm/vm_pagequeue.h Sat Jul 27 16:11:04 2019 (r350373) +++ stable/12/sys/vm/vm_pagequeue.h Sat Jul 27 16:33:11 2019 (r350374) @@ -103,7 +103,11 @@ struct vm_domain { struct vm_pagequeue vmd_pagequeues[PQ_COUNT]; struct mtx_padalign vmd_free_mtx; struct mtx_padalign vmd_pageout_mtx; - uma_zone_t vmd_pgcache; /* (c) page free cache. */ + struct vm_pgcache { + int domain; + int pool; + uma_zone_t zone; + } vmd_pgcache[VM_NFREEPOOL]; struct vmem *vmd_kernel_arena; /* (c) per-domain kva R/W arena. */ struct vmem *vmd_kernel_rwx_arena; /* (c) per-domain kva R/W/X arena. */ u_int vmd_domain; /* (c) Domain number. */ From owner-svn-src-all@freebsd.org Sat Jul 27 16:33: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 680C8BD45E; Sat, 27 Jul 2019 16:33:35 +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 48DCC8C2AE; Sat, 27 Jul 2019 16:33:35 +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 2028321E2; Sat, 27 Jul 2019 16:33:35 +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 x6RGXZWJ048103; Sat, 27 Jul 2019 16:33:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RGXZVW048102; Sat, 27 Jul 2019 16:33:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907271633.x6RGXZVW048102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 27 Jul 2019 16:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350375 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 350375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48DCC8C2AE 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.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: Sat, 27 Jul 2019 16:33:35 -0000 Author: markj Date: Sat Jul 27 16:33:34 2019 New Revision: 350375 URL: https://svnweb.freebsd.org/changeset/base/350375 Log: MFC r349841: Elide the vm_reserv_free_page() call when PG_PCPU_CACHE is set. Modified: stable/12/sys/vm/vm_page.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Sat Jul 27 16:33:11 2019 (r350374) +++ stable/12/sys/vm/vm_page.c Sat Jul 27 16:33:34 2019 (r350375) @@ -3461,7 +3461,12 @@ vm_page_free_prep(vm_page_t m) pmap_page_set_memattr(m, VM_MEMATTR_DEFAULT); #if VM_NRESERVLEVEL > 0 - if (vm_reserv_free_page(m)) + /* + * Determine whether the page belongs to a reservation. If the page was + * allocated from a per-CPU cache, it cannot belong to a reservation, so + * as an optimization, we avoid the check in that case. + */ + if ((m->flags & PG_PCPU_CACHE) == 0 && vm_reserv_free_page(m)) return (false); #endif From owner-svn-src-all@freebsd.org Sat Jul 27 16:34: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 32570BD4E7; Sat, 27 Jul 2019 16:34:08 +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 12B348C3FB; Sat, 27 Jul 2019 16:34:08 +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 B13F221E3; Sat, 27 Jul 2019 16:34:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6RGY7Tc048181; Sat, 27 Jul 2019 16:34:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RGY7wj048180; Sat, 27 Jul 2019 16:34:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907271634.x6RGY7wj048180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 27 Jul 2019 16:34: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: r350376 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 350376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 12B348C3FB 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.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: Sat, 27 Jul 2019 16:34:08 -0000 Author: markj Date: Sat Jul 27 16:34:07 2019 New Revision: 350376 URL: https://svnweb.freebsd.org/changeset/base/350376 Log: MFC r350182: Rename vm_page_{import,release}() to vm_page_zone_{import,release}(). Modified: stable/12/sys/vm/vm_page.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Sat Jul 27 16:33:34 2019 (r350375) +++ stable/12/sys/vm/vm_page.c Sat Jul 27 16:34:07 2019 (r350376) @@ -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_NOBUCKETCACHE | UMA_ZONE_MAXBUCKET | UMA_ZONE_VM); } @@ -2234,7 +2234,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; @@ -2257,7 +2257,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 27 17:24: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 B2A4DBE50D; Sat, 27 Jul 2019 17:24:21 +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 945B28DECC; Sat, 27 Jul 2019 17:24:21 +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 6DC232AB3; Sat, 27 Jul 2019 17:24:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6RHOLr8077265; Sat, 27 Jul 2019 17:24:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RHOKhJ077258; Sat, 27 Jul 2019 17:24:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201907271724.x6RHOKhJ077258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 27 Jul 2019 17:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350377 - in head/sys: arm/arm arm/conf arm/mv/discovery arm/mv/orion arm/ralink conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/arm arm/conf arm/mv/discovery arm/mv/orion arm/ralink conf X-SVN-Commit-Revision: 350377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 945B28DECC 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.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: Sat, 27 Jul 2019 17:24:21 -0000 Author: imp Date: Sat Jul 27 17:24:19 2019 New Revision: 350377 URL: https://svnweb.freebsd.org/changeset/base/350377 Log: Remove support for kernel.tramp and kernel.tramp.gz Nothing uses these anymore. They were for super small armv4 boards without uboot. We removed armv4 support before 13.0, but neglected to garbage collect this at the same time. Today, both flavors of armv5 kernels (mv and ralink) boot via uboot which has its own compression scheme for boards that need it. Note: OLDFILES has not been updated beacuse installkernel will move the whole directory out of the way before installing the new kernel. Differential Revision: https://reviews.freebsd.org/D21072 Deleted: head/sys/arm/arm/inckern.S Modified: head/sys/arm/conf/NOTES.armv5 head/sys/arm/mv/discovery/std.db78xxx head/sys/arm/mv/orion/std.db88f5xxx head/sys/arm/mv/orion/std.ts7800 head/sys/arm/ralink/std.ralink head/sys/conf/Makefile.arm Modified: head/sys/arm/conf/NOTES.armv5 ============================================================================== --- head/sys/arm/conf/NOTES.armv5 Sat Jul 27 16:34:07 2019 (r350376) +++ head/sys/arm/conf/NOTES.armv5 Sat Jul 27 17:24:19 2019 (r350377) @@ -18,7 +18,6 @@ files "../mv/orion/files.ts7800" makeoptions CONF_CFLAGS+="-march=armv5te" makeoptions LDFLAGS="-zmuldefs" -makeoptions KERNPHYSADDR=0x00000000 # Undo options from sys/conf/NOTES that we do not want... Modified: head/sys/arm/mv/discovery/std.db78xxx ============================================================================== --- head/sys/arm/mv/discovery/std.db78xxx Sat Jul 27 16:34:07 2019 (r350376) +++ head/sys/arm/mv/discovery/std.db78xxx Sat Jul 27 17:24:19 2019 (r350377) @@ -3,6 +3,5 @@ include "../mv/std.mv" files "../mv/discovery/files.db78xxx" -makeoptions KERNPHYSADDR=0x00900000 makeoptions KERNVIRTADDR=0xc0900000 options KERNVIRTADDR=0xc0900000 Modified: head/sys/arm/mv/orion/std.db88f5xxx ============================================================================== --- head/sys/arm/mv/orion/std.db88f5xxx Sat Jul 27 16:34:07 2019 (r350376) +++ head/sys/arm/mv/orion/std.db88f5xxx Sat Jul 27 17:24:19 2019 (r350377) @@ -3,6 +3,5 @@ include "../mv/std.mv" files "../mv/orion/files.db88f5xxx" -makeoptions KERNPHYSADDR=0x00900000 makeoptions KERNVIRTADDR=0xc0900000 options KERNVIRTADDR=0xc0900000 Modified: head/sys/arm/mv/orion/std.ts7800 ============================================================================== --- head/sys/arm/mv/orion/std.ts7800 Sat Jul 27 16:34:07 2019 (r350376) +++ head/sys/arm/mv/orion/std.ts7800 Sat Jul 27 17:24:19 2019 (r350377) @@ -3,7 +3,6 @@ include "../mv/std.mv" files "../mv/orion/files.ts7800" -makeoptions KERNPHYSADDR=0x00900000 makeoptions KERNVIRTADDR=0xc0900000 options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 Modified: head/sys/arm/ralink/std.ralink ============================================================================== --- head/sys/arm/ralink/std.ralink Sat Jul 27 16:34:07 2019 (r350376) +++ head/sys/arm/ralink/std.ralink Sat Jul 27 17:24:19 2019 (r350377) @@ -5,6 +5,5 @@ machine arm makeoptions CONF_CFLAGS="-march=armv5te" options INTRNG -makeoptions KERNPHYSADDR=0x40000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNVIRTADDR=0xc0000000 Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Sat Jul 27 16:34:07 2019 (r350376) +++ head/sys/conf/Makefile.arm Sat Jul 27 17:24:19 2019 (r350377) @@ -65,86 +65,13 @@ SYSTEM_LD_ = ${LD} -m ${LD_EMULATION} -Bdynamic -T lds ${_LDFLAGS} --no-warn-mismatch --warn-common --export-dynamic \ --dynamic-linker /red/herring \ -o ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o -SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M\ +SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M \ >ldscript.$M.noheader; \ ${SYSTEM_LD_}; \ ${OBJCOPY} -S -O binary ${FULLKERNEL}.noheader \ ${KERNEL_KO}.bin; \ rm ${FULLKERNEL}.noheader -FILES_CPU_FUNC = \ - $S/$M/$M/cpufunc_asm_armv5_ec.S \ - $S/$M/$M/cpufunc_asm_sheeva.S - -.if ${MACHINE_ARCH:Marmv[67]*} == "" && defined(KERNPHYSADDR) -KERNEL_EXTRA=trampoline -KERNEL_EXTRA_INSTALL=kernel.gz.tramp -trampoline: ${KERNEL_KO}.tramp -${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$M/inckern.S $S/$M/$M/elf_trampoline.c - echo "#define KERNNAME \"${KERNEL_KO}.tmp\"" >opt_kernname.h - sed s/${KERNVIRTADDR}/${KERNPHYSADDR}/ ldscript.$M > ldscript.$M.tramp - sed s/" + SIZEOF_HEADERS"// ldscript.$M.tramp > \ - ldscript.$M.tramp.noheader - echo "#include " >tmphack.S - echo "ENTRY(_start)" >>tmphack.S - echo "bl _startC" >>tmphack.S - ${OBJCOPY} --strip-symbol '$$d' --strip-symbol '$$a' \ - -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp - eval $$(stat -s ${KERNEL_KO}.tmp) && \ - echo "#define KERNSIZE $$st_size" >>opt_kernname.h - ${CC} -O -nostdlib -I. -I$S \ - -Xlinker -T -Xlinker ldscript.$M.tramp \ - -DELF_TRAMPOLINE \ - tmphack.S \ - $S/$M/$M/elf_trampoline.c \ - $S/$M/$M/inckern.S \ - ${FILES_CPU_FUNC} \ - -o ${KERNEL_KO}.tramp - ${CC} -O -nostdlib -I. -I$S \ - -Xlinker -T -Xlinker ldscript.$M.tramp.noheader \ - -DELF_TRAMPOLINE \ - tmphack.S \ - $S/$M/$M/elf_trampoline.c \ - $S/$M/$M/inckern.S \ - ${FILES_CPU_FUNC} \ - -o ${KERNEL_KO}.tramp.noheader - ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \ - ${KERNEL_KO}.tramp.bin - ${OBJCOPY} ${STRIP_FLAGS} ${KERNEL_KO}.tmp - echo "#define KERNNAME \"${KERNEL_KO}.tmp.gz\"" >opt_kernname.h - eval $$(stat -s ${KERNEL_KO}.tmp) && \ - echo "#define KERNSIZE $$st_size" >>opt_kernname.h - gzip -f9 ${KERNEL_KO}.tmp - eval $$(stat -s ${KERNEL_KO}.tmp.gz) && \ - echo "#define KERNCOMPSIZE $$st_size" >>opt_kernname.h - ${CC} -O2 -ffreestanding -I. -I$S -c \ - -DKZIP -DELF_TRAMPOLINE \ - $S/kern/subr_inflate.c \ - -o inflate-tramp.o - ${CC} -O -nostdlib -I. -I$S \ - -Xlinker -T -Xlinker ldscript.$M.tramp \ - -DKZIP -DELF_TRAMPOLINE \ - tmphack.S \ - $S/$M/$M/elf_trampoline.c \ - inflate-tramp.o \ - $S/$M/$M/inckern.S \ - ${FILES_CPU_FUNC} \ - -o ${KERNEL_KO}.gz.tramp - ${CC} -O -nostdlib -I. -I$S \ - -Xlinker -T -Xlinker ldscript.$M.tramp.noheader \ - -DKZIP -DELF_TRAMPOLINE \ - tmphack.S \ - $S/$M/$M/elf_trampoline.c \ - inflate-tramp.o \ - $S/$M/$M/inckern.S \ - ${FILES_CPU_FUNC} \ - -o ${KERNEL_KO}.tramp.noheader - ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \ - ${KERNEL_KO}.gz.tramp.bin - rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \ - inflate-tramp.o tmphack.S -.endif - %BEFORE_DEPEND %OBJS @@ -159,13 +86,9 @@ ${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$M/inckern.S $S CLEAN+= ldscript.$M ${KERNEL_KO}.bin ldscript.$M.noheader -CLEAN+= ${KERNEL_KO}.tramp ${KERNEL_KO}.tramp.bin ldscript.$M.tramp \ - ldscript.$M.tramp.noheader ${KERNEL_KO}.gz.tramp \ - ${KERNEL_KO}.gz.tramp.bin - ldscript.$M: $S/conf/ldscript.$M - cat $S/conf/ldscript.$M|sed s/KERNPHYSADDR/${KERNPHYSADDR}/g| \ - sed s/KERNVIRTADDR/${KERNVIRTADDR}/g > ldscript.$M + sed s/KERNVIRTADDR/${KERNVIRTADDR}/g > ldscript.$M < $S/conf/ldscript.$M + %RULES .include "$S/conf/kern.post.mk" From owner-svn-src-all@freebsd.org Sat Jul 27 17:27: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 05E46BE5DA; Sat, 27 Jul 2019 17:27:27 +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 DCF048E0CA; Sat, 27 Jul 2019 17:27:26 +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 B8FD62ABD; Sat, 27 Jul 2019 17:27:26 +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 x6RHRQWJ077453; Sat, 27 Jul 2019 17:27:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RHRQhU077451; Sat, 27 Jul 2019 17:27:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201907271727.x6RHRQhU077451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 27 Jul 2019 17:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350378 - in head/sys/cam: ctl scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/cam: ctl scsi X-SVN-Commit-Revision: 350378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DCF048E0CA 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.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: Sat, 27 Jul 2019 17:27:27 -0000 Author: mav Date: Sat Jul 27 17:27:26 2019 New Revision: 350378 URL: https://svnweb.freebsd.org/changeset/base/350378 Log: Allow WRITE SAME handle more then 2^^32 blocks. If not limited by write_same_max_lba option, split operation into several 2^^31 blocks chunks in a loop. For large disks it may take a while, so setting write_same_max_lba may be useful to avoid timeouts. While there, fix build with CAM_CTL_DEBUG. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Jul 27 17:24:19 2019 (r350377) +++ head/sys/cam/ctl/ctl.c Sat Jul 27 17:27:26 2019 (r350378) @@ -1438,7 +1438,7 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e return; } - CTL_DEBUG_PRINT(("CTL: msg_type %d\n", msg->msg_type)); + CTL_DEBUG_PRINT(("CTL: msg_type %d\n", msg->hdr.msg_type)); switch (msg->hdr.msg_type) { case CTL_MSG_SERIALIZE: io = ctl_alloc_io(softc->othersc_pool); @@ -5685,12 +5685,36 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } +static int +ctl_write_same_cont(union ctl_io *io) +{ + struct ctl_lun *lun = CTL_LUN(io); + struct ctl_scsiio *ctsio; + struct ctl_lba_len_flags *lbalen; + int retval; + + ctsio = &io->scsiio; + ctsio->io_hdr.status = CTL_STATUS_NONE; + lbalen = (struct ctl_lba_len_flags *) + &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen->lba += lbalen->len; + if ((lun->be_lun->maxlba + 1) - lbalen->lba <= UINT32_MAX) { + ctsio->io_hdr.flags &= ~CTL_FLAG_IO_CONT; + lbalen->len = (lun->be_lun->maxlba + 1) - lbalen->lba; + } + + CTL_DEBUG_PRINT(("ctl_write_same_cont: calling config_write()\n")); + retval = lun->backend->config_write((union ctl_io *)ctsio); + return (retval); +} + int ctl_write_same(struct ctl_scsiio *ctsio) { struct ctl_lun *lun = CTL_LUN(ctsio); struct ctl_lba_len_flags *lbalen; - uint64_t lba; + const char *val; + uint64_t lba, ival; uint32_t num_blocks; int len, retval; uint8_t byte2; @@ -5754,17 +5778,25 @@ ctl_write_same(struct ctl_scsiio *ctsio) /* Zero number of blocks means "to the last logical block" */ if (num_blocks == 0) { - if ((lun->be_lun->maxlba + 1) - lba > UINT32_MAX) { + ival = UINT64_MAX; + val = dnvlist_get_string(lun->be_lun->options, + "write_same_max_lba", NULL); + if (val != NULL) + ctl_expand_number(val, &ival); + if ((lun->be_lun->maxlba + 1) - lba > ival) { ctl_set_invalid_field(ctsio, - /*sks_valid*/ 0, - /*command*/ 1, - /*field*/ 0, - /*bit_valid*/ 0, - /*bit*/ 0); + /*sks_valid*/ 1, /*command*/ 1, + /*field*/ ctsio->cdb[0] == WRITE_SAME_10 ? 7 : 10, + /*bit_valid*/ 0, /*bit*/ 0); ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } - num_blocks = (lun->be_lun->maxlba + 1) - lba; + if ((lun->be_lun->maxlba + 1) - lba > UINT32_MAX) { + ctsio->io_hdr.flags |= CTL_FLAG_IO_CONT; + ctsio->io_cont = ctl_write_same_cont; + num_blocks = 1 << 31; + } else + num_blocks = (lun->be_lun->maxlba + 1) - lba; } len = lun->be_lun->blocksize; @@ -9876,6 +9908,8 @@ ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio if (val != NULL) ctl_expand_number(val, &ival); scsi_u64to8b(ival, bl_ptr->max_write_same_length); + if (lun->be_lun->maxlba + 1 > ival) + bl_ptr->flags |= SVPD_BL_WSNZ; } ctl_set_success(ctsio); @@ -11322,7 +11356,7 @@ ctl_failover_lun(union ctl_io *rio) uint32_t targ_lun; targ_lun = rio->io_hdr.nexus.targ_mapped_lun; - CTL_DEBUG_PRINT(("FAILOVER for lun %ju\n", targ_lun)); + CTL_DEBUG_PRINT(("FAILOVER for lun %u\n", targ_lun)); /* Find and lock the LUN. */ mtx_lock(&softc->ctl_lock); Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Sat Jul 27 17:24:19 2019 (r350377) +++ head/sys/cam/scsi/scsi_all.h Sat Jul 27 17:27:26 2019 (r350378) @@ -2886,7 +2886,7 @@ struct scsi_vpd_logical_block_prov }; /* - * Block Limits VDP Page based on SBC-4 Revision 2 + * Block Limits VDP Page based on SBC-4 Revision 17 */ struct scsi_vpd_block_limits { @@ -2896,7 +2896,8 @@ struct scsi_vpd_block_limits u_int8_t page_length[2]; #define SVPD_BL_PL_BASIC 0x10 #define SVPD_BL_PL_TP 0x3C - u_int8_t reserved1; + u_int8_t flags; +#define SVPD_BL_WSNZ 0x01 u_int8_t max_cmp_write_len; u_int8_t opt_txfer_len_grain[2]; u_int8_t max_txfer_len[4]; From owner-svn-src-all@freebsd.org Sat Jul 27 17:44: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 8F7A9BEB3C; Sat, 27 Jul 2019 17:44:00 +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 3FD338EC09; Sat, 27 Jul 2019 17:44:00 +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 1B32A2E35; Sat, 27 Jul 2019 17:44:00 +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 x6RHhxmi089574; Sat, 27 Jul 2019 17:43:59 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RHhx4U089573; Sat, 27 Jul 2019 17:43:59 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201907271743.x6RHhx4U089573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sat, 27 Jul 2019 17:43: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: r350379 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 350379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3FD338EC09 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.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: Sat, 27 Jul 2019 17:44:00 -0000 Author: chuck Date: Sat Jul 27 17:43:59 2019 New Revision: 350379 URL: https://svnweb.freebsd.org/changeset/base/350379 Log: MFC r345957 bhyve: Fix NVMe data structure copy to guest bhyve's NVMe emulation was transferring Identify data back to the guest incorrectly causing memory corruptions. These corruptions resulted in core dumps and other system level errors in the guest. Approved by: imp (mentor) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sat Jul 27 17:27:26 2019 (r350378) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sat Jul 27 17:43:59 2019 (r350379) @@ -199,6 +199,9 @@ struct pci_nvme_softc { struct nvme_namespace_data nsdata; struct nvme_controller_data ctrldata; + struct nvme_error_information_entry err_log; + struct nvme_health_information_page health_log; + struct nvme_firmware_page fw_log; struct pci_nvme_blockstore nvstore; @@ -366,6 +369,15 @@ pci_nvme_init_nsdata(struct pci_nvme_softc *sc) } static void +pci_nvme_init_logpages(struct pci_nvme_softc *sc) +{ + + memset(&sc->err_log, 0, sizeof(sc->err_log)); + memset(&sc->health_log, 0, sizeof(sc->health_log)); + memset(&sc->fw_log, 0, sizeof(sc->fw_log)); +} + +static void pci_nvme_reset_locked(struct pci_nvme_softc *sc) { DPRINTF(("%s\r\n", __func__)); @@ -455,6 +467,47 @@ pci_nvme_init_controller(struct vmctx *ctx, struct pci } static int +nvme_prp_memcpy(struct vmctx *ctx, uint64_t prp1, uint64_t prp2, uint8_t *src, + size_t len) +{ + uint8_t *dst; + size_t bytes; + + if (len > (8 * 1024)) { + return (-1); + } + + /* Copy from the start of prp1 to the end of the physical page */ + bytes = PAGE_SIZE - (prp1 & PAGE_MASK); + bytes = MIN(bytes, len); + + dst = vm_map_gpa(ctx, prp1, bytes); + if (dst == NULL) { + return (-1); + } + + memcpy(dst, src, bytes); + + src += bytes; + + len -= bytes; + if (len == 0) { + return (0); + } + + len = MIN(len, PAGE_SIZE); + + dst = vm_map_gpa(ctx, prp2, len); + if (dst == NULL) { + return (-1); + } + + memcpy(dst, src, len); + + return (0); +} + +static int nvme_opc_delete_io_sq(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { @@ -587,26 +640,24 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struc { uint32_t logsize = (1 + ((command->cdw10 >> 16) & 0xFFF)) * 2; uint8_t logpage = command->cdw10 & 0xFF; - void *data; DPRINTF(("%s log page %u len %u\r\n", __func__, logpage, logsize)); - if (logpage >= 1 && logpage <= 3) - data = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, - PAGE_SIZE); - pci_nvme_status_genc(&compl->status, NVME_SC_SUCCESS); switch (logpage) { - case 0x01: /* Error information */ - memset(data, 0, logsize > PAGE_SIZE ? PAGE_SIZE : logsize); + case NVME_LOG_ERROR: + nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, + command->prp2, (uint8_t *)&sc->err_log, logsize); break; - case 0x02: /* SMART/Health information */ + case NVME_LOG_HEALTH_INFORMATION: /* TODO: present some smart info */ - memset(data, 0, logsize > PAGE_SIZE ? PAGE_SIZE : logsize); + nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, + command->prp2, (uint8_t *)&sc->health_log, logsize); break; - case 0x03: /* Firmware slot information */ - memset(data, 0, logsize > PAGE_SIZE ? PAGE_SIZE : logsize); + case NVME_LOG_FIRMWARE_SLOT: + nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, + command->prp2, (uint8_t *)&sc->fw_log, logsize); break; default: WPRINTF(("%s get log page %x command not supported\r\n", @@ -630,14 +681,13 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nv switch (command->cdw10 & 0xFF) { case 0x00: /* return Identify Namespace data structure */ - dest = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, - sizeof(sc->nsdata)); - memcpy(dest, &sc->nsdata, sizeof(sc->nsdata)); + nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, + command->prp2, (uint8_t *)&sc->nsdata, sizeof(sc->nsdata)); break; case 0x01: /* return Identify Controller data structure */ - dest = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, - sizeof(sc->ctrldata)); - memcpy(dest, &sc->ctrldata, sizeof(sc->ctrldata)); + nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, + command->prp2, (uint8_t *)&sc->ctrldata, + sizeof(sc->ctrldata)); break; case 0x02: /* list of 1024 active NSIDs > CDW1.NSID */ dest = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, @@ -1871,6 +1921,7 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p pci_nvme_reset(sc); pci_nvme_init_ctrldata(sc); pci_nvme_init_nsdata(sc); + pci_nvme_init_logpages(sc); pci_lintr_request(pi); From owner-svn-src-all@freebsd.org Sat Jul 27 17:48: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 B297ABEC6C; Sat, 27 Jul 2019 17:48:36 +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 945D38EEEC; Sat, 27 Jul 2019 17:48:36 +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 63CAA2E3E; Sat, 27 Jul 2019 17:48:36 +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 x6RHmad2090106; Sat, 27 Jul 2019 17:48:36 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RHmaZ2090103; Sat, 27 Jul 2019 17:48:36 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201907271748.x6RHmaZ2090103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sat, 27 Jul 2019 17:48:36 +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: r350380 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 350380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 945D38EEEC 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.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: Sat, 27 Jul 2019 17:48:36 -0000 Author: chuck Date: Sat Jul 27 17:48:35 2019 New Revision: 350380 URL: https://svnweb.freebsd.org/changeset/base/350380 Log: MFC r345956 bhyve: Fix NVMe BAR size calculation The NVMe specification defines bits 13:4 of BAR0 as Reserved (i.e. 0x0). Most drivers do not enforce this, but the Windows NVMe driver does and will refuse to start the device (i.e. error 10) if any of these bits are set. Approved by: imp (mentor) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sat Jul 27 17:43:59 2019 (r350379) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sat Jul 27 17:48:35 2019 (r350380) @@ -85,6 +85,9 @@ static int nvme_debug = 0; #define NVME_IOSLOTS 8 +/* The NVMe spec defines bits 13:4 in BAR0 as reserved */ +#define NVME_MMIO_SPACE_MIN (1 << 14) + #define NVME_QUEUES 16 #define NVME_MAX_QENTRIES 2048 @@ -1897,9 +1900,16 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p pci_set_cfgdata8(pi, PCIR_PROGIF, PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0); - /* allocate size of nvme registers + doorbell space for all queues */ + /* + * Allocate size of NVMe registers + doorbell space for all queues. + * + * The specification requires a minimum memory I/O window size of 16K. + * The Windows driver will refuse to start a device with a smaller + * window. + */ pci_membar_sz = sizeof(struct nvme_registers) + - 2*sizeof(uint32_t)*(sc->max_queues + 1); + 2 * sizeof(uint32_t) * (sc->max_queues + 1); + pci_membar_sz = MAX(pci_membar_sz, NVME_MMIO_SPACE_MIN); DPRINTF(("nvme membar size: %u\r\n", pci_membar_sz)); From owner-svn-src-all@freebsd.org Sat Jul 27 17:52:46 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 21072BEE8F; Sat, 27 Jul 2019 17:52:46 +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 D9BA68F2CD; Sat, 27 Jul 2019 17:52:45 +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 B76CA300D; Sat, 27 Jul 2019 17:52:45 +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 x6RHqjlE095579; Sat, 27 Jul 2019 17:52:45 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RHqjFN095577; Sat, 27 Jul 2019 17:52:45 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201907271752.x6RHqjFN095577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sat, 27 Jul 2019 17:52:45 +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: r350381 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 350381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9BA68F2CD 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.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: Sat, 27 Jul 2019 17:52:46 -0000 Author: chuck Date: Sat Jul 27 17:52:45 2019 New Revision: 350381 URL: https://svnweb.freebsd.org/changeset/base/350381 Log: MFC r348781 bhyve: Add PCIe Integrated Endpoint capability Approved by: imp (mentor) Modified: stable/12/usr.sbin/bhyve/pci_emul.c stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_emul.c Sat Jul 27 17:48:35 2019 (r350380) +++ stable/12/usr.sbin/bhyve/pci_emul.c Sat Jul 27 17:52:45 2019 (r350381) @@ -947,15 +947,23 @@ pci_emul_add_pciecap(struct pci_devinst *pi, int type) int err; struct pciecap pciecap; - if (type != PCIEM_TYPE_ROOT_PORT) - return (-1); - bzero(&pciecap, sizeof(pciecap)); + /* + * Use the integrated endpoint type for endpoints on a root complex bus. + * + * NB: bhyve currently only supports a single PCI bus that is the root + * complex bus, so all endpoints are integrated. + */ + if ((type == PCIEM_TYPE_ENDPOINT) && (pi->pi_bus == 0)) + type = PCIEM_TYPE_ROOT_INT_EP; + pciecap.capid = PCIY_EXPRESS; - pciecap.pcie_capabilities = PCIECAP_VERSION | PCIEM_TYPE_ROOT_PORT; - pciecap.link_capabilities = 0x411; /* gen1, x1 */ - pciecap.link_status = 0x11; /* gen1, x1 */ + pciecap.pcie_capabilities = PCIECAP_VERSION | type; + if (type != PCIEM_TYPE_ROOT_INT_EP) { + pciecap.link_capabilities = 0x411; /* gen1, x1 */ + pciecap.link_status = 0x11; /* gen1, x1 */ + } err = pci_emul_add_capability(pi, (u_char *)&pciecap, sizeof(pciecap)); return (err); Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sat Jul 27 17:48:35 2019 (r350380) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sat Jul 27 17:52:45 2019 (r350381) @@ -1925,6 +1925,12 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p goto done; } + error = pci_emul_add_pciecap(pi, PCIEM_TYPE_ROOT_INT_EP); + if (error) { + WPRINTF(("%s pci add Express capability failed\r\n", __func__)); + goto done; + } + pthread_mutex_init(&sc->mtx, NULL); sem_init(&sc->iosemlock, 0, sc->ioslots); From owner-svn-src-all@freebsd.org Sat Jul 27 17:59: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 C4461BEF79; Sat, 27 Jul 2019 17:59: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 A54DF8F60D; Sat, 27 Jul 2019 17:59:31 +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 70B4B300F; Sat, 27 Jul 2019 17:59:31 +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 x6RHxVlr096060; Sat, 27 Jul 2019 17:59:31 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RHxVip096059; Sat, 27 Jul 2019 17:59:31 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201907271759.x6RHxVip096059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Sat, 27 Jul 2019 17:59: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: r350382 - in stable/12: sys/net usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: in stable/12: sys/net usr.sbin/bhyve X-SVN-Commit-Revision: 350382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A54DF8F60D 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.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: Sat, 27 Jul 2019 17:59:31 -0000 Author: chuck Date: Sat Jul 27 17:59:30 2019 New Revision: 350382 URL: https://svnweb.freebsd.org/changeset/base/350382 Log: MFC r349969 bhyve: Create EUI64 for NVMe namespaces Accept an IEEE Extended Unique Identifier (EUI-64) from the command line for each NVMe namespace. If one isn't provided, it will create one based on the CRC16 of: - the FreeBSD IEEE OUI - PCI bus, device/slot, function values - Namespace ID Approved by: imp (mentor) Modified: stable/12/sys/net/ieee_oui.h stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/ieee_oui.h ============================================================================== --- stable/12/sys/net/ieee_oui.h Sat Jul 27 17:52:45 2019 (r350381) +++ stable/12/sys/net/ieee_oui.h Sat Jul 27 17:59:30 2019 (r350382) @@ -77,4 +77,9 @@ */ #define OUI_FREEBSD_GENERATED_MASK 0x10ffff #define OUI_FREEBSD_GENERATED_LOW OUI_FREEBSD(0x100000) -#define OUI_FREEBSD_GENERATED_HIGH OUI_FREEBSD(OU_FREEBSD_GENERATED_MASK) +#define OUI_FREEBSD_GENERATED_HIGH OUI_FREEBSD(OUI_FREEBSD_GENERATED_MASK) + +/* 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) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sat Jul 27 17:52:45 2019 (r350381) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sat Jul 27 17:59:30 2019 (r350382) @@ -4,6 +4,9 @@ * Copyright (c) 2017 Shunsuke Mie * Copyright (c) 2018 Leon Dang * + * Function crc16 Copyright (c) 2017, Fedor Uporov + * Obtained from function ext2_crc16() in sys/fs/ext2fs/ext2_csum.c + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -30,7 +33,7 @@ * bhyve PCIe-NVMe device emulation. * * options: - * -s ,nvme,devpath,maxq=#,qsz=#,ioslots=#,sectsz=#,ser=A-Z + * -s ,nvme,devpath,maxq=#,qsz=#,ioslots=#,sectsz=#,ser=A-Z,eui64=# * * accepted devpath: * /dev/blockdev @@ -42,6 +45,7 @@ * ioslots = max number of concurrent io requests * sectsz = sector size (defaults to blockif sector size) * ser = serial number (20-chars max) + * eui64 = IEEE Extended Unique Identifier (8 byte value) * */ @@ -54,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -164,6 +169,7 @@ struct pci_nvme_blockstore { uint64_t size; uint32_t sectsz; uint32_t sectsz_bits; + uint64_t eui64; }; struct pci_nvme_ioreq { @@ -352,23 +358,87 @@ pci_nvme_init_ctrldata(struct pci_nvme_softc *sc) cd->power_state[0].mp = 10; } -static void -pci_nvme_init_nsdata(struct pci_nvme_softc *sc) +/* + * Calculate the CRC-16 of the given buffer + * See copyright attribution at top of file + */ +static uint16_t +crc16(uint16_t crc, const void *buffer, unsigned int len) { - struct nvme_namespace_data *nd; + const unsigned char *cp = buffer; + /* CRC table for the CRC-16. The poly is 0x8005 (x16 + x15 + x2 + 1). */ + static uint16_t const crc16_table[256] = { + 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, + 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, + 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40, + 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841, + 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, + 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41, + 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641, + 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040, + 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, + 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441, + 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41, + 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, + 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41, + 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40, + 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640, + 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041, + 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240, + 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441, + 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41, + 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840, + 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41, + 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40, + 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640, + 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041, + 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241, + 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440, + 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40, + 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841, + 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40, + 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41, + 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641, + 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 + }; - nd = &sc->nsdata; + while (len--) + crc = (((crc >> 8) & 0xffU) ^ + crc16_table[(crc ^ *cp++) & 0xffU]) & 0x0000ffffU; + return crc; +} +static void +pci_nvme_init_nsdata(struct pci_nvme_softc *sc, + struct nvme_namespace_data *nd, uint32_t nsid, + uint64_t eui64) +{ + nd->nsze = sc->nvstore.size / sc->nvstore.sectsz; nd->ncap = nd->nsze; nd->nuse = nd->nsze; /* Get LBA and backstore information from backing store */ nd->nlbaf = 0; /* NLBAF is a 0's based value (i.e. 1 LBA Format) */ + nd->flbas = 0; + + /* Create an EUI-64 if user did not provide one */ + if (eui64 == 0) { + char *data = NULL; + + asprintf(&data, "%s%u%u%u", vmname, sc->nsc_pi->pi_bus, + sc->nsc_pi->pi_slot, sc->nsc_pi->pi_func); + + if (data != NULL) { + eui64 = OUI_FREEBSD_NVME_LOW | crc16(0, data, strlen(data)); + free(data); + } + eui64 = (eui64 << 16) | (nsid & 0xffff); + } + be64enc(nd->eui64, eui64); + /* LBA data-sz = 2^lbads */ nd->lbaf[0] = sc->nvstore.sectsz_bits << NVME_NS_DATA_LBAF_LBADS_SHIFT; - - nd->flbas = 0; } static void @@ -1816,6 +1886,8 @@ pci_nvme_parse_opts(struct pci_nvme_softc *sc, char *o free(uopt); return (-1); } + } else if (!strcmp("eui64", xopts)) { + sc->nvstore.eui64 = htobe64(strtoull(config, NULL, 0)); } else if (optidx == 0) { snprintf(bident, sizeof(bident), "%d:%d", sc->nsc_pi->pi_slot, sc->nsc_pi->pi_func); @@ -1936,7 +2008,7 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p pci_nvme_reset(sc); pci_nvme_init_ctrldata(sc); - pci_nvme_init_nsdata(sc); + pci_nvme_init_nsdata(sc, &sc->nsdata, 1, sc->nvstore.eui64); pci_nvme_init_logpages(sc); pci_lintr_request(pi); From owner-svn-src-all@freebsd.org Sat Jul 27 18:07: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 1596BBF2A8; Sat, 27 Jul 2019 18:07:47 +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 EC3268FC8F; Sat, 27 Jul 2019 18:07:46 +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 DCE3B31D0; Sat, 27 Jul 2019 18:07:46 +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 x6RI7kiQ002271; Sat, 27 Jul 2019 18:07:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RI7kdJ002270; Sat, 27 Jul 2019 18:07:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201907271807.x6RI7kdJ002270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 27 Jul 2019 18:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350383 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 350383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC3268FC8F 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.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: Sat, 27 Jul 2019 18:07:47 -0000 Author: mav Date: Sat Jul 27 18:07:46 2019 New Revision: 350383 URL: https://svnweb.freebsd.org/changeset/base/350383 Log: Reenable UNMAP support on ramdisks by default. For some reason, I guess just mechanical editing, it was disable in r333446. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Sat Jul 27 17:59:30 2019 (r350382) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Sat Jul 27 18:07:46 2019 (r350383) @@ -1073,7 +1073,7 @@ ctl_backend_ramdisk_create(struct ctl_be_ramdisk_softc params->lun_size_bytes = be_lun->size_bytes; value = dnvlist_get_string(cbe_lun->options, "unmap", NULL); - if (value != NULL && strcmp(value, "off") != 0) + if (value == NULL || strcmp(value, "off") != 0) cbe_lun->flags |= CTL_LUN_FLAG_UNMAP; value = dnvlist_get_string(cbe_lun->options, "readonly", NULL); if (value != NULL) { From owner-svn-src-all@freebsd.org Sat Jul 27 19:29: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 3432AC0885; Sat, 27 Jul 2019 19:29:24 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 155D26B75D; Sat, 27 Jul 2019 19:29:24 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E860042DF; Sat, 27 Jul 2019 19:29:23 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6RJTNqf049247; Sat, 27 Jul 2019 19:29:23 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RJTNS3049246; Sat, 27 Jul 2019 19:29:23 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201907271929.x6RJTNS3049246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sat, 27 Jul 2019 19:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350384 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 350384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 155D26B75D 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.90)[-0.904,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, 27 Jul 2019 19:29:24 -0000 Author: fsu Date: Sat Jul 27 19:29:23 2019 New Revision: 350384 URL: https://svnweb.freebsd.org/changeset/base/350384 Log: MFC r349800,r349801: Fix misc fs fuzzing issues. Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE Reported as: FS-22-EXT2-9: Denial of service in ftruncate-0 (ext2_balloc) FS-11-EXT2-6: Denial Of Service in write-1 (ext2_balloc) Modified: stable/12/sys/fs/ext2fs/ext2_balloc.c Modified: stable/12/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_balloc.c Sat Jul 27 18:07:46 2019 (r350383) +++ stable/12/sys/fs/ext2fs/ext2_balloc.c Sat Jul 27 19:29:23 2019 (r350384) @@ -62,7 +62,7 @@ ext2_ext_balloc(struct inode *ip, uint32_t lbn, int si struct buf *bp = NULL; struct vnode *vp = ITOV(ip); daddr_t newblk; - int osize, nsize, blks, error, allocated; + int blks, error, allocated; fs = ip->i_e2fs; blks = howmany(size, fs->e2fs_bsize); @@ -72,47 +72,22 @@ ext2_ext_balloc(struct inode *ip, uint32_t lbn, int si return (error); if (allocated) { - if (ip->i_size < (lbn + 1) * fs->e2fs_bsize) - nsize = fragroundup(fs, size); - else - nsize = fs->e2fs_bsize; - - bp = getblk(vp, lbn, nsize, 0, 0, 0); + bp = getblk(vp, lbn, fs->e2fs_bsize, 0, 0, 0); if(!bp) return (EIO); - - bp->b_blkno = fsbtodb(fs, newblk); - if (flags & BA_CLRBUF) - vfs_bio_clrbuf(bp); } else { - if (ip->i_size >= (lbn + 1) * fs->e2fs_bsize) { - - error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp); - if (error) { - brelse(bp); - return (error); - } - bp->b_blkno = fsbtodb(fs, newblk); - *bpp = bp; - return (0); - } - - /* - * Consider need to reallocate a fragment. - */ - osize = fragroundup(fs, blkoff(fs, ip->i_size)); - nsize = fragroundup(fs, size); - if (nsize <= osize) - error = bread(vp, lbn, osize, NOCRED, &bp); - else - error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp); + error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp); if (error) { brelse(bp); return (error); } - bp->b_blkno = fsbtodb(fs, newblk); } + + bp->b_blkno = fsbtodb(fs, newblk); + if (flags & BA_CLRBUF) + vfs_bio_clrbuf(bp); + *bpp = bp; return (error); @@ -134,7 +109,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size struct indir indirs[EXT2_NIADDR + 2]; e4fs_daddr_t nb, newb; e2fs_daddr_t *bap, pref; - int osize, nsize, num, i, error; + int num, i, error; *bpp = NULL; if (lbn < 0) @@ -164,53 +139,22 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size * no new block is to be allocated, and no need to expand * the file */ - if (nb != 0 && ip->i_size >= (lbn + 1) * fs->e2fs_bsize) { + if (nb != 0) { error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp); if (error) { brelse(bp); return (error); } bp->b_blkno = fsbtodb(fs, nb); - *bpp = bp; - return (0); - } - if (nb != 0) { - /* - * Consider need to reallocate a fragment. - */ - osize = fragroundup(fs, blkoff(fs, ip->i_size)); - nsize = fragroundup(fs, size); - if (nsize <= osize) { - error = bread(vp, lbn, osize, NOCRED, &bp); - if (error) { - brelse(bp); - return (error); - } - bp->b_blkno = fsbtodb(fs, nb); - } else { - /* - * Godmar thinks: this shouldn't happen w/o - * fragments - */ - printf("nsize %d(%d) > osize %d(%d) nb %d\n", - (int)nsize, (int)size, (int)osize, - (int)ip->i_size, (int)nb); - panic( - "ext2_balloc: Something is terribly wrong"); -/* - * please note there haven't been any changes from here on - - * FFS seems to work. - */ + if (ip->i_size >= (lbn + 1) * fs->e2fs_bsize) { + *bpp = bp; + return (0); } } else { - if (ip->i_size < (lbn + 1) * fs->e2fs_bsize) - nsize = fragroundup(fs, size); - else - nsize = fs->e2fs_bsize; EXT2_LOCK(ump); error = ext2_alloc(ip, lbn, ext2_blkpref(ip, lbn, (int)lbn, &ip->i_db[0], 0), - nsize, cred, &newb); + fs->e2fs_bsize, cred, &newb); if (error) return (error); /* @@ -219,7 +163,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size */ if (newb > UINT_MAX) return (EFBIG); - bp = getblk(vp, lbn, nsize, 0, 0, 0); + bp = getblk(vp, lbn, fs->e2fs_bsize, 0, 0, 0); bp->b_blkno = fsbtodb(fs, newb); if (flags & BA_CLRBUF) vfs_bio_clrbuf(bp); @@ -308,7 +252,6 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size */ if ((error = bwrite(nbp)) != 0) { ext2_blkfree(ip, nb, fs->e2fs_bsize); - EXT2_UNLOCK(ump); brelse(bp); return (error); } From owner-svn-src-all@freebsd.org Sat Jul 27 19:29: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 C3D73C08B3; Sat, 27 Jul 2019 19:29:29 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (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 9A5236B7A1; Sat, 27 Jul 2019 19:29:29 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06F0542E0; Sat, 27 Jul 2019 19:29:29 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6RJTSBG049298; Sat, 27 Jul 2019 19:29:28 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6RJTSos049297; Sat, 27 Jul 2019 19:29:28 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201907271929.x6RJTSos049297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sat, 27 Jul 2019 19:29:28 +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: r350385 - stable/11/sys/fs/ext2fs X-SVN-Group: stable-11 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/11/sys/fs/ext2fs X-SVN-Commit-Revision: 350385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A5236B7A1 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)[-1.000,0]; NEURAL_HAM_SHORT(-0.90)[-0.904,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, 27 Jul 2019 19:29:29 -0000 Author: fsu Date: Sat Jul 27 19:29:28 2019 New Revision: 350385 URL: https://svnweb.freebsd.org/changeset/base/350385 Log: MFC r349800,r349801,r349802: Fix misc fs fuzzing issues. Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE Reported as: FS-27-EXT2-12: Denial of Service in openat-0 (vm_fault_hold/ext2_clusteracct) FS-22-EXT2-9: Denial of service in ftruncate-0 (ext2_balloc) FS-11-EXT2-6: Denial Of Service in write-1 (ext2_balloc) Modified: stable/11/sys/fs/ext2fs/ext2_balloc.c stable/11/sys/fs/ext2fs/ext2_vfsops.c Modified: stable/11/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- stable/11/sys/fs/ext2fs/ext2_balloc.c Sat Jul 27 19:29:23 2019 (r350384) +++ stable/11/sys/fs/ext2fs/ext2_balloc.c Sat Jul 27 19:29:28 2019 (r350385) @@ -67,7 +67,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size struct indir indirs[NIADDR + 2]; e4fs_daddr_t nb, newb; e2fs_daddr_t *bap, pref; - int osize, nsize, num, i, error; + int num, i, error; *bpp = NULL; if (lbn < 0) @@ -93,56 +93,25 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size * no new block is to be allocated, and no need to expand * the file */ - if (nb != 0 && ip->i_size >= (lbn + 1) * fs->e2fs_bsize) { + if (nb != 0) { error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp); if (error) { brelse(bp); return (error); } bp->b_blkno = fsbtodb(fs, nb); - *bpp = bp; - return (0); - } - if (nb != 0) { - /* - * Consider need to reallocate a fragment. - */ - osize = fragroundup(fs, blkoff(fs, ip->i_size)); - nsize = fragroundup(fs, size); - if (nsize <= osize) { - error = bread(vp, lbn, osize, NOCRED, &bp); - if (error) { - brelse(bp); - return (error); - } - bp->b_blkno = fsbtodb(fs, nb); - } else { - /* - * Godmar thinks: this shouldn't happen w/o - * fragments - */ - printf("nsize %d(%d) > osize %d(%d) nb %d\n", - (int)nsize, (int)size, (int)osize, - (int)ip->i_size, (int)nb); - panic( - "ext2_balloc: Something is terribly wrong"); -/* - * please note there haven't been any changes from here on - - * FFS seems to work. - */ + if (ip->i_size >= (lbn + 1) * fs->e2fs_bsize) { + *bpp = bp; + return (0); } } else { - if (ip->i_size < (lbn + 1) * fs->e2fs_bsize) - nsize = fragroundup(fs, size); - else - nsize = fs->e2fs_bsize; EXT2_LOCK(ump); error = ext2_alloc(ip, lbn, ext2_blkpref(ip, lbn, (int)lbn, &ip->i_db[0], 0), - nsize, cred, &newb); + fs->e2fs_bsize, cred, &newb); if (error) return (error); - bp = getblk(vp, lbn, nsize, 0, 0, 0); + bp = getblk(vp, lbn, fs->e2fs_bsize, 0, 0, 0); bp->b_blkno = fsbtodb(fs, newb); if (flags & BA_CLRBUF) vfs_bio_clrbuf(bp); @@ -227,7 +196,6 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size */ if ((error = bwrite(nbp)) != 0) { ext2_blkfree(ip, nb, fs->e2fs_bsize); - EXT2_UNLOCK(ump); brelse(bp); return (error); } Modified: stable/11/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/11/sys/fs/ext2fs/ext2_vfsops.c Sat Jul 27 19:29:23 2019 (r350384) +++ stable/11/sys/fs/ext2fs/ext2_vfsops.c Sat Jul 27 19:29:28 2019 (r350385) @@ -375,8 +375,11 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es return (EINVAL); } /* Check for group size */ - if (fs->e2fs_bpg == 0) { - printf("ext2fs: zero blocks per group\n"); + if (fs->e2fs_bpg == 0 || fs->e2fs_fpg == 0) { + printf("ext2fs: zero blocks/fragments per group"); + return (EINVAL); + } else if (fs->e2fs_bpg != fs->e2fs_fpg) { + printf("ext2fs: blocks per group not equal fragments per group"); return (EINVAL); } if (fs->e2fs_bpg != fs->e2fs_bsize * 8) {