From owner-svn-src-all@freebsd.org Sun Dec 30 00:27:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 215581431BCB; Sun, 30 Dec 2018 00:27:29 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA1EA8B5BC; Sun, 30 Dec 2018 00:27:28 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FA781AAF8; Sun, 30 Dec 2018 00:27:28 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU0RSsP063061; Sun, 30 Dec 2018 00:27:28 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU0RSpv063060; Sun, 30 Dec 2018 00:27:28 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201812300027.wBU0RSpv063060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sun, 30 Dec 2018 00:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342602 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 342602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA1EA8B5BC 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.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 00:27:29 -0000 Author: 0mp (ports committer) Date: Sun Dec 30 00:27:28 2018 New Revision: 342602 URL: https://svnweb.freebsd.org/changeset/base/342602 Log: ports.7: Add an example of getting dependencies without building them While here, improve formatting of the EXAMPLES section in general. Reviewed by: bcr Approved by: bcr (doc) Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D18682 Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Sat Dec 29 23:08:59 2018 (r342601) +++ head/share/man/man7/ports.7 Sun Dec 30 00:27:28 2018 (r342602) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2018 +.Dd December 30, 2018 .Dt PORTS 7 .Os .Sh NAME @@ -537,11 +537,33 @@ The default ports directory. The big Kahuna. .El .Sh EXAMPLES -Build and install Emacs: -.Bd -literal -offset indent -cd /usr/ports/editors/emacs -make install +.Bl -tag -width 0n +.It Sy Example 1\&: No Building and Installing a Port +.Pp +The following command builds and installs Emacs. +.Bd -literal -offset 2n +.Li # Ic cd /usr/ports/editors/emacs +.Li # Ic make install .Ed +.It Sy Example 2\&: No Installing Dependencies with Xr pkg 8 +.Pp +The following examples shows how to build and install a port without having to +build its dependencies. +Instead, the dependencies are downloaded via +.Xr pkg 8 . +.Bd -literal -offset 2n +.Li # Ic make missing | xargs pkg install --automatic --yes +.Li # Ic make install +.Ed +.Pp +It is especially useful, when the dependencies are costly +in time and resources to build +.Pq like Pa lang/rust . +The drawback is that +.Xr pkg 8 +offers only packages built with the default set of +.Va OPTIONS . +.El .Sh SEE ALSO .Xr make 1 , .Xr make.conf 5 , From owner-svn-src-all@freebsd.org Sun Dec 30 01:57:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 819F1143528F; Sun, 30 Dec 2018 01:57:12 +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 26CB18E867; Sun, 30 Dec 2018 01:57:12 +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 1A2341BFB1; Sun, 30 Dec 2018 01:57:12 +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 wBU1vB5l010085; Sun, 30 Dec 2018 01:57:11 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU1vBaD010084; Sun, 30 Dec 2018 01:57:11 GMT (envelope-from np@FreeBSD.org) Message-Id: <201812300157.wBU1vBaD010084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 30 Dec 2018 01:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342603 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 342603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 26CB18E867 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.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 01:57:12 -0000 Author: np Date: Sun Dec 30 01:57:11 2018 New Revision: 342603 URL: https://svnweb.freebsd.org/changeset/base/342603 Log: cxgbe(4): Attach to two T540 variants. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Dec 30 00:27:28 2018 (r342602) +++ head/sys/dev/cxgbe/t4_main.c Sun Dec 30 01:57:11 2018 (r342603) @@ -736,6 +736,10 @@ struct { {0x5419, "Chelsio T540-LP-BT"}, /* 4 x 10GBaseT */ {0x541a, "Chelsio T540-SO-BT"}, /* 4 x 10GBaseT, nomem */ {0x541b, "Chelsio T540-SO-CR"}, /* 4 x 10G, nomem */ + + /* Custom */ + {0x5483, "Custom T540-CR"}, + {0x5484, "Custom T540-BT"}, }, t6_pciids[] = { {0xc006, "Chelsio Terminator 6 FPGA"}, /* T6 PE10K6 FPGA (PF0) */ {0x6400, "Chelsio T6-DBG-25"}, /* 2 x 10/25G, debug */ From owner-svn-src-all@freebsd.org Sun Dec 30 04:31:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03EFB143B003; Sun, 30 Dec 2018 04:31:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E1006D7D9; Sun, 30 Dec 2018 04:31:51 +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 913401DC57; Sun, 30 Dec 2018 04:31:51 +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 wBU4Vp7s093856; Sun, 30 Dec 2018 04:31:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4VpKc093855; Sun, 30 Dec 2018 04:31:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300431.wBU4VpKc093855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342606 - in stable: 10/sys/contrib/ipfilter/netinet 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: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9E1006D7D9 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.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 04:31:52 -0000 Author: cy Date: Sun Dec 30 04:31:51 2018 New Revision: 342606 URL: https://svnweb.freebsd.org/changeset/base/342606 Log: MFC r341279: Clean up a redundant non-redefinition of IFNAMSIZ. IFNAMSIZ is defined in net/if.h, therefore the condition is never met and confusing to those who follow. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:25:48 2018 (r342605) +++ stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:31:51 2018 (r342606) @@ -1400,10 +1400,6 @@ typedef struct tcpiphdr tcpiphdr_t; #undef ICMP_MAXTYPE #define ICMP_MAXTYPE 18 -#ifndef IFNAMSIZ -#define IFNAMSIZ 16 -#endif - #ifndef LOG_FTP # define LOG_FTP (11<<3) #endif From owner-svn-src-all@freebsd.org Sun Dec 30 04:42:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5140143B44B; Sun, 30 Dec 2018 04:42:02 +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 8CC556E037; Sun, 30 Dec 2018 04:42:02 +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 7DE6A1DE3A; Sun, 30 Dec 2018 04:42:02 +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 wBU4g2ck099147; Sun, 30 Dec 2018 04:42:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4g236099146; Sun, 30 Dec 2018 04:42:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300442.wBU4g236099146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:42:02 +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: r342608 - in stable: 10/sys/contrib/ipfilter/netinet 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: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8CC556E037 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.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 04:42:03 -0000 Author: cy Date: Sun Dec 30 04:42:01 2018 New Revision: 342608 URL: https://svnweb.freebsd.org/changeset/base/342608 Log: MFC r342547: Remove another empty #ifdef block. This empty block also exists in the upstream HEAD. 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/10/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/fil.c Sun Dec 30 04:37:49 2018 (r342607) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Sun Dec 30 04:42:01 2018 (r342608) @@ -4266,8 +4266,6 @@ copyoutptr(softc, src, dst, size) } return error; } -#ifdef _KERNEL -#endif /* ------------------------------------------------------------------------ */ From owner-svn-src-all@freebsd.org Sun Dec 30 09:05:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5F4D141F011; Sun, 30 Dec 2018 09:05:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5925975725; Sun, 30 Dec 2018 09:05:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D8CC20BC5; Sun, 30 Dec 2018 09:05:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU953pq037033; Sun, 30 Dec 2018 09:05:03 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU953FI037032; Sun, 30 Dec 2018 09:05:03 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201812300905.wBU953FI037032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 30 Dec 2018 09:05: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: r342617 - stable/12/stand/efi/libefi X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/efi/libefi X-SVN-Commit-Revision: 342617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5925975725 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.91)[-0.909,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 09:05:04 -0000 Author: tsoome Date: Sun Dec 30 09:05:02 2018 New Revision: 342617 URL: https://svnweb.freebsd.org/changeset/base/342617 Log: MFC r341329: loader.efi: fix EFI getchar() for multiple consoles This fix is ported from illumos (issue #9970), the analysis and initial implementation was done by John Levon. See also: https://www.illumos.org/issues/9970 Currently, efi_cons_getchar() will wait for a key. While this seems to make sense, the implementation of getchar() in common/console.c will loop across getchar() for all consoles without doing ischar() first. This means that if we've configured multiple consoles, we can't input into the serial, as getchar() will be sat waiting for input only from efi_console.c This patch does implement a bit more generic key buffer to support translation of input keys, and we use generic efi_readkey() to reduce duplication from calls from getchar() and poll(). Relnotes: yes Modified: stable/12/stand/efi/libefi/efi_console.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/efi/libefi/efi_console.c ============================================================================== --- stable/12/stand/efi/libefi/efi_console.c Sun Dec 30 08:58:31 2018 (r342616) +++ stable/12/stand/efi/libefi/efi_console.c Sun Dec 30 09:05:02 2018 (r342617) @@ -51,7 +51,8 @@ void HO(void); void end_term(void); #endif -static EFI_INPUT_KEY key_cur; +#define KEYBUFSZ 10 +static unsigned keybuf[KEYBUFSZ]; /* keybuf for extended codes */ static int key_pending; static void efi_cons_probe(struct console *); @@ -438,55 +439,120 @@ efi_cons_putchar(int c) #endif } -int -efi_cons_getchar() +static int +keybuf_getchar(void) { - EFI_INPUT_KEY key; - EFI_STATUS status; - UINTN junk; + int i, c = 0; - if (key_pending) { - key = key_cur; - key_pending = 0; - } else { - /* Try to read a key stroke. We wait for one if none is pending. */ - status = conin->ReadKeyStroke(conin, &key); - while (status == EFI_NOT_READY) { - /* Some EFI implementation (u-boot for example) do not support WaitForKey */ - if (conin->WaitForKey != NULL) - BS->WaitForEvent(1, &conin->WaitForKey, &junk); - status = conin->ReadKeyStroke(conin, &key); + for (i = 0; i < KEYBUFSZ; i++) { + if (keybuf[i] != 0) { + c = keybuf[i]; + keybuf[i] = 0; + break; } } - switch (key.ScanCode) { - case 0x17: /* ESC */ - return (0x1b); /* esc */ + return (c); +} + +static bool +keybuf_ischar(void) +{ + int i; + + for (i = 0; i < KEYBUFSZ; i++) { + if (keybuf[i] != 0) + return (true); } + return (false); +} - /* this can return */ - return (key.UnicodeChar); +/* + * We are not reading input before keybuf is empty, so we are safe + * just to fill keybuf from the beginning. + */ +static void +keybuf_inschar(EFI_INPUT_KEY *key) +{ + + switch (key->ScanCode) { + case 0x1: /* UP */ + keybuf[0] = 0x1b; /* esc */ + keybuf[1] = '['; + keybuf[2] = 'A'; + break; + case 0x2: /* DOWN */ + keybuf[0] = 0x1b; /* esc */ + keybuf[1] = '['; + keybuf[2] = 'B'; + break; + case 0x3: /* RIGHT */ + keybuf[0] = 0x1b; /* esc */ + keybuf[1] = '['; + keybuf[2] = 'C'; + break; + case 0x4: /* LEFT */ + keybuf[0] = 0x1b; /* esc */ + keybuf[1] = '['; + keybuf[2] = 'D'; + break; + case 0x17: + keybuf[0] = 0x1b; /* esc */ + break; + default: + keybuf[0] = key->UnicodeChar; + break; + } } -int -efi_cons_poll() +static bool +efi_readkey(void) { - EFI_INPUT_KEY key; EFI_STATUS status; + EFI_INPUT_KEY key; - if (conin->WaitForKey == NULL) { - if (key_pending) - return (1); - status = conin->ReadKeyStroke(conin, &key); - if (status == EFI_SUCCESS) { - key_cur = key; - key_pending = 1; - } - return (key_pending); + status = conin->ReadKeyStroke(conin, &key); + if (status == EFI_SUCCESS) { + keybuf_inschar(&key); + return (true); } + return (false); +} - /* This can clear the signaled state. */ - return (BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS); +int +efi_cons_getchar(void) +{ + int c; + + if ((c = keybuf_getchar()) != 0) + return (c); + + key_pending = 0; + + if (efi_readkey()) + return (keybuf_getchar()); + + return (-1); +} + +int +efi_cons_poll(void) +{ + + if (keybuf_ischar() || key_pending) + return (1); + + /* + * Some EFI implementation (u-boot for example) do not support + * WaitForKey(). + * CheckEvent() can clear the signaled state. + */ + if (conin->WaitForKey == NULL) + key_pending = efi_readkey(); + else + key_pending = BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS; + + return (key_pending); } /* Plain direct access to EFI OutputString(). */ From owner-svn-src-all@freebsd.org Sun Dec 30 04:31:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFCF8143B00B; Sun, 30 Dec 2018 04:31:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 763BF6D7E1; Sun, 30 Dec 2018 04:31:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 424521DC5A; Sun, 30 Dec 2018 04:31:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU4Vqeb093868; Sun, 30 Dec 2018 04:31:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4VqMw093867; Sun, 30 Dec 2018 04:31:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300431.wBU4VqMw093867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342606 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 763BF6D7E1 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.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 04:31:53 -0000 Author: cy Date: Sun Dec 30 04:31:51 2018 New Revision: 342606 URL: https://svnweb.freebsd.org/changeset/base/342606 Log: MFC r341279: Clean up a redundant non-redefinition of IFNAMSIZ. IFNAMSIZ is defined in net/if.h, therefore the condition is never met and confusing to those who follow. Modified: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:25:48 2018 (r342605) +++ stable/10/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:31:51 2018 (r342606) @@ -1386,10 +1386,6 @@ typedef struct tcpiphdr tcpiphdr_t; #undef ICMP_MAXTYPE #define ICMP_MAXTYPE 18 -#ifndef IFNAMSIZ -#define IFNAMSIZ 16 -#endif - #ifndef LOG_FTP # define LOG_FTP (11<<3) #endif From owner-svn-src-all@freebsd.org Sun Dec 30 03:03:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 742531438A3E; Sun, 30 Dec 2018 03:03:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1572A6AD8C; Sun, 30 Dec 2018 03:03:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08FE21CD01; Sun, 30 Dec 2018 03:03:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU33rmA047397; Sun, 30 Dec 2018 03:03:53 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU33r23047396; Sun, 30 Dec 2018 03:03:53 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201812300303.wBU33r23047396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 30 Dec 2018 03:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342604 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 342604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1572A6AD8C 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)[-0.998,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, 30 Dec 2018 03:03:54 -0000 Author: avos Date: Sun Dec 30 03:03:53 2018 New Revision: 342604 URL: https://svnweb.freebsd.org/changeset/base/342604 Log: net80211: fix duplicate sequence number bump for non-AMPDU QoS frames. This should be a part of r312972. MFC after: 4 days Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sun Dec 30 01:57:11 2018 (r342603) +++ head/sys/net80211/ieee80211_output.c Sun Dec 30 03:03:53 2018 (r342604) @@ -1698,7 +1698,6 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee8 * capability; this may also change when we pull * aggregation up into net80211 */ - seqno = ni->ni_txseqs[tid]++; *(uint16_t *)wh->i_seq = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); M_SEQNO_SET(m, seqno); From owner-svn-src-all@freebsd.org Sun Dec 30 04:25:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C7A3143AA56; Sun, 30 Dec 2018 04:25:49 +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 2FEBE6D0C4; Sun, 30 Dec 2018 04:25:49 +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 1DC5C1DBB5; Sun, 30 Dec 2018 04:25:49 +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 wBU4Pm36089025; Sun, 30 Dec 2018 04:25:48 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4PmgB089024; Sun, 30 Dec 2018 04:25:48 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300425.wBU4PmgB089024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342605 - head/contrib/ipfilter X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter X-SVN-Commit-Revision: 342605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FEBE6D0C4 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]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2018 04:25:49 -0000 Author: cy Date: Sun Dec 30 04:25:48 2018 New Revision: 342605 URL: https://svnweb.freebsd.org/changeset/base/342605 Log: TCP_PAWS_IDLE is does not exist in NetBSD and illumos. In FreeBSD TCP_PAWS_IDLE is defined in netinet/tcp_seq.h, however this header isn't included explicitly or implicitly at this point therefore as far ipfilter is concerned TCP_PAWS_IDLE is not defined. Remove the #ifdef and include netinet/tcp.h unconditionally. MFC after: 1 week Modified: head/contrib/ipfilter/ipf.h Modified: head/contrib/ipfilter/ipf.h ============================================================================== --- head/contrib/ipfilter/ipf.h Sun Dec 30 03:03:53 2018 (r342604) +++ head/contrib/ipfilter/ipf.h Sun Dec 30 04:25:48 2018 (r342605) @@ -47,9 +47,7 @@ struct file; #include #include #include -#ifndef TCP_PAWS_IDLE /* IRIX */ # include -#endif #include #include From owner-svn-src-all@freebsd.org Sun Dec 30 04:31:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54E1A143B007; Sun, 30 Dec 2018 04:31:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF7B46D7DA; Sun, 30 Dec 2018 04:31:51 +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 E37C51DC58; Sun, 30 Dec 2018 04:31:51 +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 wBU4VphN093862; Sun, 30 Dec 2018 04:31:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4VpDJ093861; Sun, 30 Dec 2018 04:31:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300431.wBU4VpDJ093861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342606 - in stable: 10/sys/contrib/ipfilter/netinet 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: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF7B46D7DA 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.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 04:31:52 -0000 Author: cy Date: Sun Dec 30 04:31:51 2018 New Revision: 342606 URL: https://svnweb.freebsd.org/changeset/base/342606 Log: MFC r341279: Clean up a redundant non-redefinition of IFNAMSIZ. IFNAMSIZ is defined in net/if.h, therefore the condition is never met and confusing to those who follow. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:25:48 2018 (r342605) +++ stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:31:51 2018 (r342606) @@ -1401,10 +1401,6 @@ typedef struct tcpiphdr tcpiphdr_t; #undef ICMP_MAXTYPE #define ICMP_MAXTYPE 18 -#ifndef IFNAMSIZ -#define IFNAMSIZ 16 -#endif - #ifndef LOG_FTP # define LOG_FTP (11<<3) #endif From owner-svn-src-all@freebsd.org Sun Dec 30 04:42:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B08EF143B453; Sun, 30 Dec 2018 04:42:03 +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 593556E03F; Sun, 30 Dec 2018 04:42:03 +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 1B37C1DE3D; Sun, 30 Dec 2018 04:42:03 +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 wBU4g2JO099159; Sun, 30 Dec 2018 04:42:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4g28V099158; Sun, 30 Dec 2018 04:42:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300442.wBU4g28V099158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342608 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 593556E03F 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.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 04:42:03 -0000 Author: cy Date: Sun Dec 30 04:42:01 2018 New Revision: 342608 URL: https://svnweb.freebsd.org/changeset/base/342608 Log: MFC r342547: Remove another empty #ifdef block. This empty block also exists in the upstream HEAD. Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/fil.c Sun Dec 30 04:37:49 2018 (r342607) +++ stable/10/sys/contrib/ipfilter/netinet/fil.c Sun Dec 30 04:42:01 2018 (r342608) @@ -4232,8 +4232,6 @@ copyoutptr(softc, src, dst, size) } return error; } -#ifdef _KERNEL -#endif /* ------------------------------------------------------------------------ */ From owner-svn-src-all@freebsd.org Sun Dec 30 08:30:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B95C141BFA4; Sun, 30 Dec 2018 08:30:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D442C744EC; Sun, 30 Dec 2018 08:30:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1D87204BB; Sun, 30 Dec 2018 08:30:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU8UBVx016190; Sun, 30 Dec 2018 08:30:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU8UB3r016189; Sun, 30 Dec 2018 08:30:11 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201812300830.wBU8UB3r016189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 30 Dec 2018 08:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342614 - head/share/timedef X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/share/timedef X-SVN-Commit-Revision: 342614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D442C744EC 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.930,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 08:30:12 -0000 Author: delphij Date: Sun Dec 30 08:30:11 2018 New Revision: 342614 URL: https://svnweb.freebsd.org/changeset/base/342614 Log: Properly set svn:mimetype for zh_CN.UTF-8.src. MFC after: 2 weeks Modified: Directory Properties: head/share/timedef/zh_CN.UTF-8.src (props changed) From owner-svn-src-all@freebsd.org Sun Dec 30 06:03:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51901143D5C3; Sun, 30 Dec 2018 06:03:21 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB3967055A; Sun, 30 Dec 2018 06:03:20 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D10E51ED21; Sun, 30 Dec 2018 06:03:20 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU63KgR041554; Sun, 30 Dec 2018 06:03:20 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU63KFK041553; Sun, 30 Dec 2018 06:03:20 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201812300603.wBU63KFK041553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 30 Dec 2018 06:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342610 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 342610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB3967055A 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]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2018 06:03:21 -0000 Author: mckusick Date: Sun Dec 30 06:03:20 2018 New Revision: 342610 URL: https://svnweb.freebsd.org/changeset/base/342610 Log: Move ASSERT_VOP_LOCKED to top of ufs_vinit() as it should be true when the function is entered. Suggested 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 Sun Dec 30 05:03:41 2018 (r342609) +++ head/sys/ufs/ufs/ufs_vnops.c Sun Dec 30 06:03:20 2018 (r342610) @@ -2515,6 +2515,7 @@ ufs_vinit(mntp, fifoops, vpp) struct vnode *vp; vp = *vpp; + ASSERT_VOP_LOCKED(vp, "ufs_vinit"); ip = VTOI(vp); vp->v_type = IFTOVT(ip->i_mode); /* @@ -2524,7 +2525,6 @@ ufs_vinit(mntp, fifoops, vpp) return (EINVAL); if (vp->v_type == VFIFO) vp->v_op = fifoops; - ASSERT_VOP_LOCKED(vp, "ufs_vinit"); if (ip->i_number == UFS_ROOTINO) vp->v_vflag |= VV_ROOT; *vpp = vp; From owner-svn-src-all@freebsd.org Sun Dec 30 05:03:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8C46143BEF3; Sun, 30 Dec 2018 05:03:42 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6F06ECDE; Sun, 30 Dec 2018 05:03:42 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 531C21E2E3; Sun, 30 Dec 2018 05:03:42 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU53gE4009967; Sun, 30 Dec 2018 05:03:42 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU53g2C009966; Sun, 30 Dec 2018 05:03:42 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201812300503.wBU53g2C009966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 30 Dec 2018 05:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342609 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 342609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F6F06ECDE 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]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 05:03:42 -0000 Author: mckusick Date: Sun Dec 30 05:03:41 2018 New Revision: 342609 URL: https://svnweb.freebsd.org/changeset/base/342609 Log: For consistency with FFS2's fifoops2 and both versions of FFS's vnodeops make FFS1's fifoops1 use ffs_lock. Also delete ffs_reallocblks from fifoops1 which is needed only for fifoops2 because of its support for extended attributes that need to allocate blocks. Suggested by: kib Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Sun Dec 30 04:42:01 2018 (r342608) +++ head/sys/ufs/ffs/ffs_vnops.c Sun Dec 30 05:03:41 2018 (r342609) @@ -144,7 +144,7 @@ struct vop_vector ffs_fifoops1 = { .vop_default = &ufs_fifoops, .vop_fsync = ffs_fsync, .vop_fdatasync = ffs_fdatasync, - .vop_reallocblks = ffs_reallocblks, /* XXX: really ??? */ + .vop_lock1 = ffs_lock, .vop_vptofh = ffs_vptofh, }; From owner-svn-src-all@freebsd.org Sun Dec 30 04:42:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F5FC143B44F; Sun, 30 Dec 2018 04:42:03 +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 C52B46E038; Sun, 30 Dec 2018 04:42:02 +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 B89601DE3B; Sun, 30 Dec 2018 04:42:02 +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 wBU4g2in099153; Sun, 30 Dec 2018 04:42:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4g2fG099152; Sun, 30 Dec 2018 04:42:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300442.wBU4g2fG099152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342608 - in stable: 10/sys/contrib/ipfilter/netinet 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: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C52B46E038 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.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 04:42:03 -0000 Author: cy Date: Sun Dec 30 04:42:01 2018 New Revision: 342608 URL: https://svnweb.freebsd.org/changeset/base/342608 Log: MFC r342547: Remove another empty #ifdef block. This empty block also exists in the upstream HEAD. 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/10/sys/contrib/ipfilter/netinet/fil.c stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/fil.c Sun Dec 30 04:37:49 2018 (r342607) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Sun Dec 30 04:42:01 2018 (r342608) @@ -4266,8 +4266,6 @@ copyoutptr(softc, src, dst, size) } return error; } -#ifdef _KERNEL -#endif /* ------------------------------------------------------------------------ */ From owner-svn-src-all@freebsd.org Sun Dec 30 15:17:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD72F142B5D5; Sun, 30 Dec 2018 15:17:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5451888E33; Sun, 30 Dec 2018 15:17:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3606B24C1D; Sun, 30 Dec 2018 15:17:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBUFH172032298; Sun, 30 Dec 2018 15:17:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFH12T032297; Sun, 30 Dec 2018 15:17:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301517.wBUFH12T032297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:17: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: r342620 - 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: 342620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5451888E33 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.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2018 15:17:01 -0000 Author: kib Date: Sun Dec 30 15:17:00 2018 New Revision: 342620 URL: https://svnweb.freebsd.org/changeset/base/342620 Log: MFC r342380: Properly test for vmio buffer in bnoreuselist(). Modified: stable/12/sys/kern/vfs_subr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/vfs_subr.c ============================================================================== --- stable/12/sys/kern/vfs_subr.c Sun Dec 30 09:35:47 2018 (r342619) +++ stable/12/sys/kern/vfs_subr.c Sun Dec 30 15:17:00 2018 (r342620) @@ -1840,7 +1840,7 @@ again: * reused. Dirty buffers will have the hint applied once * they've been written. */ - if (bp->b_vp->v_object != NULL) + if ((bp->b_flags & B_VMIO) != 0) bp->b_flags |= B_NOREUSE; brelse(bp); BO_RLOCK(bo); From owner-svn-src-all@freebsd.org Sun Dec 30 15:38:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADC43142BB27; Sun, 30 Dec 2018 15:38: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 50DE689C31; Sun, 30 Dec 2018 15:38: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 41BC124F91; Sun, 30 Dec 2018 15:38: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 wBUFc8IW042943; Sun, 30 Dec 2018 15:38:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFc79Y042941; Sun, 30 Dec 2018 15:38:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301538.wBUFc79Y042941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342627 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 342627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 50DE689C31 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.961,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2018 15:38:08 -0000 Author: kib Date: Sun Dec 30 15:38:07 2018 New Revision: 342627 URL: https://svnweb.freebsd.org/changeset/base/342627 Log: Implement zap_vma_ptes() for managed device objects. Reviewed by: markj Discussed with: hselasky Tested by: zeising MFC after: 1 week Sponsored by: Mellanox Technologies Differential revision: https://reviews.freebsd.org/D18606 Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm.h Sun Dec 30 15:34:12 2018 (r342626) +++ head/sys/compat/linuxkpi/common/include/linux/mm.h Sun Dec 30 15:38:07 2018 (r342627) @@ -180,12 +180,8 @@ apply_to_page_range(struct mm_struct *mm, unsigned lon return (-ENOTSUP); } -static inline int -zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, - unsigned long size) -{ - return (-ENOTSUP); -} +int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, + unsigned long size); static inline int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:34:12 2018 (r342626) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:38:07 2018 (r342627) @@ -672,6 +672,25 @@ static struct cdev_pager_ops linux_cdev_pager_ops[2] = }, }; +int +zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, + unsigned long size) +{ + vm_object_t obj; + vm_page_t m; + + obj = vma->vm_obj; + if (obj == NULL || (obj->flags & OBJ_UNMANAGED) != 0) + return (-ENOTSUP); + VM_OBJECT_RLOCK(obj); + for (m = vm_page_find_least(obj, OFF_TO_IDX(address)); + m != NULL && m->pindex < OFF_TO_IDX(address + size); + m = TAILQ_NEXT(m, listq)) + pmap_remove_all(m); + VM_OBJECT_RUNLOCK(obj); + return (0); +} + #define OPW(fp,td,code) ({ \ struct file *__fpop; \ __typeof(code) __retval; \ From owner-svn-src-all@freebsd.org Sun Dec 30 15:46:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6A22142BE11; Sun, 30 Dec 2018 15:46: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 925A58A139; Sun, 30 Dec 2018 15:46: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 7542525163; Sun, 30 Dec 2018 15:46: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 wBUFkkhA049135; Sun, 30 Dec 2018 15:46:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFkkmf049133; Sun, 30 Dec 2018 15:46:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301546.wBUFkkmf049133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342628 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 342628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 925A58A139 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)[-0.998,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: Sun, 30 Dec 2018 15:46:47 -0000 Author: kib Date: Sun Dec 30 15:46:45 2018 New Revision: 342628 URL: https://svnweb.freebsd.org/changeset/base/342628 Log: Fix linux_destroy_dev() behaviour when there are still files open from the destroying cdev. Currently linux_destroy_dev() waits for the reference count on the linux cdev to drain, and each open file hold the reference. Practically it means that linux_destroy_dev() is blocked until all userspace processes that have the cdev open, exit. FreeBSD devfs does not have such problem, because device refcount only prevents freeing of the cdev memory, and separate 'active methods' counter blocks destroy_dev() until all threads leave the cdevsw methods. After that, attempts to enter cdevsw methods are refused with an error. Implement somewhat similar mechanism for LinuxKPI cdevs. Demote cdev refcount to only mean a hold on the linux cdev memory. Add sirefs count to track both number of threads inside the cdev methods, and for single-bit indicator that cdev is being destroyed. In the later case, the call is redirected to the dummy cdev. Reviewed by: markj Discussed with: hselasky Tested by: zeising MFC after: 1 week Sponsored by: Mellanox Technologies Differential revision: https://reviews.freebsd.org/D18606 Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/cdev.h Sun Dec 30 15:38:07 2018 (r342627) +++ head/sys/compat/linuxkpi/common/include/linux/cdev.h Sun Dec 30 15:46:45 2018 (r342628) @@ -52,7 +52,8 @@ struct linux_cdev { struct cdev *cdev; dev_t dev; const struct file_operations *ops; - atomic_long_t refs; + u_int refs; + u_int siref; }; static inline void @@ -61,7 +62,7 @@ cdev_init(struct linux_cdev *cdev, const struct file_o kobject_init(&cdev->kobj, &linux_cdev_static_ktype); cdev->ops = ops; - atomic_long_set(&cdev->refs, 0); + cdev->refs = 1; } static inline struct linux_cdev * @@ -70,8 +71,9 @@ cdev_alloc(void) struct linux_cdev *cdev; cdev = kzalloc(sizeof(struct linux_cdev), M_WAITOK); - if (cdev) + if (cdev != NULL) kobject_init(&cdev->kobj, &linux_cdev_ktype); + cdev->refs = 1; return (cdev); } Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:38:07 2018 (r342627) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:46:45 2018 (r342628) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -100,6 +101,7 @@ MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compa #undef cdev #define RB_ROOT(head) (head)->rbh_root +static void linux_cdev_deref(struct linux_cdev *ldev); static struct vm_area_struct *linux_cdev_handle_find(void *handle); struct kobject linux_class_root; @@ -691,6 +693,52 @@ zap_vma_ptes(struct vm_area_struct *vma, unsigned long return (0); } +static struct file_operations dummy_ldev_ops = { + /* XXXKIB */ +}; + +static struct linux_cdev dummy_ldev = { + .ops = &dummy_ldev_ops, +}; + +#define LDEV_SI_DTR 0x0001 +#define LDEV_SI_REF 0x0002 + +static void +linux_get_fop(struct linux_file *filp, const struct file_operations **fop, + struct linux_cdev **dev) +{ + struct linux_cdev *ldev; + u_int siref; + + ldev = filp->f_cdev; + *fop = filp->f_op; + if (ldev != NULL) { + for (siref = ldev->siref;;) { + if ((siref & LDEV_SI_DTR) != 0) { + ldev = &dummy_ldev; + siref = ldev->siref; + *fop = ldev->ops; + MPASS((ldev->siref & LDEV_SI_DTR) == 0); + } else if (atomic_fcmpset_int(&ldev->siref, &siref, + siref + LDEV_SI_REF)) { + break; + } + } + } + *dev = ldev; +} + +static void +linux_drop_fop(struct linux_cdev *ldev) +{ + + if (ldev == NULL) + return; + MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); + atomic_subtract_int(&ldev->siref, LDEV_SI_REF); +} + #define OPW(fp,td,code) ({ \ struct file *__fpop; \ __typeof(code) __retval; \ @@ -703,10 +751,12 @@ zap_vma_ptes(struct vm_area_struct *vma, unsigned long }) static int -linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *file) +linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td, + struct file *file) { struct linux_cdev *ldev; struct linux_file *filp; + const struct file_operations *fop; int error; ldev = dev->si_drv1; @@ -718,20 +768,17 @@ linux_dev_fdopen(struct cdev *dev, int fflags, struct filp->f_flags = file->f_flag; filp->f_vnode = file->f_vnode; filp->_file = file; + refcount_acquire(&ldev->refs); filp->f_cdev = ldev; linux_set_current(td); + linux_get_fop(filp, &fop, &ldev); - /* get a reference on the Linux character device */ - if (atomic_long_add_unless(&ldev->refs, 1, -1L) == 0) { - kfree(filp); - return (EINVAL); - } - - if (filp->f_op->open) { - error = -filp->f_op->open(file->f_vnode, filp); - if (error) { - atomic_long_dec(&ldev->refs); + if (fop->open != NULL) { + error = -fop->open(file->f_vnode, filp); + if (error != 0) { + linux_drop_fop(ldev); + linux_cdev_deref(filp->f_cdev); kfree(filp); return (error); } @@ -742,6 +789,7 @@ linux_dev_fdopen(struct cdev *dev, int fflags, struct /* release the file from devfs */ finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops); + linux_drop_fop(ldev); return (ENXIO); } @@ -877,7 +925,8 @@ linux_get_error(struct task_struct *task, int error) static int linux_file_ioctl_sub(struct file *fp, struct linux_file *filp, - u_long cmd, caddr_t data, struct thread *td) + const struct file_operations *fop, u_long cmd, caddr_t data, + struct thread *td) { struct task_struct *task = current; unsigned size; @@ -902,20 +951,28 @@ linux_file_ioctl_sub(struct file *fp, struct linux_fil #if defined(__amd64__) if (td->td_proc->p_elf_machine == EM_386) { /* try the compat IOCTL handler first */ - if (filp->f_op->compat_ioctl != NULL) - error = -OPW(fp, td, filp->f_op->compat_ioctl(filp, cmd, (u_long)data)); - else + if (fop->compat_ioctl != NULL) { + error = -OPW(fp, td, fop->compat_ioctl(filp, + cmd, (u_long)data)); + } else { error = ENOTTY; + } /* fallback to the regular IOCTL handler, if any */ - if (error == ENOTTY && filp->f_op->unlocked_ioctl != NULL) - error = -OPW(fp, td, filp->f_op->unlocked_ioctl(filp, cmd, (u_long)data)); + if (error == ENOTTY && fop->unlocked_ioctl != NULL) { + error = -OPW(fp, td, fop->unlocked_ioctl(filp, + cmd, (u_long)data)); + } } else #endif - if (filp->f_op->unlocked_ioctl != NULL) - error = -OPW(fp, td, filp->f_op->unlocked_ioctl(filp, cmd, (u_long)data)); - else - error = ENOTTY; + { + if (fop->unlocked_ioctl != NULL) { + error = -OPW(fp, td, fop->unlocked_ioctl(filp, + cmd, (u_long)data)); + } else { + error = ENOTTY; + } + } if (size > 0) { task->bsd_ioctl_data = NULL; task->bsd_ioctl_len = 0; @@ -1084,30 +1141,36 @@ static struct filterops linux_dev_kqfiltops_write = { static void linux_file_kqfilter_poll(struct linux_file *filp, int kqflags) { + struct thread *td; + const struct file_operations *fop; + struct linux_cdev *ldev; int temp; - if (filp->f_kqflags & kqflags) { - struct thread *td = curthread; + if ((filp->f_kqflags & kqflags) == 0) + return; - /* get the latest polling state */ - temp = OPW(filp->_file, td, filp->f_op->poll(filp, NULL)); + td = curthread; - spin_lock(&filp->f_kqlock); - /* clear kqflags */ - filp->f_kqflags &= ~(LINUX_KQ_FLAG_NEED_READ | - LINUX_KQ_FLAG_NEED_WRITE); - /* update kqflags */ - if (temp & (POLLIN | POLLOUT)) { - if (temp & POLLIN) - filp->f_kqflags |= LINUX_KQ_FLAG_NEED_READ; - if (temp & POLLOUT) - filp->f_kqflags |= LINUX_KQ_FLAG_NEED_WRITE; + linux_get_fop(filp, &fop, &ldev); + /* get the latest polling state */ + temp = OPW(filp->_file, td, fop->poll(filp, NULL)); + linux_drop_fop(ldev); - /* make sure the "knote" gets woken up */ - KNOTE_LOCKED(&filp->f_selinfo.si_note, 0); - } - spin_unlock(&filp->f_kqlock); + spin_lock(&filp->f_kqlock); + /* clear kqflags */ + filp->f_kqflags &= ~(LINUX_KQ_FLAG_NEED_READ | + LINUX_KQ_FLAG_NEED_WRITE); + /* update kqflags */ + if ((temp & (POLLIN | POLLOUT)) != 0) { + if ((temp & POLLIN) != 0) + filp->f_kqflags |= LINUX_KQ_FLAG_NEED_READ; + if ((temp & POLLOUT) != 0) + filp->f_kqflags |= LINUX_KQ_FLAG_NEED_WRITE; + + /* make sure the "knote" gets woken up */ + KNOTE_LOCKED(&filp->f_selinfo.si_note, 0); } + spin_unlock(&filp->f_kqlock); } static int @@ -1156,9 +1219,9 @@ linux_file_kqfilter(struct file *file, struct knote *k } static int -linux_file_mmap_single(struct file *fp, vm_ooffset_t *offset, - vm_size_t size, struct vm_object **object, int nprot, - struct thread *td) +linux_file_mmap_single(struct file *fp, const struct file_operations *fop, + vm_ooffset_t *offset, vm_size_t size, struct vm_object **object, + int nprot, struct thread *td) { struct task_struct *task; struct vm_area_struct *vmap; @@ -1170,7 +1233,7 @@ linux_file_mmap_single(struct file *fp, vm_ooffset_t * filp = (struct linux_file *)fp->f_data; filp->f_flags = fp->f_flag; - if (filp->f_op->mmap == NULL) + if (fop->mmap == NULL) return (EOPNOTSUPP); linux_set_current(td); @@ -1200,7 +1263,7 @@ linux_file_mmap_single(struct file *fp, vm_ooffset_t * if (unlikely(down_write_killable(&vmap->vm_mm->mmap_sem))) { error = linux_get_error(task, EINTR); } else { - error = -OPW(fp, td, filp->f_op->mmap(filp, vmap)); + error = -OPW(fp, td, fop->mmap(filp, vmap)); error = linux_get_error(task, error); up_write(&vmap->vm_mm->mmap_sem); } @@ -1319,6 +1382,8 @@ linux_file_read(struct file *file, struct uio *uio, st int flags, struct thread *td) { struct linux_file *filp; + const struct file_operations *fop; + struct linux_cdev *ldev; ssize_t bytes; int error; @@ -1331,8 +1396,10 @@ linux_file_read(struct file *file, struct uio *uio, st if (uio->uio_resid > DEVFS_IOSIZE_MAX) return (EINVAL); linux_set_current(td); - if (filp->f_op->read) { - bytes = OPW(file, td, filp->f_op->read(filp, uio->uio_iov->iov_base, + linux_get_fop(filp, &fop, &ldev); + if (fop->read != NULL) { + bytes = OPW(file, td, fop->read(filp, + uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset)); if (bytes >= 0) { uio->uio_iov->iov_base = @@ -1347,6 +1414,7 @@ linux_file_read(struct file *file, struct uio *uio, st /* update kqfilter status, if any */ linux_file_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_READ); + linux_drop_fop(ldev); return (error); } @@ -1356,10 +1424,11 @@ linux_file_write(struct file *file, struct uio *uio, s int flags, struct thread *td) { struct linux_file *filp; + const struct file_operations *fop; + struct linux_cdev *ldev; ssize_t bytes; int error; - error = 0; filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; /* XXX no support for I/O vectors currently */ @@ -1368,14 +1437,17 @@ linux_file_write(struct file *file, struct uio *uio, s if (uio->uio_resid > DEVFS_IOSIZE_MAX) return (EINVAL); linux_set_current(td); - if (filp->f_op->write) { - bytes = OPW(file, td, filp->f_op->write(filp, uio->uio_iov->iov_base, + linux_get_fop(filp, &fop, &ldev); + if (fop->write != NULL) { + bytes = OPW(file, td, fop->write(filp, + uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset)); if (bytes >= 0) { uio->uio_iov->iov_base = ((uint8_t *)uio->uio_iov->iov_base) + bytes; uio->uio_iov->iov_len -= bytes; uio->uio_resid -= bytes; + error = 0; } else { error = linux_get_error(current, -bytes); } @@ -1385,6 +1457,8 @@ linux_file_write(struct file *file, struct uio *uio, s /* update kqfilter status, if any */ linux_file_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_WRITE); + linux_drop_fop(ldev); + return (error); } @@ -1393,16 +1467,21 @@ linux_file_poll(struct file *file, int events, struct struct thread *td) { struct linux_file *filp; + const struct file_operations *fop; + struct linux_cdev *ldev; int revents; filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; linux_set_current(td); - if (filp->f_op->poll != NULL) - revents = OPW(file, td, filp->f_op->poll(filp, LINUX_POLL_TABLE_NORMAL)) & events; - else + linux_get_fop(filp, &fop, &ldev); + if (fop->poll != NULL) { + revents = OPW(file, td, fop->poll(filp, + LINUX_POLL_TABLE_NORMAL)) & events; + } else { revents = 0; - + } + linux_drop_fop(ldev); return (revents); } @@ -1410,23 +1489,28 @@ static int linux_file_close(struct file *file, struct thread *td) { struct linux_file *filp; + const struct file_operations *fop; + struct linux_cdev *ldev; int error; filp = (struct linux_file *)file->f_data; - KASSERT(file_count(filp) == 0, ("File refcount(%d) is not zero", file_count(filp))); + KASSERT(file_count(filp) == 0, + ("File refcount(%d) is not zero", file_count(filp))); + error = 0; filp->f_flags = file->f_flag; linux_set_current(td); linux_poll_wait_dequeue(filp); - error = -OPW(file, td, filp->f_op->release(filp->f_vnode, filp)); + linux_get_fop(filp, &fop, &ldev); + if (fop->release != NULL) + error = -OPW(file, td, fop->release(filp->f_vnode, filp)); funsetown(&filp->f_sigio); if (filp->f_vnode != NULL) vdrop(filp->f_vnode); - if (filp->f_cdev != NULL) { - /* put a reference on the Linux character device */ - atomic_long_dec(&filp->f_cdev->refs); - } + linux_drop_fop(ldev); + if (filp->f_cdev != NULL) + linux_cdev_deref(filp->f_cdev); kfree(filp); return (error); @@ -1437,27 +1521,30 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *da struct thread *td) { struct linux_file *filp; + const struct file_operations *fop; + struct linux_cdev *ldev; int error; + error = 0; filp = (struct linux_file *)fp->f_data; filp->f_flags = fp->f_flag; - error = 0; + linux_get_fop(filp, &fop, &ldev); linux_set_current(td); switch (cmd) { case FIONBIO: break; case FIOASYNC: - if (filp->f_op->fasync == NULL) + if (fop->fasync == NULL) break; - error = -OPW(fp, td, filp->f_op->fasync(0, filp, fp->f_flag & FASYNC)); + error = -OPW(fp, td, fop->fasync(0, filp, fp->f_flag & FASYNC)); break; case FIOSETOWN: error = fsetown(*(int *)data, &filp->f_sigio); if (error == 0) { - if (filp->f_op->fasync == NULL) + if (fop->fasync == NULL) break; - error = -OPW(fp, td, filp->f_op->fasync(0, filp, + error = -OPW(fp, td, fop->fasync(0, filp, fp->f_flag & FASYNC)); } break; @@ -1465,16 +1552,17 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *da *(int *)data = fgetown(&filp->f_sigio); break; default: - error = linux_file_ioctl_sub(fp, filp, cmd, data, td); + error = linux_file_ioctl_sub(fp, filp, fop, cmd, data, td); break; } + linux_drop_fop(ldev); return (error); } static int linux_file_mmap_sub(struct thread *td, vm_size_t objsize, vm_prot_t prot, vm_prot_t *maxprotp, int *flagsp, struct file *fp, - vm_ooffset_t *foff, vm_object_t *objp) + vm_ooffset_t *foff, const struct file_operations *fop, vm_object_t *objp) { /* * Character devices do not provide private mappings @@ -1486,7 +1574,8 @@ linux_file_mmap_sub(struct thread *td, vm_size_t objsi if ((*flagsp & (MAP_PRIVATE | MAP_COPY)) != 0) return (EINVAL); - return (linux_file_mmap_single(fp, foff, objsize, objp, (int)prot, td)); + return (linux_file_mmap_single(fp, fop, foff, objsize, objp, + (int)prot, td)); } static int @@ -1495,6 +1584,8 @@ linux_file_mmap(struct file *fp, vm_map_t map, vm_offs struct thread *td) { struct linux_file *filp; + const struct file_operations *fop; + struct linux_cdev *ldev; struct mount *mp; struct vnode *vp; vm_object_t object; @@ -1541,15 +1632,18 @@ linux_file_mmap(struct file *fp, vm_map_t map, vm_offs } maxprot &= cap_maxprot; - error = linux_file_mmap_sub(td, size, prot, &maxprot, &flags, fp, &foff, - &object); + linux_get_fop(filp, &fop, &ldev); + error = linux_file_mmap_sub(td, size, prot, &maxprot, &flags, fp, + &foff, fop, &object); if (error != 0) - return (error); + goto out; error = vm_mmap_object(map, addr, size, prot, maxprot, flags, object, foff, FALSE, td); if (error != 0) vm_object_deallocate(object); +out: + linux_drop_fop(ldev); return (error); } @@ -1971,6 +2065,14 @@ linux_completion_done(struct completion *c) } static void +linux_cdev_deref(struct linux_cdev *ldev) +{ + + if (refcount_release(&ldev->refs)) + kfree(ldev); +} + +static void linux_cdev_release(struct kobject *kobj) { struct linux_cdev *cdev; @@ -1979,7 +2081,7 @@ linux_cdev_release(struct kobject *kobj) cdev = container_of(kobj, struct linux_cdev, kobj); parent = kobj->parent; linux_destroy_dev(cdev); - kfree(cdev); + linux_cdev_deref(cdev); kobject_put(parent); } @@ -1996,20 +2098,19 @@ linux_cdev_static_release(struct kobject *kobj) } void -linux_destroy_dev(struct linux_cdev *cdev) +linux_destroy_dev(struct linux_cdev *ldev) { - if (cdev->cdev == NULL) + if (ldev->cdev == NULL) return; - atomic_long_dec(&cdev->refs); + MPASS((ldev->siref & LDEV_SI_DTR) == 0); + atomic_set_int(&ldev->siref, LDEV_SI_DTR); + while ((atomic_load_int(&ldev->siref) & ~LDEV_SI_DTR) != 0) + pause("ldevdtr", hz / 4); - /* wait for all open files to be closed */ - while (atomic_long_read(&cdev->refs) != -1L) - pause("ldevdrn", hz); - - destroy_dev(cdev->cdev); - cdev->cdev = NULL; + destroy_dev(ldev->cdev); + ldev->cdev = NULL; } const struct kobj_type linux_cdev_ktype = { From owner-svn-src-all@freebsd.org Sun Dec 30 16:39:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6EC9142D477; Sun, 30 Dec 2018 16:39:27 +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 354698BA93; Sun, 30 Dec 2018 16:39:27 +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 219FD259C9; Sun, 30 Dec 2018 16:39:27 +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 wBUGdQnc075271; Sun, 30 Dec 2018 16:39:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUGdQkn075270; Sun, 30 Dec 2018 16:39:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301639.wBUGdQkn075270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 16:39:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342631 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 342631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 354698BA93 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)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2018 16:39:27 -0000 Author: kib Date: Sun Dec 30 16:39:26 2018 New Revision: 342631 URL: https://svnweb.freebsd.org/changeset/base/342631 Log: Fix 32bit gcc builds after r342625. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:58:18 2018 (r342630) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 16:39:26 2018 (r342631) @@ -540,7 +540,7 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde struct vm_fault vmf; /* fill out VM fault structure */ - vmf.virtual_address = (void *)IDX_TO_OFF(pidx); + vmf.virtual_address = (void *)(uintptr_t)IDX_TO_OFF(pidx); vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0; vmf.pgoff = 0; vmf.page = NULL; From owner-svn-src-all@freebsd.org Sun Dec 30 04:37:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B70D3143B264; Sun, 30 Dec 2018 04:37:50 +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 525396DB44; Sun, 30 Dec 2018 04:37:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EF4F1DDB1; Sun, 30 Dec 2018 04:37:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU4boKY094199; Sun, 30 Dec 2018 04:37:50 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4bnUb094196; Sun, 30 Dec 2018 04:37:49 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300437.wBU4bnUb094196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342607 - in stable: 10/sys/contrib/ipfilter/netinet 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: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 525396DB44 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)[-0.998,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, 30 Dec 2018 04:37:51 -0000 Author: cy Date: Sun Dec 30 04:37:49 2018 New Revision: 342607 URL: https://svnweb.freebsd.org/changeset/base/342607 Log: MFC r342377: Remove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9) framework is available. pfil(9) has been in FreeBSD since FreeBSD 5 and according to svn log was first committed to HEAD in 2000, therefore it is safe to say the check is no longer needed in FreeBSD. pfil(9) first appeared in NetBSD 1.3 (hence the name NETBSD_PF). Therefore it is safe to say that it is supported by every NetBSD system today. The framework also exists in illumos. As ipfilter code is shared and exchanged between FreeBSD and NetBSD, and at some point in the future illumos too, and as all three platforms have pfil(9), the redundant NETBSD_PF #defines and #ifdefs are removed. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h stable/11/sys/contrib/ipfilter/netinet/ip_fil.h stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h stable/10/sys/contrib/ipfilter/netinet/ip_fil.h stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/ip_compat.h stable/12/sys/contrib/ipfilter/netinet/ip_fil.h stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:31:51 2018 (r342606) +++ stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:37:49 2018 (r342607) @@ -146,7 +146,6 @@ struct ether_addr { # define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) # define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) -# define NETBSD_PF # else # include # endif /* _KERNEL */ Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Sun Dec 30 04:31:51 2018 (r342606) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Sun Dec 30 04:37:49 2018 (r342607) @@ -1435,22 +1435,6 @@ typedef struct ipftune { # define CDEV_MAJOR 79 #endif -/* - * Post NetBSD 1.2 has the PFIL interface for packet filters. This turns - * on those hooks. We don't need any special mods in non-IP Filter code - * with this! - */ -#if (defined(NetBSD) && (NetBSD > 199609) && (NetBSD <= 1991011)) || \ - (defined(NetBSD1_2) && NetBSD1_2 > 1) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 500043)) -# if (defined(NetBSD) && NetBSD >= 199905) -# define PFIL_HOOKS -# endif -# ifdef PFIL_HOOKS -# define NETBSD_PF -# endif -#endif - #ifdef _KERNEL # define FR_VERBOSE(verb_pr) # define FR_DEBUG(verb_pr) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Dec 30 04:31:51 2018 (r342606) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Dec 30 04:37:49 2018 (r342607) @@ -97,9 +97,7 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = { #define V_ipfmain VNET(ipfmain) # include -# if defined(NETBSD_PF) # include -# endif /* NETBSD_PF */ static eventhandler_tag ipf_arrivetag, ipf_departtag; #if 0 @@ -1336,14 +1334,11 @@ ipf_inject(fin, m) } int ipf_pfil_unhook(void) { -#if defined(NETBSD_PF) && (__FreeBSD_version >= 500011) struct pfil_head *ph_inet; -# ifdef USE_INET6 +#ifdef USE_INET6 struct pfil_head *ph_inet6; -# endif #endif -#ifdef NETBSD_PF ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); if (ph_inet != NULL) pfil_remove_hook((void *)ipf_check_wrapper, NULL, @@ -1354,20 +1349,16 @@ int ipf_pfil_unhook(void) { pfil_remove_hook((void *)ipf_check_wrapper6, NULL, PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); # endif -#endif return (0); } int ipf_pfil_hook(void) { -#if defined(NETBSD_PF) && (__FreeBSD_version >= 500011) struct pfil_head *ph_inet; -# ifdef USE_INET6 +#ifdef USE_INET6 struct pfil_head *ph_inet6; -# endif #endif -# ifdef NETBSD_PF ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); # ifdef USE_INET6 ph_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6); @@ -1388,7 +1379,6 @@ int ipf_pfil_hook(void) { pfil_add_hook((void *)ipf_check_wrapper6, NULL, PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); # endif -# endif return (0); } From owner-svn-src-all@freebsd.org Sun Dec 30 04:37:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66386143B268; Sun, 30 Dec 2018 04:37:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09D1F6DB45; Sun, 30 Dec 2018 04:37:51 +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 F12F61DDB2; Sun, 30 Dec 2018 04:37:50 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU4boWX094207; Sun, 30 Dec 2018 04:37:50 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4boiO094204; Sun, 30 Dec 2018 04:37:50 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300437.wBU4boiO094204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:37: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: r342607 - in stable: 10/sys/contrib/ipfilter/netinet 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: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 09D1F6DB45 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)[-0.998,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, 30 Dec 2018 04:37:51 -0000 Author: cy Date: Sun Dec 30 04:37:49 2018 New Revision: 342607 URL: https://svnweb.freebsd.org/changeset/base/342607 Log: MFC r342377: Remove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9) framework is available. pfil(9) has been in FreeBSD since FreeBSD 5 and according to svn log was first committed to HEAD in 2000, therefore it is safe to say the check is no longer needed in FreeBSD. pfil(9) first appeared in NetBSD 1.3 (hence the name NETBSD_PF). Therefore it is safe to say that it is supported by every NetBSD system today. The framework also exists in illumos. As ipfilter code is shared and exchanged between FreeBSD and NetBSD, and at some point in the future illumos too, and as all three platforms have pfil(9), the redundant NETBSD_PF #defines and #ifdefs are removed. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_compat.h stable/12/sys/contrib/ipfilter/netinet/ip_fil.h stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h stable/10/sys/contrib/ipfilter/netinet/ip_fil.h stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/11/sys/contrib/ipfilter/netinet/ip_compat.h stable/11/sys/contrib/ipfilter/netinet/ip_fil.h stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:31:51 2018 (r342606) +++ stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:37:49 2018 (r342607) @@ -146,7 +146,6 @@ struct ether_addr { # define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) # define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) -# define NETBSD_PF # else # include # endif /* _KERNEL */ Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Sun Dec 30 04:31:51 2018 (r342606) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Sun Dec 30 04:37:49 2018 (r342607) @@ -1435,22 +1435,6 @@ typedef struct ipftune { # define CDEV_MAJOR 79 #endif -/* - * Post NetBSD 1.2 has the PFIL interface for packet filters. This turns - * on those hooks. We don't need any special mods in non-IP Filter code - * with this! - */ -#if (defined(NetBSD) && (NetBSD > 199609) && (NetBSD <= 1991011)) || \ - (defined(NetBSD1_2) && NetBSD1_2 > 1) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 500043)) -# if (defined(NetBSD) && NetBSD >= 199905) -# define PFIL_HOOKS -# endif -# ifdef PFIL_HOOKS -# define NETBSD_PF -# endif -#endif - #ifdef _KERNEL # define FR_VERBOSE(verb_pr) # define FR_DEBUG(verb_pr) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Dec 30 04:31:51 2018 (r342606) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Dec 30 04:37:49 2018 (r342607) @@ -97,9 +97,7 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = { #define V_ipfmain VNET(ipfmain) # include -# if defined(NETBSD_PF) # include -# endif /* NETBSD_PF */ static eventhandler_tag ipf_arrivetag, ipf_departtag; #if 0 @@ -1336,14 +1334,11 @@ ipf_inject(fin, m) } int ipf_pfil_unhook(void) { -#if defined(NETBSD_PF) && (__FreeBSD_version >= 500011) struct pfil_head *ph_inet; -# ifdef USE_INET6 +#ifdef USE_INET6 struct pfil_head *ph_inet6; -# endif #endif -#ifdef NETBSD_PF ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); if (ph_inet != NULL) pfil_remove_hook((void *)ipf_check_wrapper, NULL, @@ -1354,20 +1349,16 @@ int ipf_pfil_unhook(void) { pfil_remove_hook((void *)ipf_check_wrapper6, NULL, PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); # endif -#endif return (0); } int ipf_pfil_hook(void) { -#if defined(NETBSD_PF) && (__FreeBSD_version >= 500011) struct pfil_head *ph_inet; -# ifdef USE_INET6 +#ifdef USE_INET6 struct pfil_head *ph_inet6; -# endif #endif -# ifdef NETBSD_PF ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); # ifdef USE_INET6 ph_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6); @@ -1388,7 +1379,6 @@ int ipf_pfil_hook(void) { pfil_add_hook((void *)ipf_check_wrapper6, NULL, PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); # endif -# endif return (0); } From owner-svn-src-all@freebsd.org Sun Dec 30 04:37:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40369143B26C; Sun, 30 Dec 2018 04:37:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8B866DB4B; Sun, 30 Dec 2018 04:37:51 +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 B18861DDB3; Sun, 30 Dec 2018 04:37:51 +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 wBU4bptq094215; Sun, 30 Dec 2018 04:37:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4bpWu094212; Sun, 30 Dec 2018 04:37:51 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300437.wBU4bpWu094212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342607 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C8B866DB4B 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)[-0.998,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, 30 Dec 2018 04:37:52 -0000 Author: cy Date: Sun Dec 30 04:37:49 2018 New Revision: 342607 URL: https://svnweb.freebsd.org/changeset/base/342607 Log: MFC r342377: Remove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9) framework is available. pfil(9) has been in FreeBSD since FreeBSD 5 and according to svn log was first committed to HEAD in 2000, therefore it is safe to say the check is no longer needed in FreeBSD. pfil(9) first appeared in NetBSD 1.3 (hence the name NETBSD_PF). Therefore it is safe to say that it is supported by every NetBSD system today. The framework also exists in illumos. As ipfilter code is shared and exchanged between FreeBSD and NetBSD, and at some point in the future illumos too, and as all three platforms have pfil(9), the redundant NETBSD_PF #defines and #ifdefs are removed. Modified: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h stable/10/sys/contrib/ipfilter/netinet/ip_fil.h stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h stable/11/sys/contrib/ipfilter/netinet/ip_fil.h stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/ip_compat.h stable/12/sys/contrib/ipfilter/netinet/ip_fil.h stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:31:51 2018 (r342606) +++ stable/10/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 30 04:37:49 2018 (r342607) @@ -146,7 +146,6 @@ struct ether_addr { # define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) # define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) -# define NETBSD_PF # else # include # endif /* _KERNEL */ Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_fil.h Sun Dec 30 04:31:51 2018 (r342606) +++ stable/10/sys/contrib/ipfilter/netinet/ip_fil.h Sun Dec 30 04:37:49 2018 (r342607) @@ -1435,22 +1435,6 @@ typedef struct ipftune { # define CDEV_MAJOR 79 #endif -/* - * Post NetBSD 1.2 has the PFIL interface for packet filters. This turns - * on those hooks. We don't need any special mods in non-IP Filter code - * with this! - */ -#if (defined(NetBSD) && (NetBSD > 199609) && (NetBSD <= 1991011)) || \ - (defined(NetBSD1_2) && NetBSD1_2 > 1) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 500043)) -# if (defined(NetBSD) && NetBSD >= 199905) -# define PFIL_HOOKS -# endif -# ifdef PFIL_HOOKS -# define NETBSD_PF -# endif -#endif - #ifdef _KERNEL # define FR_VERBOSE(verb_pr) # define FR_DEBUG(verb_pr) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Dec 30 04:31:51 2018 (r342606) +++ stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Dec 30 04:37:49 2018 (r342607) @@ -100,9 +100,7 @@ int ipf_locks_done = 0; ipf_main_softc_t ipfmain; # include -# if defined(NETBSD_PF) # include -# endif /* NETBSD_PF */ /* * We provide the ipf_checkp name just to minimize changes later. */ @@ -1358,14 +1356,11 @@ ipf_inject(fin, m) } int ipf_pfil_unhook(void) { -#if defined(NETBSD_PF) && (__FreeBSD_version >= 500011) struct pfil_head *ph_inet; -# ifdef USE_INET6 +#ifdef USE_INET6 struct pfil_head *ph_inet6; -# endif #endif -#ifdef NETBSD_PF ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); if (ph_inet != NULL) pfil_remove_hook((void *)ipf_check_wrapper, NULL, @@ -1376,20 +1371,16 @@ int ipf_pfil_unhook(void) { pfil_remove_hook((void *)ipf_check_wrapper6, NULL, PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); # endif -#endif return (0); } int ipf_pfil_hook(void) { -#if defined(NETBSD_PF) && (__FreeBSD_version >= 500011) struct pfil_head *ph_inet; -# ifdef USE_INET6 +#ifdef USE_INET6 struct pfil_head *ph_inet6; -# endif #endif -# ifdef NETBSD_PF ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); # ifdef USE_INET6 ph_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6); @@ -1410,7 +1401,6 @@ int ipf_pfil_hook(void) { pfil_add_hook((void *)ipf_check_wrapper6, NULL, PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); # endif -# endif return (0); } From owner-svn-src-all@freebsd.org Sun Dec 30 15:17:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6BEC142B5FC; Sun, 30 Dec 2018 15:17:58 +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 6B62588FEB; Sun, 30 Dec 2018 15:17:58 +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 58D7924C1E; Sun, 30 Dec 2018 15:17:58 +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 wBUFHwjQ032398; Sun, 30 Dec 2018 15:17:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFHw6r032397; Sun, 30 Dec 2018 15:17:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301517.wBUFHw6r032397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:17:58 +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: r342621 - stable/12/sys/ufs/ffs X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/ufs/ffs X-SVN-Commit-Revision: 342621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B62588FEB 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.96)[-0.957,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)[-0.998,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, 30 Dec 2018 15:17:59 -0000 Author: kib Date: Sun Dec 30 15:17:57 2018 New Revision: 342621 URL: https://svnweb.freebsd.org/changeset/base/342621 Log: MFC r342381: Allocate v_object for the new snapshot vnode. Modified: stable/12/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_snapshot.c Sun Dec 30 15:17:00 2018 (r342620) +++ stable/12/sys/ufs/ffs/ffs_snapshot.c Sun Dec 30 15:17:57 2018 (r342621) @@ -302,6 +302,7 @@ restart: return (error); } vp = nd.ni_vp; + vnode_create_vobject(nd.ni_vp, fs->fs_size, td); vp->v_vflag |= VV_SYSTEM; ip = VTOI(vp); devvp = ITODEVVP(ip); From owner-svn-src-all@freebsd.org Sun Dec 30 08:58:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAFA9141EC46; Sun, 30 Dec 2018 08:58:32 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97A52752CB; Sun, 30 Dec 2018 08:58:32 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89A37209F4; Sun, 30 Dec 2018 08:58:32 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU8wWGA031713; Sun, 30 Dec 2018 08:58:32 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU8wWZ3031710; Sun, 30 Dec 2018 08:58:32 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201812300858.wBU8wWZ3031710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 30 Dec 2018 08:58: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: r342616 - in stable/12/stand/i386: libi386 loader X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in stable/12/stand/i386: libi386 loader X-SVN-Commit-Revision: 342616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 97A52752CB 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.91)[-0.911,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 08:58:33 -0000 Author: tsoome Date: Sun Dec 30 08:58:31 2018 New Revision: 342616 URL: https://svnweb.freebsd.org/changeset/base/342616 Log: MFC r341328: loader: create separate lists for fd, cd and hd, merge bioscd with biosdisk Create unified block IO implementation in BIOS version, like it is done in UEFI side. Implement fd, disk and cd device lists, this will split floppy devices from disks and will allow us to have consistent, predictable device naming (modulo BIOS issues). Relnotes: yes Differential Revision: https://reviews.freebsd.org/D17888 Deleted: stable/12/stand/i386/libi386/bioscd.c Modified: stable/12/stand/i386/libi386/Makefile stable/12/stand/i386/libi386/biosdisk.c stable/12/stand/i386/libi386/bootinfo32.c stable/12/stand/i386/libi386/libi386.h stable/12/stand/i386/loader/chain.c stable/12/stand/i386/loader/conf.c stable/12/stand/i386/loader/main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/i386/libi386/Makefile ============================================================================== --- stable/12/stand/i386/libi386/Makefile Sun Dec 30 08:50:34 2018 (r342615) +++ stable/12/stand/i386/libi386/Makefile Sun Dec 30 08:58:31 2018 (r342616) @@ -4,7 +4,7 @@ LIB= i386 -SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp.c \ +SRCS= biosacpi.c biosdisk.c biosmem.c biospnp.c \ biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \ comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \ Modified: stable/12/stand/i386/libi386/biosdisk.c ============================================================================== --- stable/12/stand/i386/libi386/biosdisk.c Sun Dec 30 08:50:34 2018 (r342615) +++ stable/12/stand/i386/libi386/biosdisk.c Sun Dec 30 08:58:31 2018 (r342616) @@ -40,9 +40,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include @@ -59,6 +61,8 @@ __FBSDID("$FreeBSD$"); #define WFDMAJOR 1 #define FDMAJOR 2 #define DAMAJOR 4 +#define ACDMAJOR 117 +#define CDMAJOR 15 #ifdef DISK_DEBUG #define DEBUG(fmt, args...) printf("%s: " fmt "\n", __func__, ## args) @@ -66,12 +70,27 @@ __FBSDID("$FreeBSD$"); #define DEBUG(fmt, args...) #endif +struct specification_packet { + uint8_t sp_size; + uint8_t sp_bootmedia; + uint8_t sp_drive; + uint8_t sp_controller; + uint32_t sp_lba; + uint16_t sp_devicespec; + uint16_t sp_buffersegment; + uint16_t sp_loadsegment; + uint16_t sp_sectorcount; + uint16_t sp_cylsec; + uint8_t sp_head; +}; + /* * List of BIOS devices, translation from disk unit number to * BIOS unit number. */ -static struct bdinfo +typedef struct bdinfo { + STAILQ_ENTRY(bdinfo) bd_link; /* link in device list */ int bd_unit; /* BIOS unit number */ int bd_cyl; /* BIOS geometry */ int bd_hds; @@ -83,25 +102,30 @@ static struct bdinfo #define BD_MODEEDD (BD_MODEEDD1 | BD_MODEEDD3) #define BD_MODEMASK 0x0003 #define BD_FLOPPY 0x0004 -#define BD_NO_MEDIA 0x0008 +#define BD_CDROM 0x0008 +#define BD_NO_MEDIA 0x0010 int bd_type; /* BIOS 'drive type' (floppy only) */ uint16_t bd_sectorsize; /* Sector size */ uint64_t bd_sectors; /* Disk size */ int bd_open; /* reference counter */ void *bd_bcache; /* buffer cache data */ -} bdinfo [MAXBDDEV]; -static int nbdinfo = 0; +} bdinfo_t; -#define BD(dev) (bdinfo[(dev)->dd.d_unit]) #define BD_RD 0 #define BD_WR 1 -static void bd_io_workaround(struct disk_devdesc *dev); +typedef STAILQ_HEAD(bdinfo_list, bdinfo) bdinfo_list_t; +static bdinfo_list_t fdinfo = STAILQ_HEAD_INITIALIZER(fdinfo); +static bdinfo_list_t cdinfo = STAILQ_HEAD_INITIALIZER(cdinfo); +static bdinfo_list_t hdinfo = STAILQ_HEAD_INITIALIZER(hdinfo); -static int bd_io(struct disk_devdesc *, daddr_t, int, caddr_t, int); -static int bd_int13probe(struct bdinfo *bd); +static void bd_io_workaround(bdinfo_t *); +static int bd_io(struct disk_devdesc *, bdinfo_t *, daddr_t, int, caddr_t, int); +static bool bd_int13probe(bdinfo_t *); static int bd_init(void); +static int cd_init(void); +static int fd_init(void); static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, char *buf, size_t *rsize); static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, @@ -110,42 +134,120 @@ static int bd_open(struct open_file *f, ...); static int bd_close(struct open_file *f); static int bd_ioctl(struct open_file *f, u_long cmd, void *data); static int bd_print(int verbose); +static int cd_print(int verbose); +static int fd_print(int verbose); -struct devsw biosdisk = { - "disk", - DEVT_DISK, - bd_init, - bd_strategy, - bd_open, - bd_close, - bd_ioctl, - bd_print, - NULL +struct devsw biosfd = { + .dv_name = "fd", + .dv_type = DEVT_FD, + .dv_init = fd_init, + .dv_strategy = bd_strategy, + .dv_open = bd_open, + .dv_close = bd_close, + .dv_ioctl = bd_ioctl, + .dv_print = fd_print, + .dv_cleanup = NULL }; +struct devsw bioscd = { + .dv_name = "cd", + .dv_type = DEVT_CD, + .dv_init = cd_init, + .dv_strategy = bd_strategy, + .dv_open = bd_open, + .dv_close = bd_close, + .dv_ioctl = bd_ioctl, + .dv_print = cd_print, + .dv_cleanup = NULL +}; + +struct devsw bioshd = { + .dv_name = "disk", + .dv_type = DEVT_DISK, + .dv_init = bd_init, + .dv_strategy = bd_strategy, + .dv_open = bd_open, + .dv_close = bd_close, + .dv_ioctl = bd_ioctl, + .dv_print = bd_print, + .dv_cleanup = NULL +}; + +static bdinfo_list_t * +bd_get_bdinfo_list(struct devsw *dev) +{ + if (dev->dv_type == DEVT_DISK) + return (&hdinfo); + if (dev->dv_type == DEVT_CD) + return (&cdinfo); + if (dev->dv_type == DEVT_FD) + return (&fdinfo); + return (NULL); +} + +/* XXX this gets called way way too often, investigate */ +static bdinfo_t * +bd_get_bdinfo(struct devdesc *dev) +{ + bdinfo_list_t *bdi; + bdinfo_t *bd = NULL; + int unit; + + bdi = bd_get_bdinfo_list(dev->d_dev); + if (bdi == NULL) + return (bd); + + unit = 0; + STAILQ_FOREACH(bd, bdi, bd_link) { + if (unit == dev->d_unit) + return (bd); + unit++; + } + return (bd); +} + /* * Translate between BIOS device numbers and our private unit numbers. */ int bd_bios2unit(int biosdev) { - int i; + bdinfo_list_t *bdi[] = { &fdinfo, &cdinfo, &hdinfo, NULL }; + bdinfo_t *bd; + int i, unit; DEBUG("looking for bios device 0x%x", biosdev); - for (i = 0; i < nbdinfo; i++) { - DEBUG("bd unit %d is BIOS device 0x%x", i, bdinfo[i].bd_unit); - if (bdinfo[i].bd_unit == biosdev) - return (i); + for (i = 0; bdi[i] != NULL; i++) { + unit = 0; + STAILQ_FOREACH(bd, bdi[i], bd_link) { + if (bd->bd_unit == biosdev) { + DEBUG("bd unit %d is BIOS device 0x%x", unit, + bd->bd_unit); + return (unit); + } + unit++; + } } return (-1); } int -bd_unit2bios(int unit) +bd_unit2bios(struct i386_devdesc *dev) { + bdinfo_list_t *bdi; + bdinfo_t *bd; + int unit; - if ((unit >= 0) && (unit < nbdinfo)) - return (bdinfo[unit].bd_unit); + bdi = bd_get_bdinfo_list(dev->dd.d_dev); + if (bdi == NULL) + return (-1); + + unit = 0; + STAILQ_FOREACH(bd, bdi, bd_link) { + if (unit == dev->dd.d_unit) + return (bd->bd_unit); + unit++; + } return (-1); } @@ -153,42 +255,128 @@ bd_unit2bios(int unit) * Quiz the BIOS for disk devices, save a little info about them. */ static int -bd_init(void) +fd_init(void) { - int base, unit, nfd = 0; + int unit; + bdinfo_t *bd; - /* sequence 0, 0x80 */ - for (base = 0; base <= 0x80; base += 0x80) { - for (unit = base; (nbdinfo < MAXBDDEV); unit++) { -#ifndef VIRTUALBOX - /* - * Check the BIOS equipment list for number - * of fixed disks. - */ - if (base == 0x80 && - (nfd >= *(unsigned char *)PTOV(BIOS_NUMDRIVES))) - break; -#endif - bdinfo[nbdinfo].bd_open = 0; - bdinfo[nbdinfo].bd_bcache = NULL; - bdinfo[nbdinfo].bd_unit = unit; - bdinfo[nbdinfo].bd_flags = unit < 0x80 ? BD_FLOPPY: 0; - if (!bd_int13probe(&bdinfo[nbdinfo])) - break; + for (unit = 0; unit < MAXBDDEV; unit++) { + if ((bd = calloc(1, sizeof(*bd))) == NULL) + break; + bd->bd_flags = BD_FLOPPY; + bd->bd_unit = unit; + if (!bd_int13probe(bd)) { + free(bd); + break; + } + if (bd->bd_sectors == 0) + bd->bd_flags |= BD_NO_MEDIA; - /* XXX we need "disk aliases" to make this simpler */ - printf("BIOS drive %c: is disk%d\n", (unit < 0x80) ? - ('A' + unit): ('C' + unit - 0x80), nbdinfo); - nbdinfo++; - if (base == 0x80) - nfd++; + printf("BIOS drive %c: is %s%d\n", ('A' + unit), + biosfd.dv_name, unit); + + STAILQ_INSERT_TAIL(&fdinfo, bd, bd_link); + } + + bcache_add_dev(unit); + return (0); +} + +static int +bd_init(void) +{ + int base, unit; + bdinfo_t *bd; + + base = 0x80; + for (unit = 0; unit < *(unsigned char *)PTOV(BIOS_NUMDRIVES); unit++) { + /* + * Check the BIOS equipment list for number of fixed disks. + */ + if ((bd = calloc(1, sizeof(*bd))) == NULL) + break; + bd->bd_unit = base + unit; + if (!bd_int13probe(bd)) { + free(bd); + break; } + + printf("BIOS drive %c: is %s%d\n", ('C' + unit), + bioshd.dv_name, unit); + + STAILQ_INSERT_TAIL(&hdinfo, bd, bd_link); } - bcache_add_dev(nbdinfo); + bcache_add_dev(unit); return (0); } /* + * We can't quiz, we have to be told what device to use, so this function + * doesn't do anything. Instead, the loader calls bc_add() with the BIOS + * device number to add. + */ +static int +cd_init(void) +{ + + return (0); +} + +int +bc_add(int biosdev) +{ + bdinfo_t *bd; + struct specification_packet bc_sp; + int nbcinfo = 0; + + if (!STAILQ_EMPTY(&cdinfo)) + return (-1); + + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x4b01; + v86.edx = biosdev; + v86.ds = VTOPSEG(&bc_sp); + v86.esi = VTOPOFF(&bc_sp); + v86int(); + if ((v86.eax & 0xff00) != 0) + return (-1); + + if ((bd = calloc(1, sizeof(*bd))) == NULL) + return (-1); + + bd->bd_flags = BD_CDROM; + bd->bd_unit = biosdev; + + /* + * Ignore result from bd_int13probe(), we will use local + * workaround below. + */ + (void)bd_int13probe(bd); + + if (bd->bd_cyl == 0) { + bd->bd_cyl = ((bc_sp.sp_cylsec & 0xc0) << 2) + + ((bc_sp.sp_cylsec & 0xff00) >> 8) + 1; + } + if (bd->bd_hds == 0) + bd->bd_hds = bc_sp.sp_head + 1; + if (bd->bd_sec == 0) + bd->bd_sec = bc_sp.sp_cylsec & 0x3f; + if (bd->bd_sectors == 0) + bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; + + /* Still no size? use 7.961GB */ + if (bd->bd_sectors == 0) + bd->bd_sectors = 4173824; + + STAILQ_INSERT_TAIL(&cdinfo, bd, bd_link); + printf("BIOS CD is cd%d\n", nbcinfo); + nbcinfo++; + bcache_add_dev(nbcinfo); /* register cd device in bcache */ + return(0); +} + +/* * Return EDD version or 0 if EDD is not supported on this drive. */ static int @@ -306,11 +494,10 @@ bd_get_diskinfo_ext(struct bdinfo *bd) /* * Try to detect a device supported by the legacy int13 BIOS */ -static int -bd_int13probe(struct bdinfo *bd) +static bool +bd_int13probe(bdinfo_t *bd) { - int edd; - int ret; + int edd, ret; bd->bd_flags &= ~BD_NO_MEDIA; @@ -340,7 +527,7 @@ bd_int13probe(struct bdinfo *bd) v86.edx = bd->bd_unit; v86int(); if (V86_CY(v86.efl) || (v86.eax & 0x300) == 0) - return (0); + return (false); } ret = 1; @@ -354,7 +541,6 @@ bd_int13probe(struct bdinfo *bd) bd->bd_cyl = 80; bd->bd_hds = 2; bd->bd_sec = 18; - bd->bd_type = 4; bd->bd_sectors = 2880; /* Since we are there, there most likely is no media */ bd->bd_flags |= BD_NO_MEDIA; @@ -362,6 +548,10 @@ bd_int13probe(struct bdinfo *bd) } if (ret != 0) { + /* CD is special case, bc_add() has its own fallback. */ + if ((bd->bd_flags & BD_CDROM) != 0) + return (true); + if (bd->bd_sectors != 0 && edd != 0) { bd->bd_sec = 63; bd->bd_hds = 255; @@ -369,9 +559,18 @@ bd_int13probe(struct bdinfo *bd) (bd->bd_sectors + bd->bd_sec * bd->bd_hds - 1) / bd->bd_sec * bd->bd_hds; } else { + const char *dv_name; + + if ((bd->bd_flags & BD_FLOPPY) != 0) + dv_name = biosfd.dv_name; + else if ((bd->bd_flags & BD_CDROM) != 0) + dv_name = bioscd.dv_name; + else + dv_name = bioshd.dv_name; + printf("Can not get information about %s unit %#x\n", - biosdisk.dv_name, bd->bd_unit); - return (0); + dv_name, bd->bd_unit); + return (false); } } @@ -383,54 +582,86 @@ bd_int13probe(struct bdinfo *bd) if (bd->bd_sectors == 0) bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; - DEBUG("unit 0x%x geometry %d/%d/%d", bd->bd_unit, bd->bd_cyl, + DEBUG("unit 0x%x geometry %d/%d/%d\n", bd->bd_unit, bd->bd_cyl, bd->bd_hds, bd->bd_sec); - return (1); + return (true); } +static int +bd_count(bdinfo_list_t *bdi) +{ + bdinfo_t *bd; + int i; + + i = 0; + STAILQ_FOREACH(bd, bdi, bd_link) + i++; + return (i); +} + /* * Print information about disks */ static int -bd_print(int verbose) +bd_print_common(struct devsw *dev, bdinfo_list_t *bdi, int verbose) { - static char line[80]; - struct disk_devdesc dev; + char line[80]; + struct disk_devdesc devd; + bdinfo_t *bd; int i, ret = 0; + char drive; - if (nbdinfo == 0) + if (STAILQ_EMPTY(bdi)) return (0); - printf("%s devices:", biosdisk.dv_name); + printf("%s devices:", dev->dv_name); if ((ret = pager_output("\n")) != 0) return (ret); - for (i = 0; i < nbdinfo; i++) { + i = -1; + STAILQ_FOREACH(bd, bdi, bd_link) { + i++; + + switch (dev->dv_type) { + case DEVT_FD: + drive = 'A'; + break; + case DEVT_CD: + drive = 'C' + bd_count(&hdinfo); + break; + default: + drive = 'C'; + break; + } + snprintf(line, sizeof(line), - " disk%d: BIOS drive %c (%s%ju X %u):\n", i, - (bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit): - ('C' + bdinfo[i].bd_unit - 0x80), - (bdinfo[i].bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA ? + " %s%d: BIOS drive %c (%s%ju X %u):\n", + dev->dv_name, i, drive + i, + (bd->bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA ? "no media, " : "", - (uintmax_t)bdinfo[i].bd_sectors, - bdinfo[i].bd_sectorsize); + (uintmax_t)bd->bd_sectors, + bd->bd_sectorsize); if ((ret = pager_output(line)) != 0) break; - if ((bdinfo[i].bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) + if ((bd->bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) continue; - dev.dd.d_dev = &biosdisk; - dev.dd.d_unit = i; - dev.d_slice = -1; - dev.d_partition = -1; - if (disk_open(&dev, - bdinfo[i].bd_sectorsize * bdinfo[i].bd_sectors, - bdinfo[i].bd_sectorsize) == 0) { - snprintf(line, sizeof(line), " disk%d", i); - ret = disk_print(&dev, line, verbose); - disk_close(&dev); + if (dev->dv_type != DEVT_DISK) + continue; + + devd.dd.d_dev = dev; + devd.dd.d_unit = i; + devd.d_slice = -1; + devd.d_partition = -1; + if (disk_open(&devd, + bd->bd_sectorsize * bd->bd_sectors, + bd->bd_sectorsize) == 0) { + snprintf(line, sizeof(line), " %s%d", + dev->dv_name, i); + ret = disk_print(&devd, line, verbose); + disk_close(&devd); if (ret != 0) break; } @@ -438,6 +669,24 @@ bd_print(int verbose) return (ret); } +static int +fd_print(int verbose) +{ + return (bd_print_common(&biosfd, &fdinfo, verbose)); +} + +static int +bd_print(int verbose) +{ + return (bd_print_common(&bioshd, &hdinfo, verbose)); +} + +static int +cd_print(int verbose) +{ + return (bd_print_common(&bioscd, &cdinfo, verbose)); +} + /* * Read disk size from partition. * This is needed to work around buggy BIOS systems returning @@ -448,21 +697,26 @@ bd_print(int verbose) static uint64_t bd_disk_get_sectors(struct disk_devdesc *dev) { + bdinfo_t *bd; struct disk_devdesc disk; uint64_t size; + bd = bd_get_bdinfo(&dev->dd); + if (bd == NULL) + return (0); + disk.dd.d_dev = dev->dd.d_dev; disk.dd.d_unit = dev->dd.d_unit; disk.d_slice = -1; disk.d_partition = -1; disk.d_offset = 0; - size = BD(dev).bd_sectors * BD(dev).bd_sectorsize; - if (disk_open(&disk, size, BD(dev).bd_sectorsize) == 0) { + size = bd->bd_sectors * bd->bd_sectorsize; + if (disk_open(&disk, size, bd->bd_sectorsize) == 0) { (void) disk_ioctl(&disk, DIOCGMEDIASIZE, &size); disk_close(&disk); } - return (size / BD(dev).bd_sectorsize); + return (size / bd->bd_sectorsize); } /* @@ -478,6 +732,7 @@ bd_disk_get_sectors(struct disk_devdesc *dev) static int bd_open(struct open_file *f, ...) { + bdinfo_t *bd; struct disk_devdesc *dev; va_list ap; int rc; @@ -486,29 +741,33 @@ bd_open(struct open_file *f, ...) dev = va_arg(ap, struct disk_devdesc *); va_end(ap); - if (dev->dd.d_unit < 0 || dev->dd.d_unit >= nbdinfo) + bd = bd_get_bdinfo(&dev->dd); + if (bd == NULL) return (EIO); - if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) { - if (!bd_int13probe(&BD(dev))) + if ((bd->bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) { + if (!bd_int13probe(bd)) return (EIO); - if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) + if ((bd->bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) return (EIO); } - if (BD(dev).bd_bcache == NULL) - BD(dev).bd_bcache = bcache_allocate(); + if (bd->bd_bcache == NULL) + bd->bd_bcache = bcache_allocate(); - if (BD(dev).bd_open == 0) - BD(dev).bd_sectors = bd_disk_get_sectors(dev); - BD(dev).bd_open++; + if (bd->bd_open == 0) + bd->bd_sectors = bd_disk_get_sectors(dev); + bd->bd_open++; - rc = disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, - BD(dev).bd_sectorsize); - if (rc != 0) { - BD(dev).bd_open--; - if (BD(dev).bd_open == 0) { - bcache_free(BD(dev).bd_bcache); - BD(dev).bd_bcache = NULL; + rc = 0; + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + rc = disk_open(dev, bd->bd_sectors * bd->bd_sectorsize, + bd->bd_sectorsize); + if (rc != 0) { + bd->bd_open--; + if (bd->bd_open == 0) { + bcache_free(bd->bd_bcache); + bd->bd_bcache = NULL; + } } } return (rc); @@ -518,34 +777,48 @@ static int bd_close(struct open_file *f) { struct disk_devdesc *dev; + bdinfo_t *bd; + int rc = 0; dev = (struct disk_devdesc *)f->f_devdata; - BD(dev).bd_open--; - if (BD(dev).bd_open == 0) { - bcache_free(BD(dev).bd_bcache); - BD(dev).bd_bcache = NULL; + bd = bd_get_bdinfo(&dev->dd); + if (bd == NULL) + return (EIO); + + bd->bd_open--; + if (bd->bd_open == 0) { + bcache_free(bd->bd_bcache); + bd->bd_bcache = NULL; } - return (disk_close(dev)); + if (dev->dd.d_dev->dv_type == DEVT_DISK) + rc = disk_close(dev); + return (rc); } static int bd_ioctl(struct open_file *f, u_long cmd, void *data) { + bdinfo_t *bd; struct disk_devdesc *dev; int rc; dev = (struct disk_devdesc *)f->f_devdata; + bd = bd_get_bdinfo(&dev->dd); + if (bd == NULL) + return (EIO); - rc = disk_ioctl(dev, cmd, data); - if (rc != ENOTTY) - return (rc); + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + rc = disk_ioctl(dev, cmd, data); + if (rc != ENOTTY) + return (rc); + } switch (cmd) { case DIOCGSECTORSIZE: - *(uint32_t *)data = BD(dev).bd_sectorsize; + *(uint32_t *)data = bd->bd_sectorsize; break; case DIOCGMEDIASIZE: - *(uint64_t *)data = BD(dev).bd_sectors * BD(dev).bd_sectorsize; + *(uint64_t *)data = bd->bd_sectors * bd->bd_sectorsize; break; default: return (ENOTTY); @@ -557,14 +830,27 @@ static int bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { + bdinfo_t *bd; struct bcache_devdata bcd; struct disk_devdesc *dev; + daddr_t offset; dev = (struct disk_devdesc *)devdata; + bd = bd_get_bdinfo(&dev->dd); + if (bd == NULL) + return (EINVAL); + bcd.dv_strategy = bd_realstrategy; bcd.dv_devdata = devdata; - bcd.dv_cache = BD(dev).bd_bcache; - return (bcache_strategy(&bcd, rw, dblk + dev->d_offset, size, + bcd.dv_cache = bd->bd_bcache; + + offset = 0; + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + + offset = dev->d_offset * bd->bd_sectorsize; + offset /= BIOSDISK_SECSIZE; + } + return (bcache_strategy(&bcd, rw, dblk + offset, size, buf, rsize)); } @@ -573,12 +859,14 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s char *buf, size_t *rsize) { struct disk_devdesc *dev = (struct disk_devdesc *)devdata; - uint64_t disk_blocks, offset; + bdinfo_t *bd; + uint64_t disk_blocks, offset, d_offset; size_t blks, blkoff, bsize, rest; caddr_t bbuf; int rc; - if ((BD(dev).bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) + bd = bd_get_bdinfo(&dev->dd); + if (bd == NULL || (bd->bd_flags & BD_NO_MEDIA) == BD_NO_MEDIA) return (EIO); /* @@ -596,8 +884,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s DEBUG("open_disk %p", dev); offset = dblk * BIOSDISK_SECSIZE; - dblk = offset / BD(dev).bd_sectorsize; - blkoff = offset % BD(dev).bd_sectorsize; + dblk = offset / bd->bd_sectorsize; + blkoff = offset % bd->bd_sectorsize; /* * Check the value of the size argument. We do have quite small @@ -610,8 +898,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s return (EIO); } - blks = size / BD(dev).bd_sectorsize; - if (blks == 0 || (size % BD(dev).bd_sectorsize) != 0) + blks = size / bd->bd_sectorsize; + if (blks == 0 || (size % bd->bd_sectorsize) != 0) blks++; if (dblk > dblk + blks) @@ -624,44 +912,48 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s * Get disk blocks, this value is either for whole disk or for * partition. */ - if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { - /* DIOCGMEDIASIZE does return bytes. */ - disk_blocks /= BD(dev).bd_sectorsize; - } else { - /* We should not get here. Just try to survive. */ - disk_blocks = BD(dev).bd_sectors - dev->d_offset; + d_offset = 0; + disk_blocks = 0; + if (dev->dd.d_dev->dv_type == DEVT_DISK) { + if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { + /* DIOCGMEDIASIZE does return bytes. */ + disk_blocks /= bd->bd_sectorsize; + } + d_offset = dev->d_offset; } + if (disk_blocks == 0) + disk_blocks = bd->bd_sectors - d_offset; /* Validate source block address. */ - if (dblk < dev->d_offset || dblk >= dev->d_offset + disk_blocks) + if (dblk < d_offset || dblk >= d_offset + disk_blocks) return (EIO); /* * Truncate if we are crossing disk or partition end. */ - if (dblk + blks >= dev->d_offset + disk_blocks) { - blks = dev->d_offset + disk_blocks - dblk; - size = blks * BD(dev).bd_sectorsize; + if (dblk + blks >= d_offset + disk_blocks) { + blks = d_offset + disk_blocks - dblk; + size = blks * bd->bd_sectorsize; DEBUG("short I/O %d", blks); } - if (V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize == 0) + if (V86_IO_BUFFER_SIZE / bd->bd_sectorsize == 0) panic("BUG: Real mode buffer is too small"); bbuf = PTOV(V86_IO_BUFFER); rest = size; while (blks > 0) { - int x = min(blks, V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize); + int x = min(blks, V86_IO_BUFFER_SIZE / bd->bd_sectorsize); switch (rw & F_MASK) { case F_READ: DEBUG("read %d from %lld to %p", x, dblk, buf); - bsize = BD(dev).bd_sectorsize * x - blkoff; + bsize = bd->bd_sectorsize * x - blkoff; if (rest < bsize) bsize = rest; - if ((rc = bd_io(dev, dblk, x, bbuf, BD_RD)) != 0) + if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_RD)) != 0) return (EIO); bcopy(bbuf + blkoff, buf, bsize); @@ -674,27 +966,27 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s * bbuf. */ x = 1; - bsize = BD(dev).bd_sectorsize - blkoff; + bsize = bd->bd_sectorsize - blkoff; bsize = min(bsize, rest); - rc = bd_io(dev, dblk, x, bbuf, BD_RD); - } else if (rest < BD(dev).bd_sectorsize) { + rc = bd_io(dev, bd, dblk, x, bbuf, BD_RD); + } else if (rest < bd->bd_sectorsize) { /* * The remaining block is not full * sector. Read 1 sector to bbuf. */ x = 1; bsize = rest; - rc = bd_io(dev, dblk, x, bbuf, BD_RD); + rc = bd_io(dev, bd, dblk, x, bbuf, BD_RD); } else { /* We can write full sector(s). */ - bsize = BD(dev).bd_sectorsize * x; + bsize = bd->bd_sectorsize * x; } /* * Put your Data In, Put your Data out, * Put your Data In, and shake it all about */ bcopy(buf, bbuf + blkoff, bsize); - if ((rc = bd_io(dev, dblk, x, bbuf, BD_WR)) != 0) + if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_WR)) != 0) return (EIO); break; @@ -716,7 +1008,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s } static int -bd_edd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, +bd_edd_io(bdinfo_t *bd, daddr_t dblk, int blks, caddr_t dest, int dowrite) { static struct edd_packet packet; @@ -733,7 +1025,7 @@ bd_edd_io(struct disk_devdesc *dev, daddr_t dblk, int v86.eax = 0x4300; else v86.eax = 0x4200; - v86.edx = BD(dev).bd_unit; + v86.edx = bd->bd_unit; v86.ds = VTOPSEG(&packet); v86.esi = VTOPOFF(&packet); v86int(); @@ -743,17 +1035,17 @@ bd_edd_io(struct disk_devdesc *dev, daddr_t dblk, int } static int -bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, +bd_chs_io(bdinfo_t *bd, daddr_t dblk, int blks, caddr_t dest, int dowrite) { uint32_t x, bpc, cyl, hd, sec; - bpc = BD(dev).bd_sec * BD(dev).bd_hds; /* blocks per cylinder */ + bpc = bd->bd_sec * bd->bd_hds; /* blocks per cylinder */ x = dblk; cyl = x / bpc; /* block # / blocks per cylinder */ x %= bpc; /* block offset into cylinder */ - hd = x / BD(dev).bd_sec; /* offset / blocks per track */ - sec = x % BD(dev).bd_sec; /* offset into track */ + hd = x / bd->bd_sec; /* offset / blocks per track */ + sec = x % bd->bd_sec; /* offset into track */ /* correct sector number for 1-based BIOS numbering */ sec++; @@ -770,7 +1062,7 @@ bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int else v86.eax = 0x200 | blks; v86.ecx = ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec; - v86.edx = (hd << 8) | BD(dev).bd_unit; + v86.edx = (hd << 8) | bd->bd_unit; v86.es = VTOPSEG(dest); v86.ebx = VTOPOFF(dest); v86int(); @@ -780,16 +1072,16 @@ bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int } static void -bd_io_workaround(struct disk_devdesc *dev) +bd_io_workaround(bdinfo_t *bd) { uint8_t buf[8 * 1024]; - bd_edd_io(dev, 0xffffffff, 1, (caddr_t)buf, BD_RD); + bd_edd_io(bd, 0xffffffff, 1, (caddr_t)buf, BD_RD); } static int -bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, - int dowrite) +bd_io(struct disk_devdesc *dev, bdinfo_t *bd, daddr_t dblk, int blks, + caddr_t dest, int dowrite) { int result, retry; @@ -809,20 +1101,20 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks * may also retry. */ if (dowrite == BD_RD && dblk >= 0x100000000) - bd_io_workaround(dev); + bd_io_workaround(bd); for (retry = 0; retry < 3; retry++) { - if (BD(dev).bd_flags & BD_MODEEDD) - result = bd_edd_io(dev, dblk, blks, dest, dowrite); + if (bd->bd_flags & BD_MODEEDD) + result = bd_edd_io(bd, dblk, blks, dest, dowrite); else - result = bd_chs_io(dev, dblk, blks, dest, dowrite); + result = bd_chs_io(bd, dblk, blks, dest, dowrite); if (result == 0) { - if (BD(dev).bd_flags & BD_NO_MEDIA) - BD(dev).bd_flags &= ~BD_NO_MEDIA; + if (bd->bd_flags & BD_NO_MEDIA) + bd->bd_flags &= ~BD_NO_MEDIA; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 30 08:50:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBF5E141E8CC; Sun, 30 Dec 2018 08:50:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EC7374E92; Sun, 30 Dec 2018 08:50:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53EBA2082C; Sun, 30 Dec 2018 08:50:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU8oZFE026579; Sun, 30 Dec 2018 08:50:35 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU8oZTB026578; Sun, 30 Dec 2018 08:50:35 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201812300850.wBU8oZTB026578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 30 Dec 2018 08:50: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: r342615 - stable/12/stand/common X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/common X-SVN-Commit-Revision: 342615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5EC7374E92 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.91)[-0.908,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 08:50:35 -0000 Author: tsoome Date: Sun Dec 30 08:50:34 2018 New Revision: 342615 URL: https://svnweb.freebsd.org/changeset/base/342615 Log: MFC: r341231 loader: command_bcache() should print unsigned values All bcache counters are unsigned. Modified: stable/12/stand/common/bcache.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/common/bcache.c ============================================================================== --- stable/12/stand/common/bcache.c Sun Dec 30 08:30:11 2018 (r342614) +++ stable/12/stand/common/bcache.c Sun Dec 30 08:50:34 2018 (r342615) @@ -491,12 +491,12 @@ command_bcache(int argc, char *argv[]) return(CMD_ERROR); } - printf("\ncache blocks: %d\n", bcache_total_nblks); - printf("cache blocksz: %d\n", bcache_blksize); - printf("cache readahead: %d\n", bcache_rablks); - printf("unit cache blocks: %d\n", bcache_unit_nblks); - printf("cached units: %d\n", bcache_units); - printf("%d ops %d bypasses %d hits %d misses\n", bcache_ops, + printf("\ncache blocks: %u\n", bcache_total_nblks); + printf("cache blocksz: %u\n", bcache_blksize); + printf("cache readahead: %u\n", bcache_rablks); + printf("unit cache blocks: %u\n", bcache_unit_nblks); + printf("cached units: %u\n", bcache_units); + printf("%u ops %d bypasses %u hits %u misses\n", bcache_ops, bcache_bypasses, bcache_hits, bcache_misses); return(CMD_OK); } From owner-svn-src-all@freebsd.org Sun Dec 30 15:55:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E22B142C0CB; Sun, 30 Dec 2018 15:55:31 +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 F1BE88A57B; Sun, 30 Dec 2018 15:55:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFBE525314; Sun, 30 Dec 2018 15:55:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBUFtUtp054248; Sun, 30 Dec 2018 15:55:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFtUEo054247; Sun, 30 Dec 2018 15:55:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301555.wBUFtUEo054247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342629 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 342629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F1BE88A57B 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.961,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)[-0.998,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, 30 Dec 2018 15:55:31 -0000 Author: kib Date: Sun Dec 30 15:55:30 2018 New Revision: 342629 URL: https://svnweb.freebsd.org/changeset/base/342629 Log: Bump __FreeBSD_version since r342628 changed size of struct linux_cdev on tier-1 i386 architecture. Requested by: hselasky MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Dec 30 15:46:45 2018 (r342628) +++ head/sys/sys/param.h Sun Dec 30 15:55:30 2018 (r342629) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300006 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300007 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sun Dec 30 08:22:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BFAF141BD0E; Sun, 30 Dec 2018 08:22:37 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B21D7429C; Sun, 30 Dec 2018 08:22:37 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D4CE204B2; Sun, 30 Dec 2018 08:22:37 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU8MbHB015708; Sun, 30 Dec 2018 08:22:37 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU8Magn015702; Sun, 30 Dec 2018 08:22:36 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201812300822.wBU8Magn015702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Sun, 30 Dec 2018 08:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342613 - head/contrib/tzdata X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/contrib/tzdata X-SVN-Commit-Revision: 342613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4B21D7429C 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.935,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 08:22:38 -0000 Author: philip Date: Sun Dec 30 08:22:35 2018 New Revision: 342613 URL: https://svnweb.freebsd.org/changeset/base/342613 Log: Import tzdata 2018h Changes: https://github.com/eggert/tz/blob/2018h/NEWS MFC after: 3 days Modified: head/contrib/tzdata/Makefile head/contrib/tzdata/NEWS head/contrib/tzdata/africa head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/leapseconds head/contrib/tzdata/leapseconds.awk head/contrib/tzdata/northamerica head/contrib/tzdata/theory.html head/contrib/tzdata/version head/contrib/tzdata/ziguard.awk head/contrib/tzdata/zone.tab head/contrib/tzdata/zone1970.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/Makefile ============================================================================== --- head/contrib/tzdata/Makefile Sun Dec 30 08:14:09 2018 (r342612) +++ head/contrib/tzdata/Makefile Sun Dec 30 08:22:35 2018 (r342613) @@ -380,15 +380,18 @@ AWK= awk # is typically nicer if it works. KSHELL= /bin/bash +# Name of curl , used for HTML validation. +CURL= curl + # The path where SGML DTDs are kept and the catalog file(s) to use when -# validating. The default should work on both Debian and Red Hat. +# validating HTML 4.01. The default should work on both Debian and Red Hat. SGML_TOPDIR= /usr SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224 SGML_CATALOG_FILES= \ $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat -# The name, arguments and environment of a program to validate your web pages. +# The name, arguments and environment of a program to validate HTML 4.01. # See for a validator, and # for a validation library. # Set VALIDATE=':' if you do not have such a program. @@ -488,6 +491,7 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.t COMMON= calendars CONTRIBUTING LICENSE Makefile \ NEWS README theory.html version WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +CHECK_WEB_PAGES=check_tz-art.html check_tz-how-to.html check_tz-link.html DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) PRIMARY_YDATA= africa antarctica asia australasia \ europe northamerica southamerica @@ -799,9 +803,15 @@ check_tzs: $(TZS) $(TZS_NEW) fi touch $@ -# This checks only the HTML 4.01 strict page. -# To check the the other pages, use . -check_web: tz-how-to.html +check_web: $(CHECK_WEB_PAGES) +check_tz-art.html: tz-art.html +check_tz-link.html: tz-link.html +check_tz-art.html check_tz-link.html: + $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ + -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \ + test ! -s $@.out || { cat $@.out; exit 1; } + mv $@.out $@ +check_tz-how-to.html: tz-how-to.html $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html touch $@ @@ -1068,7 +1078,7 @@ zic.o: private.h tzfile.h version.h .PHONY: ALL INSTALL all .PHONY: check check_time_t_alternatives -.PHONY: check_zishrink +.PHONY: check_web check_zishrink .PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names .PHONY: posix_only posix_packrat posix_right public Modified: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Sun Dec 30 08:14:09 2018 (r342612) +++ head/contrib/tzdata/NEWS Sun Dec 30 08:22:35 2018 (r342613) @@ -1,14 +1,91 @@ News for the tz database +Release 2018h - 2018-12-23 17:59:32 -0800 + + Briefly: + Qyzylorda, Kazakhstan moved from +06 to +05 on 2018-12-21. + New zone Asia/Qostanay because Qostanay, Kazakhstan didn't move. + Metlakatla, Alaska observes PST this winter only. + Guess Morocco will continue to adjust clocks around Ramadan. + Add predictions for Iran from 2038 through 2090. + + Changes to future timestamps + + Guess that Morocco will continue to fall back just before and + spring forward just after Ramadan, the practice since 2012. + (Thanks to Maamar Abdelkader.) This means Morocco will observe + negative DST during Ramadan in main and vanguard formats, and in + rearguard format it stays in the +00 timezone and observes + ordinary DST in all months other than Ramadan. As before, extend + this guesswork to the year 2037. As a consequence, Morocco is + scheduled to observe three DST transitions in some Gregorian years + (e.g., 2033) due to the mismatch between the Gregorian and Islamic + calendars. + + The table of exact transitions for Iranian DST has been extended. + It formerly cut off before the year 2038 in a nod to 32-bit time_t. + It now cuts off before 2091 as there is doubt about how the Persian + calendar will treat 2091. This change predicts DST transitions in + 2038-9, 2042-3, and 2046-7 to occur one day later than previously + predicted. As before, post-cutoff transitions are approximated. + + Changes to past and future timestamps + + Qyzylorda (aka Kyzylorda) oblast in Kazakhstan moved from +06 to + +05 on 2018-12-21. This is a zone split as Qostanay (aka + Kostanay) did not switch, so create a zone Asia/Qostanay. + + Metlakatla moved from Alaska to Pacific standard time on 2018-11-04. + It did not change clocks that day and remains on -08 this winter. + (Thanks to Ryan Stanley.) It will revert to the usual Alaska + rules next spring, so this change affects only timestamps + from 2018-11-04 through 2019-03-10. + + Change to past timestamps + + Kwajalein's 1993-08-20 transition from -12 to +12 was at 24:00, + not 00:00. I transcribed the time incorrectly from Shanks. + (Thanks to Phake Nick.) + + Nauru's 1979 transition was on 02-10 at 02:00, not 05-01 at 00:00. + (Thanks to Phake Nick.) + + Guam observed DST irregularly from 1959 through 1977. + (Thanks to Phake Nick.) + + Hong Kong observed DST in 1941 starting 06-15 (not 04-01), then on + 10-01 changed standard time to +08:30 (not +08). Its transition + back to +08 after WWII was on 1945-09-15, not the previous day. + Its 1904-10-30 change took effect at 01:00 +08 (not 00:00 LMT). + (Thanks to Phake Nick, Steve Allen, and Joseph Myers.) Also, + its 1952 fallback was on 11-02 (not 10-25). + + This release contains many changes to timestamps before 1946 due + to Japanese possession or occupation of Pacific/Chuuk, + Pacific/Guam, Pacific/Kosrae, Pacific/Kwajalein, Pacific/Majuro, + Pacific/Nauru, Pacific/Palau, and Pacific/Pohnpei. + (Thanks to Phake Nick.) + + Assume that the Spanish East Indies was like the Philippines and + observed American time until the end of 1844. This affects + Pacific/Chuuk, Pacific/Kosrae, Pacific/Palau, and Pacific/Pohnpei. + + Changes to past tm_isdst flags + + For the recent Morocco change, the tm_isdst flag should be 1 from + 2018-10-27 00:00 to 2018-10-28 03:00. (Thanks to Michael Deckers.) + Give a URL to the official decree. (Thanks to Matt Johnson.) + + Release 2018g - 2018-10-26 22:22:45 -0700 Briefly: - Morocco switches to permanent +01 on 2018-10-27. + Morocco switches to permanent +01 on 2018-10-28. Changes to future timestamps - Morocco switches from +00/+01 to permanent +01 effective 2018-10-27, - so its clocks will not fall back on 2018-10-28 as previously scheduled. + Morocco switches from +00/+01 to permanent +01 effective 2018-10-28, + so its clocks will not fall back as previously scheduled. (Thanks to Mohamed Essedik Najd and Brian Inglis.) Changes to code @@ -119,7 +196,7 @@ Release 2018f - 2018-10-18 00:14:18 -0700 localtime.c no longer ignores TZif POSIX-style TZ strings that specify only standard time. Instead, these TZ strings now override the default time type for timestamps after the last - transition (or for all time stamps if there are no transitions), + transition (or for all timestamps if there are no transitions), just as DST strings specifying DST have always done. leapseconds.awk now outputs "#updated" and "#expires" comments, Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Sun Dec 30 08:14:09 2018 (r342612) +++ head/contrib/tzdata/africa Sun Dec 30 08:22:35 2018 (r342613) @@ -847,8 +847,41 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # From Mohamed Essedik Najd (2018-10-26): # Today, a Moroccan government council approved the perpetual addition # of 60 minutes to the regular Moroccan timezone. -# From Brian Inglis (2018-10-26): -# http://www.maroc.ma/fr/actualites/le-conseil-de-gouvernement-adopte-un-projet-de-decret-relatif-lheure-legale-stipulant-le +# From Matt Johnson (2018-10-28): +# http://www.sgg.gov.ma/Portals/1/BO/2018/BO_6720-bis_Ar.pdf +# +# From Maamar Abdelkader (2018-11-01): +# We usually move clocks back the previous week end and come back to the +1 +# the week end after.... The government does not announce yet the decision +# about this temporary change. But it s 99% sure that it will be the case, +# as in previous years. An unofficial survey was done these days, showing +# that 64% of asked peopke are ok for moving from +1 to +0 during Ramadan. +# https://leconomiste.com/article/1035870-enquete-l-economiste-sunergia-64-des-marocains-plebiscitent-le-gmt-pendant-ramadan +# +# From Paul Eggert (2018-11-01): +# For now, guess that Morocco will fall back at 03:00 the last Sunday +# before Ramadan, and spring forward at 02:00 the first Sunday after +# Ramadan, as this has been the practice since 2012. To implement this, +# transition dates for 2019 through 2037 were determined by running the +# following program under GNU Emacs 26.1. +# (let ((islamic-year 1440)) +# (require 'cal-islam) +# (while (< islamic-year 1460) +# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) +# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (sunday 0)) +# (while (/= sunday (mod (setq a (1- a)) 7))) +# (while (/= sunday (mod b 7)) +# (setq b (1+ b))) +# (setq a (calendar-gregorian-from-absolute a)) +# (setq b (calendar-gregorian-from-absolute b)) +# (insert +# (format +# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t-1:00\t-\n" +# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t0\t-\n") +# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) +# (setq islamic-year (+ 1 islamic-year)))) # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Morocco 1939 only - Sep 12 0:00 1:00 - @@ -892,13 +925,53 @@ Rule Morocco 2017 only - May 21 3:00 0 - Rule Morocco 2017 only - Jul 2 2:00 1:00 - Rule Morocco 2018 only - May 13 3:00 0 - Rule Morocco 2018 only - Jun 17 2:00 1:00 - +Rule Morocco 2019 only - May 5 3:00 -1:00 - +Rule Morocco 2019 only - Jun 9 2:00 0 - +Rule Morocco 2020 only - Apr 19 3:00 -1:00 - +Rule Morocco 2020 only - May 24 2:00 0 - +Rule Morocco 2021 only - Apr 11 3:00 -1:00 - +Rule Morocco 2021 only - May 16 2:00 0 - +Rule Morocco 2022 only - Mar 27 3:00 -1:00 - +Rule Morocco 2022 only - May 8 2:00 0 - +Rule Morocco 2023 only - Mar 19 3:00 -1:00 - +Rule Morocco 2023 only - Apr 23 2:00 0 - +Rule Morocco 2024 only - Mar 10 3:00 -1:00 - +Rule Morocco 2024 only - Apr 14 2:00 0 - +Rule Morocco 2025 only - Feb 23 3:00 -1:00 - +Rule Morocco 2025 only - Apr 6 2:00 0 - +Rule Morocco 2026 only - Feb 15 3:00 -1:00 - +Rule Morocco 2026 only - Mar 22 2:00 0 - +Rule Morocco 2027 only - Feb 7 3:00 -1:00 - +Rule Morocco 2027 only - Mar 14 2:00 0 - +Rule Morocco 2028 only - Jan 23 3:00 -1:00 - +Rule Morocco 2028 only - Feb 27 2:00 0 - +Rule Morocco 2029 only - Jan 14 3:00 -1:00 - +Rule Morocco 2029 only - Feb 18 2:00 0 - +Rule Morocco 2029 only - Dec 30 3:00 -1:00 - +Rule Morocco 2030 only - Feb 10 2:00 0 - +Rule Morocco 2030 only - Dec 22 3:00 -1:00 - +Rule Morocco 2031 only - Jan 26 2:00 0 - +Rule Morocco 2031 only - Dec 14 3:00 -1:00 - +Rule Morocco 2032 only - Jan 18 2:00 0 - +Rule Morocco 2032 only - Nov 28 3:00 -1:00 - +Rule Morocco 2033 only - Jan 9 2:00 0 - +Rule Morocco 2033 only - Nov 20 3:00 -1:00 - +Rule Morocco 2033 only - Dec 25 2:00 0 - +Rule Morocco 2034 only - Nov 5 3:00 -1:00 - +Rule Morocco 2034 only - Dec 17 2:00 0 - +Rule Morocco 2035 only - Oct 28 3:00 -1:00 - +Rule Morocco 2035 only - Dec 2 2:00 0 - +Rule Morocco 2036 only - Oct 19 3:00 -1:00 - +Rule Morocco 2036 only - Nov 23 2:00 0 - +Rule Morocco 2037 only - Oct 4 3:00 -1:00 - +Rule Morocco 2037 only - Nov 15 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 0:00 Morocco +00/+01 1984 Mar 16 1:00 - +01 1986 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Western Sahara # @@ -913,8 +986,8 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún -1:00 - -01 1976 Apr 14 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Mozambique # Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Sun Dec 30 08:14:09 2018 (r342612) +++ head/contrib/tzdata/asia Sun Dec 30 08:22:35 2018 (r342613) @@ -586,12 +586,82 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # obtained from # http://www.hko.gov.hk/gts/time/Summertime.htm -# From Arthur David Olson (2009-10-28): +# From Phake Nick (2018-10-27): +# According to Singaporean newspaper +# http://eresources.nlb.gov.sg/newspapers/Digitised/Article/singfreepresswk19041102-1.2.37 +# the day that Hong Kong start using GMT+8 should be Oct 30, 1904. +# +# From Paul Eggert (2018-11-17): +# Hong Kong had a time ball near the Marine Police Station, Tsim Sha Tsui. +# "The ball was raised manually each day and dropped at exactly 1pm +# (except on Sundays and Government holidays)." +# Dyson AD. From Time Ball to Atomic Clock. Hong Kong Government. 1983. +# +# "From 1904 October 30 the time-ball at Hong Kong has been dropped by order +# of the Governor of the Colony at 17h 0m 0s G.M.T., which is 23m 18s.14 in +# advance of 1h 0m 0s of Hong Kong mean time." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 +# +# From Joseph Myers (2018-11-18): +# An astronomer before 1925 referring to GMT would have been using the old +# astronomical convention where the day started at noon, not midnight. +# +# From Steve Allen (2018-11-17): +# Meteorological Observations made at the Hongkong Observatory in the year 1904 +# page 4 +# ... the log of drop times in Table II shows that on Sunday 1904-10-30 the +# ball was dropped. So that looks like a special case drop for the sake +# of broadcasting the new local time. +# +# From Phake Nick (2018-11-18): +# According to The Hong Kong Weekly Press, 1904-10-29, p.324, the +# governor of Hong Kong at the time stated that "We are further desired to +# make it known that the change will be effected by firing the gun and by the +# dropping of the Ball at 23min. 18sec. before one." +# From Paul Eggert (2018-11-18): +# See for this; unfortunately Flash is required. + +# From Phake Nick (2018-10-26): +# I went to check microfilm records stored at Hong Kong Public Library.... +# on September 30 1941, according to Ta Kung Pao (Hong Kong edition), it was +# stated that fallback would occur on the next day (the 1st)'s "03:00 am (Hong +# Kong Time 04:00 am)" and the clock will fall back for a half hour. (03:00 +# probably refer to the time commonly used in mainland China at the time given +# the paper's background) ... the sunrise/sunset time given by South China +# Morning Post for October 1st was indeed moved by half an hour compares to +# before. After that, in December, the battle to capture Hong Kong started and +# the library doesn't seems to have any record stored about press during that +# period of time. Some media resumed publication soon after that within the +# same month, but there were not much information about time there. Later they +# started including a radio program guide when they restored radio service, +# explicitly mentioning it use Tokyo standard time, and later added a note +# saying it's half an hour ahead of the old Hong Kong standard time, and it +# also seems to indicate that Hong Kong was not using GMT+8 when it was +# captured by Japan. +# +# Image of related sections on newspaper: +# * 1941-09-30, Ta Kung Pao (Hong Kong), "Winter Time start tomorrow". +# https://i.imgur.com/6waY51Z.jpg (Chinese) +# * 1941-09-29, South China Morning Post, Information on sunrise/sunset +# time and other things for September 30 and October 1. +# https://i.imgur.com/kCiUR78.jpg +# * 1942-02-05. The Hong Kong News, Radio Program Guide. +# https://i.imgur.com/eVvDMzS.jpg +# * 1941-06-14. Hong Kong Daily Press, Daylight Saving from 3am Tomorrow. +# https://i.imgur.com/05KkvtC.png +# * 1941-09-30, Hong Kong Daily Press, Winter Time Warning. +# https://i.imgur.com/dge4kFJ.png +# Also, the Liberation day of Hong Kong after WWII which British rule +# over the territory resumed was August 30, 1945, which I think should +# be the termination date for the use of JST in the territory.... + +# From Paul Eggert (2018-11-17): # Here are the dates given at -# http://www.hko.gov.hk/gts/time/Summertime.htm -# as of 2009-10-28: +# https://www.hko.gov.hk/gts/time/Summertime.htm +# as of 2014-06-19: # Year Period -# 1941 1 Apr to 30 Sep +# 1941 15 Jun to 30 Sep # 1942 Whole year # 1943 Whole year # 1944 Whole year @@ -602,7 +672,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1949 3 Apr to 30 Oct # 1950 2 Apr to 29 Oct # 1951 1 Apr to 28 Oct -# 1952 6 Apr to 25 Oct +# 1952 6 Apr to 2 Nov # 1953 5 Apr to 1 Nov # 1954 21 Mar to 31 Oct # 1955 20 Mar to 6 Nov @@ -631,25 +701,25 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1978 Nil # 1979 13 May to 21 Oct # 1980 to Now Nil -# The page does not give start or end times of day. -# The page does not give a start date for 1942. -# The page does not givw an end date for 1945. -# The Japanese occupation of Hong Kong began on 1941-12-25. -# The Japanese surrender of Hong Kong was signed 1945-09-15. -# For lack of anything better, use start of those days as the transition times. +# The page does not give times of day for transitions, +# or dates for the 1942 and 1945 transitions. +# The Japanese occupation of Hong Kong began 1941-12-25. +# The Japanese surrender of Hong Kong was signed 1945-09-16; see: +# Heaver S. The days after the Pacific war ended: unsettling times +# in Hong Kong. Post Magazine. 2016-06-13. +# https://www.scmp.com/magazines/post-magazine/article/1852990/days-after-pacific-war-ended-unsettling-times-hong-kong +# For lack of anything better, use start of those days as the +# transition times. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule HK 1941 only - Apr 1 3:30 1:00 S -Rule HK 1941 only - Sep 30 3:30 0 - Rule HK 1946 only - Apr 20 3:30 1:00 S Rule HK 1946 only - Dec 1 3:30 0 - Rule HK 1947 only - Apr 13 3:30 1:00 S Rule HK 1947 only - Dec 30 3:30 0 - Rule HK 1948 only - May 2 3:30 1:00 S Rule HK 1948 1951 - Oct lastSun 3:30 0 - -Rule HK 1952 only - Oct 25 3:30 0 - +Rule HK 1952 1953 - Nov Sun>=1 3:30 0 - Rule HK 1949 1953 - Apr Sun>=1 3:30 1:00 S -Rule HK 1953 only - Nov 1 3:30 0 - Rule HK 1954 1964 - Mar Sun>=18 3:30 1:00 S Rule HK 1954 only - Oct 31 3:30 0 - Rule HK 1955 1964 - Nov Sun>=1 3:30 0 - @@ -659,9 +729,11 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S Rule HK 1979 only - May Sun>=8 3:30 1:00 S Rule HK 1979 only - Oct Sun>=16 3:30 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 - 8:00 HK HK%sT 1941 Dec 25 - 9:00 - JST 1945 Sep 15 +Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42 + 8:00 - HKT 1941 Jun 15 3:30 + 8:00 1:00 HKST 1941 Oct 1 4:00 + 8:30 - HKT 1941 Dec 25 + 9:00 - JST 1945 Sep 16 8:00 HK HK%sT ############################################################################### @@ -1057,6 +1129,16 @@ Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 # India +# British astronomer Henry Park Hollis disliked India Standard Time's offset: +# "A new time system has been proposed for India, Further India, and Burmah. +# The scheme suggested is that the times of the meridians 5½ and 6½ hours +# east of Greenwich should be adopted in these territories. No reason is +# given why hourly meridians five hours and six hours east should not be +# chosen; a plan which would bring the time of India into harmony with +# that of almost the whole of the civilised world." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 + # From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic # https://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/ # (2015-12-22): @@ -1227,12 +1309,65 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # leap year calculation involved. There has never been any serious # plan to change that law.... # -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2018-11-30): # Go with Shanks & Pottenger before Sept. 1991, and with Pournader thereafter. -# I used Ed Reingold's cal-persia in GNU Emacs 21.2 to check Persian dates, -# stopping after 2037 when 32-bit time_t's overflow. -# That cal-persia used Birashk's approximation, which disagrees with the solar -# calendar predictions for the year 2025, so I corrected those dates by hand. +# I used the following code in GNU Emacs 26.1 to generate the "Rule Iran" +# lines from 2008 through 2087. Emacs 26.1 uses Ed Reingold's +# cal-persia implementation of Birashk's approximation, which in the +# 2008-2087 range disagrees with the the astronomical Persian calendar +# for Persian years 1404 (Gregorian 2025) and 1437 (Gregorian 2058), +# so the following code special-case those years. See Table 15.1, page 264, of: +# Edward M. Reingold and Nachum Dershowitz, Calendrical Calculations: +# The Ultimate Edition, Cambridge University Press (2018). +# https://www.cambridge.org/fr/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition +# Page 258, footnote 2, of this book says there is some dispute over what will +# happen in 2091 (and some other years after that), so this code +# stops in 2087, as 2088 and 2089 agree with the "max" rule below. +# (cl-loop +# initially (require 'cal-persia) +# with first-persian-year = 1387 +# with last-persian-year = 1466 +# ;; Exceptional years in the above range, +# ;; from Reingold & Dershowitz Table 15.1, page 264: +# with exceptional-persian-years = '(1404 1437) +# with range-start = nil +# for persian-year from first-persian-year to last-persian-year +# do +# (let* +# ((exceptional-year-offset +# (if (member persian-year exceptional-persian-years) 1 0)) +# (beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 persian-year)) +# exceptional-year-offset)) +# (end-dst-absolute +# (+ (calendar-persian-to-absolute (list 6 30 persian-year)) +# exceptional-year-offset)) +# (next-year-beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 (1+ persian-year))) +# (if (member (1+ persian-year) exceptional-persian-years) 1 0))) +# (beg-dst (calendar-gregorian-from-absolute beg-dst-absolute)) +# (end-dst (calendar-gregorian-from-absolute end-dst-absolute)) +# (next-year-beg-dst (calendar-gregorian-from-absolute +# next-year-beg-dst-absolute)) +# (year (calendar-extract-year beg-dst)) +# (range-end (if range-start year "only"))) +# (setq range-start (or range-start year)) +# (when (or (/= (calendar-extract-day beg-dst) +# (calendar-extract-day next-year-beg-dst)) +# (= persian-year last-persian-year)) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t1:00\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month beg-dst) t) +# (calendar-extract-day beg-dst))) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t0\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month end-dst) t) +# (calendar-extract-day end-dst))) +# (setq range-start nil)))) # # From Oscar van Vlijmen (2005-03-30), writing about future # discrepancies between cal-persia and the Iranian calendar: @@ -1267,61 +1402,113 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # thirtieth day of Shahrivar. # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iran 1978 1980 - Mar 21 0:00 1:00 - -Rule Iran 1978 only - Oct 21 0:00 0 - -Rule Iran 1979 only - Sep 19 0:00 0 - -Rule Iran 1980 only - Sep 23 0:00 0 - -Rule Iran 1991 only - May 3 0:00 1:00 - -Rule Iran 1992 1995 - Mar 22 0:00 1:00 - -Rule Iran 1991 1995 - Sep 22 0:00 0 - -Rule Iran 1996 only - Mar 21 0:00 1:00 - -Rule Iran 1996 only - Sep 21 0:00 0 - -Rule Iran 1997 1999 - Mar 22 0:00 1:00 - -Rule Iran 1997 1999 - Sep 22 0:00 0 - -Rule Iran 2000 only - Mar 21 0:00 1:00 - -Rule Iran 2000 only - Sep 21 0:00 0 - -Rule Iran 2001 2003 - Mar 22 0:00 1:00 - -Rule Iran 2001 2003 - Sep 22 0:00 0 - -Rule Iran 2004 only - Mar 21 0:00 1:00 - -Rule Iran 2004 only - Sep 21 0:00 0 - -Rule Iran 2005 only - Mar 22 0:00 1:00 - -Rule Iran 2005 only - Sep 22 0:00 0 - -Rule Iran 2008 only - Mar 21 0:00 1:00 - -Rule Iran 2008 only - Sep 21 0:00 0 - -Rule Iran 2009 2011 - Mar 22 0:00 1:00 - -Rule Iran 2009 2011 - Sep 22 0:00 0 - -Rule Iran 2012 only - Mar 21 0:00 1:00 - -Rule Iran 2012 only - Sep 21 0:00 0 - -Rule Iran 2013 2015 - Mar 22 0:00 1:00 - -Rule Iran 2013 2015 - Sep 22 0:00 0 - -Rule Iran 2016 only - Mar 21 0:00 1:00 - -Rule Iran 2016 only - Sep 21 0:00 0 - -Rule Iran 2017 2019 - Mar 22 0:00 1:00 - -Rule Iran 2017 2019 - Sep 22 0:00 0 - -Rule Iran 2020 only - Mar 21 0:00 1:00 - -Rule Iran 2020 only - Sep 21 0:00 0 - -Rule Iran 2021 2023 - Mar 22 0:00 1:00 - -Rule Iran 2021 2023 - Sep 22 0:00 0 - -Rule Iran 2024 only - Mar 21 0:00 1:00 - -Rule Iran 2024 only - Sep 21 0:00 0 - -Rule Iran 2025 2027 - Mar 22 0:00 1:00 - -Rule Iran 2025 2027 - Sep 22 0:00 0 - -Rule Iran 2028 2029 - Mar 21 0:00 1:00 - -Rule Iran 2028 2029 - Sep 21 0:00 0 - -Rule Iran 2030 2031 - Mar 22 0:00 1:00 - -Rule Iran 2030 2031 - Sep 22 0:00 0 - -Rule Iran 2032 2033 - Mar 21 0:00 1:00 - -Rule Iran 2032 2033 - Sep 21 0:00 0 - -Rule Iran 2034 2035 - Mar 22 0:00 1:00 - -Rule Iran 2034 2035 - Sep 22 0:00 0 - +Rule Iran 1978 1980 - Mar 20 24:00 1:00 - +Rule Iran 1978 only - Oct 20 24:00 0 - +Rule Iran 1979 only - Sep 18 24:00 0 - +Rule Iran 1980 only - Sep 22 24:00 0 - +Rule Iran 1991 only - May 2 24:00 1:00 - +Rule Iran 1992 1995 - Mar 21 24:00 1:00 - +Rule Iran 1991 1995 - Sep 21 24:00 0 - +Rule Iran 1996 only - Mar 20 24:00 1:00 - +Rule Iran 1996 only - Sep 20 24:00 0 - +Rule Iran 1997 1999 - Mar 21 24:00 1:00 - +Rule Iran 1997 1999 - Sep 21 24:00 0 - +Rule Iran 2000 only - Mar 20 24:00 1:00 - +Rule Iran 2000 only - Sep 20 24:00 0 - +Rule Iran 2001 2003 - Mar 21 24:00 1:00 - +Rule Iran 2001 2003 - Sep 21 24:00 0 - +Rule Iran 2004 only - Mar 20 24:00 1:00 - +Rule Iran 2004 only - Sep 20 24:00 0 - +Rule Iran 2005 only - Mar 21 24:00 1:00 - +Rule Iran 2005 only - Sep 21 24:00 0 - +Rule Iran 2008 only - Mar 20 24:00 1:00 - +Rule Iran 2008 only - Sep 20 24:00 0 - +Rule Iran 2009 2011 - Mar 21 24:00 1:00 - +Rule Iran 2009 2011 - Sep 21 24:00 0 - +Rule Iran 2012 only - Mar 20 24:00 1:00 - +Rule Iran 2012 only - Sep 20 24:00 0 - +Rule Iran 2013 2015 - Mar 21 24:00 1:00 - +Rule Iran 2013 2015 - Sep 21 24:00 0 - +Rule Iran 2016 only - Mar 20 24:00 1:00 - +Rule Iran 2016 only - Sep 20 24:00 0 - +Rule Iran 2017 2019 - Mar 21 24:00 1:00 - +Rule Iran 2017 2019 - Sep 21 24:00 0 - +Rule Iran 2020 only - Mar 20 24:00 1:00 - +Rule Iran 2020 only - Sep 20 24:00 0 - +Rule Iran 2021 2023 - Mar 21 24:00 1:00 - +Rule Iran 2021 2023 - Sep 21 24:00 0 - +Rule Iran 2024 only - Mar 20 24:00 1:00 - +Rule Iran 2024 only - Sep 20 24:00 0 - +Rule Iran 2025 2027 - Mar 21 24:00 1:00 - +Rule Iran 2025 2027 - Sep 21 24:00 0 - +Rule Iran 2028 2029 - Mar 20 24:00 1:00 - +Rule Iran 2028 2029 - Sep 20 24:00 0 - +Rule Iran 2030 2031 - Mar 21 24:00 1:00 - +Rule Iran 2030 2031 - Sep 21 24:00 0 - +Rule Iran 2032 2033 - Mar 20 24:00 1:00 - +Rule Iran 2032 2033 - Sep 20 24:00 0 - +Rule Iran 2034 2035 - Mar 21 24:00 1:00 - +Rule Iran 2034 2035 - Sep 21 24:00 0 - +Rule Iran 2036 2037 - Mar 20 24:00 1:00 - +Rule Iran 2036 2037 - Sep 20 24:00 0 - +Rule Iran 2038 2039 - Mar 21 24:00 1:00 - +Rule Iran 2038 2039 - Sep 21 24:00 0 - +Rule Iran 2040 2041 - Mar 20 24:00 1:00 - +Rule Iran 2040 2041 - Sep 20 24:00 0 - +Rule Iran 2042 2043 - Mar 21 24:00 1:00 - +Rule Iran 2042 2043 - Sep 21 24:00 0 - +Rule Iran 2044 2045 - Mar 20 24:00 1:00 - +Rule Iran 2044 2045 - Sep 20 24:00 0 - +Rule Iran 2046 2047 - Mar 21 24:00 1:00 - +Rule Iran 2046 2047 - Sep 21 24:00 0 - +Rule Iran 2048 2049 - Mar 20 24:00 1:00 - +Rule Iran 2048 2049 - Sep 20 24:00 0 - +Rule Iran 2050 2051 - Mar 21 24:00 1:00 - +Rule Iran 2050 2051 - Sep 21 24:00 0 - +Rule Iran 2052 2053 - Mar 20 24:00 1:00 - +Rule Iran 2052 2053 - Sep 20 24:00 0 - +Rule Iran 2054 2055 - Mar 21 24:00 1:00 - +Rule Iran 2054 2055 - Sep 21 24:00 0 - +Rule Iran 2056 2057 - Mar 20 24:00 1:00 - +Rule Iran 2056 2057 - Sep 20 24:00 0 - +Rule Iran 2058 2059 - Mar 21 24:00 1:00 - +Rule Iran 2058 2059 - Sep 21 24:00 0 - +Rule Iran 2060 2062 - Mar 20 24:00 1:00 - +Rule Iran 2060 2062 - Sep 20 24:00 0 - +Rule Iran 2063 only - Mar 21 24:00 1:00 - +Rule Iran 2063 only - Sep 21 24:00 0 - +Rule Iran 2064 2066 - Mar 20 24:00 1:00 - +Rule Iran 2064 2066 - Sep 20 24:00 0 - +Rule Iran 2067 only - Mar 21 24:00 1:00 - +Rule Iran 2067 only - Sep 21 24:00 0 - +Rule Iran 2068 2070 - Mar 20 24:00 1:00 - +Rule Iran 2068 2070 - Sep 20 24:00 0 - +Rule Iran 2071 only - Mar 21 24:00 1:00 - +Rule Iran 2071 only - Sep 21 24:00 0 - +Rule Iran 2072 2074 - Mar 20 24:00 1:00 - +Rule Iran 2072 2074 - Sep 20 24:00 0 - +Rule Iran 2075 only - Mar 21 24:00 1:00 - +Rule Iran 2075 only - Sep 21 24:00 0 - +Rule Iran 2076 2078 - Mar 20 24:00 1:00 - +Rule Iran 2076 2078 - Sep 20 24:00 0 - +Rule Iran 2079 only - Mar 21 24:00 1:00 - +Rule Iran 2079 only - Sep 21 24:00 0 - +Rule Iran 2080 2082 - Mar 20 24:00 1:00 - +Rule Iran 2080 2082 - Sep 20 24:00 0 - +Rule Iran 2083 only - Mar 21 24:00 1:00 - +Rule Iran 2083 only - Sep 21 24:00 0 - +Rule Iran 2084 2086 - Mar 20 24:00 1:00 - +Rule Iran 2084 2086 - Sep 20 24:00 0 - +Rule Iran 2087 only - Mar 21 24:00 1:00 - +Rule Iran 2087 only - Sep 21 24:00 0 - # -# The following rules are approximations starting in the year 2038. -# These are the best post-2037 approximations available, given the -# restrictions of a single rule using a Gregorian-based data format. +# The following rules are approximations starting in the year 2088. +# These are the best post-2088 approximations available, given the +# restrictions of a single rule using ordinary Gregorian dates. # At some point this table will need to be extended, though quite # possibly Iran will change the rules first. -Rule Iran 2036 max - Mar 21 0:00 1:00 - -Rule Iran 2036 max - Sep 21 0:00 0 - +Rule Iran 2088 max - Mar 20 24:00 1:00 - +Rule Iran 2088 max - Sep 20 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 @@ -1691,7 +1878,9 @@ Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u 9:00 Japan J%sT -# Since 1938, all Japanese possessions have been like Asia/Tokyo. +# Since 1938, all Japanese possessions have been like Asia/Tokyo, +# except that Truk (Chuuk), Ponape (Pohnpei), and Jaluit (Kosrae) did not +# switch from +10 to +09 until 1941-04-01; see the 'australasia' file. # Jordan # @@ -1981,8 +2170,10 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # and in Byalokoz) lists Ural river (plus 10 versts on its left bank) in # the third time belt (before 1930 this means +03). -# From Paul Eggert (2016-12-06): -# The tables below reflect Golosunov's remarks, with exceptions as noted. +# From Alexander Konzurovski (2018-12-20): +# Qyzyolrda Region (Asia/Qyzylorda) is changing its time zone from +# UTC+6 to UTC+5 effective December 21st, 2018. The legal document is +# located here: http://adilet.zan.kz/rus/docs/P1800000817 (russian language). # Zone NAME GMTOFF RULES FORMAT [UNTIL] # @@ -1996,8 +2187,6 @@ Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-A 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s 6:00 - +06 # Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY) -# This currently includes Qostanay (aka Kostanay, Kustanay) (KZ-KUS); -# see comments below. Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -2008,21 +2197,22 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s 6:00 RussiaAsia +06/+07 1992 Mar 29 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s - 6:00 - +06 -# The following zone is like Asia/Qyzylorda except for being one -# hour earlier from 1991-09-29 to 1992-03-29. The 1991/2 rules for -# Qostanay are unclear partly because of the 1997 Turgai -# reorganization, so this zone is commented out for now. -#Zone Asia/Qostanay 4:14:20 - LMT 1924 May 2 -# 4:00 - +04 1930 Jun 21 -# 5:00 - +05 1981 Apr 1 -# 5:00 1:00 +06 1981 Oct 1 -# 6:00 - +06 1982 Apr 1 -# 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s -# 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s -# 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s -# 6:00 - +06 + 6:00 - +06 2018 Dec 21 0:00 + 5:00 - +05 # +# Qostanay (aka Kostanay, Kustanay) (KZ-KUS) +# The 1991/2 rules are unclear partly because of the 1997 Turgai +# reorganization. +Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2 + 4:00 - +04 1930 Jun 21 + 5:00 - +05 1981 Apr 1 + 5:00 1:00 +06 1981 Oct 1 + 6:00 - +06 1982 Apr 1 + 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s + 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s + 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s + 6:00 - +06 + # Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 @@ -2116,21 +2306,43 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 # started at June 1 in that year. For another example, the article in # 1988 said that DST started at 2:00 AM in that year. +# From Phake Nick (2018-10-27): +# 1. According to official announcement from Korean government, the DST end +# date in South Korea should be +# 1955-09-08 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027977557 +# 1956-09-29 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027978341 +# 1957-09-21 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027979690#3 +# 1958-09-20 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027981189 +# 1959-09-19 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027982974#2 +# 1960-09-17 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0028044104 +# ... +# 2.... https://namu.wiki/w/대한민국%20표준시 ... [says] +# when Korea was using GMT+8:30 as standard time, the international +# aviation/marine/meteorological industry in the country refused to +# follow and continued to use GMT+9:00 for interoperability. + + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule ROK 1948 only - Jun 1 0:00 1:00 D -Rule ROK 1948 only - Sep 13 0:00 0 S -Rule ROK 1949 only - Apr 3 0:00 1:00 D -Rule ROK 1949 1951 - Sep Sun>=8 0:00 0 S -Rule ROK 1950 only - Apr 1 0:00 1:00 D -Rule ROK 1951 only - May 6 0:00 1:00 D -Rule ROK 1955 only - May 5 0:00 1:00 D -Rule ROK 1955 only - Sep 9 0:00 0 S -Rule ROK 1956 only - May 20 0:00 1:00 D -Rule ROK 1956 only - Sep 30 0:00 0 S -Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D -Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S -Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D -Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S +Rule ROK 1948 only - Jun 1 0:00 1:00 D +Rule ROK 1948 only - Sep 12 24:00 0 S +Rule ROK 1949 only - Apr 3 0:00 1:00 D +Rule ROK 1949 1951 - Sep Sat>=7 24:00 0 S +Rule ROK 1950 only - Apr 1 0:00 1:00 D +Rule ROK 1951 only - May 6 0:00 1:00 D +Rule ROK 1955 only - May 5 0:00 1:00 D +Rule ROK 1955 only - Sep 8 24:00 0 S +Rule ROK 1956 only - May 20 0:00 1:00 D +Rule ROK 1956 only - Sep 29 24:00 0 S +Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D +Rule ROK 1957 1960 - Sep Sat>=17 24:00 0 S +Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D +Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # From Paul Eggert (2016-08-23): # The Korean Wikipedia entry gives the following sources for UT offsets: @@ -2920,6 +3132,11 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # no information # Philippines + +# From Paul Eggert (2018-11-18): +# The Spanish initially used American (west-of-Greenwich) time. +# It is unknown what time Manila kept when the British occupied it from +# 1762-10-06 through 1764-04; for now assume it kept American time. # On 1844-08-16, Narciso Clavería, governor-general of the # Philippines, issued a proclamation announcing that 1844-12-30 was to # be immediately followed by 1845-01-01; see R.H. van Gent's @@ -3005,8 +3222,8 @@ Link Asia/Qatar Asia/Bahrain # going to run on Higgins Time.' And so, until last year, it did." See: # Antar E. Dinner at When? Saudi Aramco World, 1969 March/April. 2-3. # http://archive.aramcoworld.com/issue/196902/dinner.at.when.htm -# newspapers.com says a similar story about Higgins was published in the Port -# Angeles (WA) Evening News, 1965-03-10, page 5, but I lack access to the text. +# Also see: Antar EN. Arabian flying is confusing. +# Port Angeles (WA) Evening News. 1965-03-10. page 3. # # The TZ database cannot represent quasi-solar time; airline time is the best # we can do. The 1946 foreign air news digest of the U.S. Civil Aeronautics Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Sun Dec 30 08:14:09 2018 (r342612) +++ head/contrib/tzdata/australasia Sun Dec 30 08:22:35 2018 (r342613) @@ -402,10 +402,44 @@ Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete # it is uninhabited. # Guam + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# http://guamlegislature.com/Public_Laws_5th/PL05-025.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-59-7-Guam-Daylight-Savings-Time-May-6-1959.pdf +Rule Guam 1959 only - Jun 27 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-61-5-Revocation-of-Daylight-Saving-Time-and-Restoratio.pdf +Rule Guam 1961 only - Jan 29 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-67-13-Guam-Daylight-Savings-Time.pdf +Rule Guam 1967 only - Sep 1 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-69-2-Repeal-of-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jan 26 0:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-69-10-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jun 22 2:00 1:00 D +Rule Guam 1969 only - Aug 31 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-70-10-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-70-30-End-of-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-71-5-Guam-Daylight-Savings-Time.pdf +Rule Guam 1970 1971 - Apr lastSun 2:00 1:00 D +Rule Guam 1970 1971 - Sep Sun>=1 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-73-28.-Guam-Day-light-Saving-Time.pdf +Rule Guam 1973 only - Dec 16 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-74-7-Guam-Daylight-Savings-Time-Rescinded.pdf +Rule Guam 1974 only - Feb 24 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-76-13-Daylight-Savings-Time.pdf +Rule Guam 1976 only - May 26 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-76-25-Revocation-of-E.O.-76-13.pdf +Rule Guam 1976 only - Aug 22 2:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-77-4-Daylight-Savings-Time.pdf +Rule Guam 1977 only - Apr 24 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-77-18-Guam-Standard-Time.pdf +Rule Guam 1977 only - Aug 28 2:00 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Guam -14:21:00 - LMT 1844 Dec 31 9:39:00 - LMT 1901 # Agana - 10:00 - GST 2000 Dec 23 # Guam + 10:00 - GST 1941 Dec 10 # Guam + 9:00 - +09 1944 Jul 31 + 10:00 Guam G%sT 2000 Dec 23 10:00 - ChST # Chamorro Standard Time Link Pacific/Guam Pacific/Saipan # N Mariana Is @@ -427,31 +461,56 @@ Zone Pacific/Kiritimati -10:29:20 - LMT 1901 # Marshall Is # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Majuro 11:24:48 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 -Zone Pacific/Kwajalein 11:09:20 - LMT 1901 - 11:00 - +11 1969 Oct - -12:00 - -12 1993 Aug 20 - 12:00 - +12 +Zone Pacific/Majuro 11:24:48 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Jan 30 + 11:00 - +11 1969 Oct + 12:00 - +12 +Zone Pacific/Kwajalein 11:09:20 - LMT 1901 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Feb 6 + 11:00 - +11 1969 Oct + -12:00 - -12 1993 Aug 20 24:00 + 12:00 - +12 # Micronesia # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Chuuk 10:07:08 - LMT 1901 - 10:00 - +10 -Zone Pacific/Pohnpei 10:32:52 - LMT 1901 # Kolonia - 11:00 - +11 -Zone Pacific/Kosrae 10:51:56 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 1999 - 11:00 - +11 +Zone Pacific/Chuuk -13:52:52 - LMT 1844 Dec 31 + 10:07:08 - LMT 1901 + 10:00 - +10 1914 Oct + 9:00 - +09 1919 Feb 1 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 10:00 - +10 +Zone Pacific/Pohnpei -13:27:08 - LMT 1844 Dec 31 # Kolonia + 10:32:52 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 +Zone Pacific/Kosrae -13:08:04 - LMT 1844 Dec 31 + 10:51:56 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 1969 Oct + 12:00 - +12 1999 + 11:00 - +11 # Nauru # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe - 11:30 - +1130 1942 Mar 15 - 9:00 - +09 1944 Aug 15 - 11:30 - +1130 1979 May + 11:30 - +1130 1942 Aug 29 + 9:00 - +09 1945 Sep 8 + 11:30 - +1130 1979 Feb 10 2:00 12:00 - +12 # New Caledonia @@ -552,8 +611,9 @@ Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Palau 8:57:56 - LMT 1901 # Koror - 9:00 - +09 +Zone Pacific/Palau -15:02:04 - LMT 1844 Dec 31 # Koror + 8:57:56 - LMT 1901 + 9:00 - +09 # Papua New Guinea # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -815,7 +875,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2017-02-10): +# From Paul Eggert (2018-11-18): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -840,6 +900,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # +# I invented the abbreviation marked "*". # The following abbreviations are from other sources. # Corrections are welcome! # std dst @@ -847,7 +908,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # 8:00 AWST AWDT Western Australia # 9:30 ACST ACDT Central Australia # 10:00 AEST AEDT Eastern Australia -# 10:00 GST Guam through 2000 +# 10:00 GST GDT* Guam through 2000 # 10:00 ChST Chamorro # 11:30 NZMT NZST New Zealand through 1945 # 12:00 NZST NZDT New Zealand 1946-present @@ -1546,29 +1607,71 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # Kwajalein -# In comp.risks 14.87 (26 August 1993), Peter Neumann writes: -# I wonder what happened in Kwajalein, where there was NO Friday, -# 1993-08-20. Thursday night at midnight Kwajalein switched sides with *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 30 08:13:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD74D141B882; Sun, 30 Dec 2018 08:13:52 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51C04737D6; Sun, 30 Dec 2018 08:13:52 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22CEC202F0; Sun, 30 Dec 2018 08:13:52 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU8DqHE010416; Sun, 30 Dec 2018 08:13:52 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU8DpwH010411; Sun, 30 Dec 2018 08:13:51 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201812300813.wBU8DpwH010411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Sun, 30 Dec 2018 08:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r342611 - vendor/tzdata/dist X-SVN-Group: vendor X-SVN-Commit-Author: philip X-SVN-Commit-Paths: vendor/tzdata/dist X-SVN-Commit-Revision: 342611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51C04737D6 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.935,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 08:13:53 -0000 Author: philip Date: Sun Dec 30 08:13:51 2018 New Revision: 342611 URL: https://svnweb.freebsd.org/changeset/base/342611 Log: Import tzdata 2018h Modified: vendor/tzdata/dist/Makefile vendor/tzdata/dist/NEWS vendor/tzdata/dist/africa vendor/tzdata/dist/asia vendor/tzdata/dist/australasia vendor/tzdata/dist/leapseconds vendor/tzdata/dist/leapseconds.awk vendor/tzdata/dist/northamerica vendor/tzdata/dist/theory.html vendor/tzdata/dist/version vendor/tzdata/dist/ziguard.awk vendor/tzdata/dist/zone.tab vendor/tzdata/dist/zone1970.tab Modified: vendor/tzdata/dist/Makefile ============================================================================== --- vendor/tzdata/dist/Makefile Sun Dec 30 06:03:20 2018 (r342610) +++ vendor/tzdata/dist/Makefile Sun Dec 30 08:13:51 2018 (r342611) @@ -380,15 +380,18 @@ AWK= awk # is typically nicer if it works. KSHELL= /bin/bash +# Name of curl , used for HTML validation. +CURL= curl + # The path where SGML DTDs are kept and the catalog file(s) to use when -# validating. The default should work on both Debian and Red Hat. +# validating HTML 4.01. The default should work on both Debian and Red Hat. SGML_TOPDIR= /usr SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224 SGML_CATALOG_FILES= \ $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat -# The name, arguments and environment of a program to validate your web pages. +# The name, arguments and environment of a program to validate HTML 4.01. # See for a validator, and # for a validation library. # Set VALIDATE=':' if you do not have such a program. @@ -488,6 +491,7 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.t COMMON= calendars CONTRIBUTING LICENSE Makefile \ NEWS README theory.html version WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +CHECK_WEB_PAGES=check_tz-art.html check_tz-how-to.html check_tz-link.html DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) PRIMARY_YDATA= africa antarctica asia australasia \ europe northamerica southamerica @@ -799,9 +803,15 @@ check_tzs: $(TZS) $(TZS_NEW) fi touch $@ -# This checks only the HTML 4.01 strict page. -# To check the the other pages, use . -check_web: tz-how-to.html +check_web: $(CHECK_WEB_PAGES) +check_tz-art.html: tz-art.html +check_tz-link.html: tz-link.html +check_tz-art.html check_tz-link.html: + $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ + -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \ + test ! -s $@.out || { cat $@.out; exit 1; } + mv $@.out $@ +check_tz-how-to.html: tz-how-to.html $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html touch $@ @@ -1068,7 +1078,7 @@ zic.o: private.h tzfile.h version.h .PHONY: ALL INSTALL all .PHONY: check check_time_t_alternatives -.PHONY: check_zishrink +.PHONY: check_web check_zishrink .PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names .PHONY: posix_only posix_packrat posix_right public Modified: vendor/tzdata/dist/NEWS ============================================================================== --- vendor/tzdata/dist/NEWS Sun Dec 30 06:03:20 2018 (r342610) +++ vendor/tzdata/dist/NEWS Sun Dec 30 08:13:51 2018 (r342611) @@ -1,14 +1,91 @@ News for the tz database +Release 2018h - 2018-12-23 17:59:32 -0800 + + Briefly: + Qyzylorda, Kazakhstan moved from +06 to +05 on 2018-12-21. + New zone Asia/Qostanay because Qostanay, Kazakhstan didn't move. + Metlakatla, Alaska observes PST this winter only. + Guess Morocco will continue to adjust clocks around Ramadan. + Add predictions for Iran from 2038 through 2090. + + Changes to future timestamps + + Guess that Morocco will continue to fall back just before and + spring forward just after Ramadan, the practice since 2012. + (Thanks to Maamar Abdelkader.) This means Morocco will observe + negative DST during Ramadan in main and vanguard formats, and in + rearguard format it stays in the +00 timezone and observes + ordinary DST in all months other than Ramadan. As before, extend + this guesswork to the year 2037. As a consequence, Morocco is + scheduled to observe three DST transitions in some Gregorian years + (e.g., 2033) due to the mismatch between the Gregorian and Islamic + calendars. + + The table of exact transitions for Iranian DST has been extended. + It formerly cut off before the year 2038 in a nod to 32-bit time_t. + It now cuts off before 2091 as there is doubt about how the Persian + calendar will treat 2091. This change predicts DST transitions in + 2038-9, 2042-3, and 2046-7 to occur one day later than previously + predicted. As before, post-cutoff transitions are approximated. + + Changes to past and future timestamps + + Qyzylorda (aka Kyzylorda) oblast in Kazakhstan moved from +06 to + +05 on 2018-12-21. This is a zone split as Qostanay (aka + Kostanay) did not switch, so create a zone Asia/Qostanay. + + Metlakatla moved from Alaska to Pacific standard time on 2018-11-04. + It did not change clocks that day and remains on -08 this winter. + (Thanks to Ryan Stanley.) It will revert to the usual Alaska + rules next spring, so this change affects only timestamps + from 2018-11-04 through 2019-03-10. + + Change to past timestamps + + Kwajalein's 1993-08-20 transition from -12 to +12 was at 24:00, + not 00:00. I transcribed the time incorrectly from Shanks. + (Thanks to Phake Nick.) + + Nauru's 1979 transition was on 02-10 at 02:00, not 05-01 at 00:00. + (Thanks to Phake Nick.) + + Guam observed DST irregularly from 1959 through 1977. + (Thanks to Phake Nick.) + + Hong Kong observed DST in 1941 starting 06-15 (not 04-01), then on + 10-01 changed standard time to +08:30 (not +08). Its transition + back to +08 after WWII was on 1945-09-15, not the previous day. + Its 1904-10-30 change took effect at 01:00 +08 (not 00:00 LMT). + (Thanks to Phake Nick, Steve Allen, and Joseph Myers.) Also, + its 1952 fallback was on 11-02 (not 10-25). + + This release contains many changes to timestamps before 1946 due + to Japanese possession or occupation of Pacific/Chuuk, + Pacific/Guam, Pacific/Kosrae, Pacific/Kwajalein, Pacific/Majuro, + Pacific/Nauru, Pacific/Palau, and Pacific/Pohnpei. + (Thanks to Phake Nick.) + + Assume that the Spanish East Indies was like the Philippines and + observed American time until the end of 1844. This affects + Pacific/Chuuk, Pacific/Kosrae, Pacific/Palau, and Pacific/Pohnpei. + + Changes to past tm_isdst flags + + For the recent Morocco change, the tm_isdst flag should be 1 from + 2018-10-27 00:00 to 2018-10-28 03:00. (Thanks to Michael Deckers.) + Give a URL to the official decree. (Thanks to Matt Johnson.) + + Release 2018g - 2018-10-26 22:22:45 -0700 Briefly: - Morocco switches to permanent +01 on 2018-10-27. + Morocco switches to permanent +01 on 2018-10-28. Changes to future timestamps - Morocco switches from +00/+01 to permanent +01 effective 2018-10-27, - so its clocks will not fall back on 2018-10-28 as previously scheduled. + Morocco switches from +00/+01 to permanent +01 effective 2018-10-28, + so its clocks will not fall back as previously scheduled. (Thanks to Mohamed Essedik Najd and Brian Inglis.) Changes to code @@ -119,7 +196,7 @@ Release 2018f - 2018-10-18 00:14:18 -0700 localtime.c no longer ignores TZif POSIX-style TZ strings that specify only standard time. Instead, these TZ strings now override the default time type for timestamps after the last - transition (or for all time stamps if there are no transitions), + transition (or for all timestamps if there are no transitions), just as DST strings specifying DST have always done. leapseconds.awk now outputs "#updated" and "#expires" comments, Modified: vendor/tzdata/dist/africa ============================================================================== --- vendor/tzdata/dist/africa Sun Dec 30 06:03:20 2018 (r342610) +++ vendor/tzdata/dist/africa Sun Dec 30 08:13:51 2018 (r342611) @@ -847,8 +847,41 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # From Mohamed Essedik Najd (2018-10-26): # Today, a Moroccan government council approved the perpetual addition # of 60 minutes to the regular Moroccan timezone. -# From Brian Inglis (2018-10-26): -# http://www.maroc.ma/fr/actualites/le-conseil-de-gouvernement-adopte-un-projet-de-decret-relatif-lheure-legale-stipulant-le +# From Matt Johnson (2018-10-28): +# http://www.sgg.gov.ma/Portals/1/BO/2018/BO_6720-bis_Ar.pdf +# +# From Maamar Abdelkader (2018-11-01): +# We usually move clocks back the previous week end and come back to the +1 +# the week end after.... The government does not announce yet the decision +# about this temporary change. But it s 99% sure that it will be the case, +# as in previous years. An unofficial survey was done these days, showing +# that 64% of asked peopke are ok for moving from +1 to +0 during Ramadan. +# https://leconomiste.com/article/1035870-enquete-l-economiste-sunergia-64-des-marocains-plebiscitent-le-gmt-pendant-ramadan +# +# From Paul Eggert (2018-11-01): +# For now, guess that Morocco will fall back at 03:00 the last Sunday +# before Ramadan, and spring forward at 02:00 the first Sunday after +# Ramadan, as this has been the practice since 2012. To implement this, +# transition dates for 2019 through 2037 were determined by running the +# following program under GNU Emacs 26.1. +# (let ((islamic-year 1440)) +# (require 'cal-islam) +# (while (< islamic-year 1460) +# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) +# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (sunday 0)) +# (while (/= sunday (mod (setq a (1- a)) 7))) +# (while (/= sunday (mod b 7)) +# (setq b (1+ b))) +# (setq a (calendar-gregorian-from-absolute a)) +# (setq b (calendar-gregorian-from-absolute b)) +# (insert +# (format +# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t-1:00\t-\n" +# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t0\t-\n") +# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) +# (setq islamic-year (+ 1 islamic-year)))) # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Morocco 1939 only - Sep 12 0:00 1:00 - @@ -892,13 +925,53 @@ Rule Morocco 2017 only - May 21 3:00 0 - Rule Morocco 2017 only - Jul 2 2:00 1:00 - Rule Morocco 2018 only - May 13 3:00 0 - Rule Morocco 2018 only - Jun 17 2:00 1:00 - +Rule Morocco 2019 only - May 5 3:00 -1:00 - +Rule Morocco 2019 only - Jun 9 2:00 0 - +Rule Morocco 2020 only - Apr 19 3:00 -1:00 - +Rule Morocco 2020 only - May 24 2:00 0 - +Rule Morocco 2021 only - Apr 11 3:00 -1:00 - +Rule Morocco 2021 only - May 16 2:00 0 - +Rule Morocco 2022 only - Mar 27 3:00 -1:00 - +Rule Morocco 2022 only - May 8 2:00 0 - +Rule Morocco 2023 only - Mar 19 3:00 -1:00 - +Rule Morocco 2023 only - Apr 23 2:00 0 - +Rule Morocco 2024 only - Mar 10 3:00 -1:00 - +Rule Morocco 2024 only - Apr 14 2:00 0 - +Rule Morocco 2025 only - Feb 23 3:00 -1:00 - +Rule Morocco 2025 only - Apr 6 2:00 0 - +Rule Morocco 2026 only - Feb 15 3:00 -1:00 - +Rule Morocco 2026 only - Mar 22 2:00 0 - +Rule Morocco 2027 only - Feb 7 3:00 -1:00 - +Rule Morocco 2027 only - Mar 14 2:00 0 - +Rule Morocco 2028 only - Jan 23 3:00 -1:00 - +Rule Morocco 2028 only - Feb 27 2:00 0 - +Rule Morocco 2029 only - Jan 14 3:00 -1:00 - +Rule Morocco 2029 only - Feb 18 2:00 0 - +Rule Morocco 2029 only - Dec 30 3:00 -1:00 - +Rule Morocco 2030 only - Feb 10 2:00 0 - +Rule Morocco 2030 only - Dec 22 3:00 -1:00 - +Rule Morocco 2031 only - Jan 26 2:00 0 - +Rule Morocco 2031 only - Dec 14 3:00 -1:00 - +Rule Morocco 2032 only - Jan 18 2:00 0 - +Rule Morocco 2032 only - Nov 28 3:00 -1:00 - +Rule Morocco 2033 only - Jan 9 2:00 0 - +Rule Morocco 2033 only - Nov 20 3:00 -1:00 - +Rule Morocco 2033 only - Dec 25 2:00 0 - +Rule Morocco 2034 only - Nov 5 3:00 -1:00 - +Rule Morocco 2034 only - Dec 17 2:00 0 - +Rule Morocco 2035 only - Oct 28 3:00 -1:00 - +Rule Morocco 2035 only - Dec 2 2:00 0 - +Rule Morocco 2036 only - Oct 19 3:00 -1:00 - +Rule Morocco 2036 only - Nov 23 2:00 0 - +Rule Morocco 2037 only - Oct 4 3:00 -1:00 - +Rule Morocco 2037 only - Nov 15 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 0:00 Morocco +00/+01 1984 Mar 16 1:00 - +01 1986 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Western Sahara # @@ -913,8 +986,8 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún -1:00 - -01 1976 Apr 14 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Mozambique # Modified: vendor/tzdata/dist/asia ============================================================================== --- vendor/tzdata/dist/asia Sun Dec 30 06:03:20 2018 (r342610) +++ vendor/tzdata/dist/asia Sun Dec 30 08:13:51 2018 (r342611) @@ -586,12 +586,82 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # obtained from # http://www.hko.gov.hk/gts/time/Summertime.htm -# From Arthur David Olson (2009-10-28): +# From Phake Nick (2018-10-27): +# According to Singaporean newspaper +# http://eresources.nlb.gov.sg/newspapers/Digitised/Article/singfreepresswk19041102-1.2.37 +# the day that Hong Kong start using GMT+8 should be Oct 30, 1904. +# +# From Paul Eggert (2018-11-17): +# Hong Kong had a time ball near the Marine Police Station, Tsim Sha Tsui. +# "The ball was raised manually each day and dropped at exactly 1pm +# (except on Sundays and Government holidays)." +# Dyson AD. From Time Ball to Atomic Clock. Hong Kong Government. 1983. +# +# "From 1904 October 30 the time-ball at Hong Kong has been dropped by order +# of the Governor of the Colony at 17h 0m 0s G.M.T., which is 23m 18s.14 in +# advance of 1h 0m 0s of Hong Kong mean time." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 +# +# From Joseph Myers (2018-11-18): +# An astronomer before 1925 referring to GMT would have been using the old +# astronomical convention where the day started at noon, not midnight. +# +# From Steve Allen (2018-11-17): +# Meteorological Observations made at the Hongkong Observatory in the year 1904 +# page 4 +# ... the log of drop times in Table II shows that on Sunday 1904-10-30 the +# ball was dropped. So that looks like a special case drop for the sake +# of broadcasting the new local time. +# +# From Phake Nick (2018-11-18): +# According to The Hong Kong Weekly Press, 1904-10-29, p.324, the +# governor of Hong Kong at the time stated that "We are further desired to +# make it known that the change will be effected by firing the gun and by the +# dropping of the Ball at 23min. 18sec. before one." +# From Paul Eggert (2018-11-18): +# See for this; unfortunately Flash is required. + +# From Phake Nick (2018-10-26): +# I went to check microfilm records stored at Hong Kong Public Library.... +# on September 30 1941, according to Ta Kung Pao (Hong Kong edition), it was +# stated that fallback would occur on the next day (the 1st)'s "03:00 am (Hong +# Kong Time 04:00 am)" and the clock will fall back for a half hour. (03:00 +# probably refer to the time commonly used in mainland China at the time given +# the paper's background) ... the sunrise/sunset time given by South China +# Morning Post for October 1st was indeed moved by half an hour compares to +# before. After that, in December, the battle to capture Hong Kong started and +# the library doesn't seems to have any record stored about press during that +# period of time. Some media resumed publication soon after that within the +# same month, but there were not much information about time there. Later they +# started including a radio program guide when they restored radio service, +# explicitly mentioning it use Tokyo standard time, and later added a note +# saying it's half an hour ahead of the old Hong Kong standard time, and it +# also seems to indicate that Hong Kong was not using GMT+8 when it was +# captured by Japan. +# +# Image of related sections on newspaper: +# * 1941-09-30, Ta Kung Pao (Hong Kong), "Winter Time start tomorrow". +# https://i.imgur.com/6waY51Z.jpg (Chinese) +# * 1941-09-29, South China Morning Post, Information on sunrise/sunset +# time and other things for September 30 and October 1. +# https://i.imgur.com/kCiUR78.jpg +# * 1942-02-05. The Hong Kong News, Radio Program Guide. +# https://i.imgur.com/eVvDMzS.jpg +# * 1941-06-14. Hong Kong Daily Press, Daylight Saving from 3am Tomorrow. +# https://i.imgur.com/05KkvtC.png +# * 1941-09-30, Hong Kong Daily Press, Winter Time Warning. +# https://i.imgur.com/dge4kFJ.png +# Also, the Liberation day of Hong Kong after WWII which British rule +# over the territory resumed was August 30, 1945, which I think should +# be the termination date for the use of JST in the territory.... + +# From Paul Eggert (2018-11-17): # Here are the dates given at -# http://www.hko.gov.hk/gts/time/Summertime.htm -# as of 2009-10-28: +# https://www.hko.gov.hk/gts/time/Summertime.htm +# as of 2014-06-19: # Year Period -# 1941 1 Apr to 30 Sep +# 1941 15 Jun to 30 Sep # 1942 Whole year # 1943 Whole year # 1944 Whole year @@ -602,7 +672,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1949 3 Apr to 30 Oct # 1950 2 Apr to 29 Oct # 1951 1 Apr to 28 Oct -# 1952 6 Apr to 25 Oct +# 1952 6 Apr to 2 Nov # 1953 5 Apr to 1 Nov # 1954 21 Mar to 31 Oct # 1955 20 Mar to 6 Nov @@ -631,25 +701,25 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1978 Nil # 1979 13 May to 21 Oct # 1980 to Now Nil -# The page does not give start or end times of day. -# The page does not give a start date for 1942. -# The page does not givw an end date for 1945. -# The Japanese occupation of Hong Kong began on 1941-12-25. -# The Japanese surrender of Hong Kong was signed 1945-09-15. -# For lack of anything better, use start of those days as the transition times. +# The page does not give times of day for transitions, +# or dates for the 1942 and 1945 transitions. +# The Japanese occupation of Hong Kong began 1941-12-25. +# The Japanese surrender of Hong Kong was signed 1945-09-16; see: +# Heaver S. The days after the Pacific war ended: unsettling times +# in Hong Kong. Post Magazine. 2016-06-13. +# https://www.scmp.com/magazines/post-magazine/article/1852990/days-after-pacific-war-ended-unsettling-times-hong-kong +# For lack of anything better, use start of those days as the +# transition times. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule HK 1941 only - Apr 1 3:30 1:00 S -Rule HK 1941 only - Sep 30 3:30 0 - Rule HK 1946 only - Apr 20 3:30 1:00 S Rule HK 1946 only - Dec 1 3:30 0 - Rule HK 1947 only - Apr 13 3:30 1:00 S Rule HK 1947 only - Dec 30 3:30 0 - Rule HK 1948 only - May 2 3:30 1:00 S Rule HK 1948 1951 - Oct lastSun 3:30 0 - -Rule HK 1952 only - Oct 25 3:30 0 - +Rule HK 1952 1953 - Nov Sun>=1 3:30 0 - Rule HK 1949 1953 - Apr Sun>=1 3:30 1:00 S -Rule HK 1953 only - Nov 1 3:30 0 - Rule HK 1954 1964 - Mar Sun>=18 3:30 1:00 S Rule HK 1954 only - Oct 31 3:30 0 - Rule HK 1955 1964 - Nov Sun>=1 3:30 0 - @@ -659,9 +729,11 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S Rule HK 1979 only - May Sun>=8 3:30 1:00 S Rule HK 1979 only - Oct Sun>=16 3:30 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 - 8:00 HK HK%sT 1941 Dec 25 - 9:00 - JST 1945 Sep 15 +Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42 + 8:00 - HKT 1941 Jun 15 3:30 + 8:00 1:00 HKST 1941 Oct 1 4:00 + 8:30 - HKT 1941 Dec 25 + 9:00 - JST 1945 Sep 16 8:00 HK HK%sT ############################################################################### @@ -1057,6 +1129,16 @@ Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 # India +# British astronomer Henry Park Hollis disliked India Standard Time's offset: +# "A new time system has been proposed for India, Further India, and Burmah. +# The scheme suggested is that the times of the meridians 5½ and 6½ hours +# east of Greenwich should be adopted in these territories. No reason is +# given why hourly meridians five hours and six hours east should not be +# chosen; a plan which would bring the time of India into harmony with +# that of almost the whole of the civilised world." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 + # From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic # https://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/ # (2015-12-22): @@ -1227,12 +1309,65 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # leap year calculation involved. There has never been any serious # plan to change that law.... # -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2018-11-30): # Go with Shanks & Pottenger before Sept. 1991, and with Pournader thereafter. -# I used Ed Reingold's cal-persia in GNU Emacs 21.2 to check Persian dates, -# stopping after 2037 when 32-bit time_t's overflow. -# That cal-persia used Birashk's approximation, which disagrees with the solar -# calendar predictions for the year 2025, so I corrected those dates by hand. +# I used the following code in GNU Emacs 26.1 to generate the "Rule Iran" +# lines from 2008 through 2087. Emacs 26.1 uses Ed Reingold's +# cal-persia implementation of Birashk's approximation, which in the +# 2008-2087 range disagrees with the the astronomical Persian calendar +# for Persian years 1404 (Gregorian 2025) and 1437 (Gregorian 2058), +# so the following code special-case those years. See Table 15.1, page 264, of: +# Edward M. Reingold and Nachum Dershowitz, Calendrical Calculations: +# The Ultimate Edition, Cambridge University Press (2018). +# https://www.cambridge.org/fr/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition +# Page 258, footnote 2, of this book says there is some dispute over what will +# happen in 2091 (and some other years after that), so this code +# stops in 2087, as 2088 and 2089 agree with the "max" rule below. +# (cl-loop +# initially (require 'cal-persia) +# with first-persian-year = 1387 +# with last-persian-year = 1466 +# ;; Exceptional years in the above range, +# ;; from Reingold & Dershowitz Table 15.1, page 264: +# with exceptional-persian-years = '(1404 1437) +# with range-start = nil +# for persian-year from first-persian-year to last-persian-year +# do +# (let* +# ((exceptional-year-offset +# (if (member persian-year exceptional-persian-years) 1 0)) +# (beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 persian-year)) +# exceptional-year-offset)) +# (end-dst-absolute +# (+ (calendar-persian-to-absolute (list 6 30 persian-year)) +# exceptional-year-offset)) +# (next-year-beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 (1+ persian-year))) +# (if (member (1+ persian-year) exceptional-persian-years) 1 0))) +# (beg-dst (calendar-gregorian-from-absolute beg-dst-absolute)) +# (end-dst (calendar-gregorian-from-absolute end-dst-absolute)) +# (next-year-beg-dst (calendar-gregorian-from-absolute +# next-year-beg-dst-absolute)) +# (year (calendar-extract-year beg-dst)) +# (range-end (if range-start year "only"))) +# (setq range-start (or range-start year)) +# (when (or (/= (calendar-extract-day beg-dst) +# (calendar-extract-day next-year-beg-dst)) +# (= persian-year last-persian-year)) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t1:00\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month beg-dst) t) +# (calendar-extract-day beg-dst))) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t0\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month end-dst) t) +# (calendar-extract-day end-dst))) +# (setq range-start nil)))) # # From Oscar van Vlijmen (2005-03-30), writing about future # discrepancies between cal-persia and the Iranian calendar: @@ -1267,61 +1402,113 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # thirtieth day of Shahrivar. # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iran 1978 1980 - Mar 21 0:00 1:00 - -Rule Iran 1978 only - Oct 21 0:00 0 - -Rule Iran 1979 only - Sep 19 0:00 0 - -Rule Iran 1980 only - Sep 23 0:00 0 - -Rule Iran 1991 only - May 3 0:00 1:00 - -Rule Iran 1992 1995 - Mar 22 0:00 1:00 - -Rule Iran 1991 1995 - Sep 22 0:00 0 - -Rule Iran 1996 only - Mar 21 0:00 1:00 - -Rule Iran 1996 only - Sep 21 0:00 0 - -Rule Iran 1997 1999 - Mar 22 0:00 1:00 - -Rule Iran 1997 1999 - Sep 22 0:00 0 - -Rule Iran 2000 only - Mar 21 0:00 1:00 - -Rule Iran 2000 only - Sep 21 0:00 0 - -Rule Iran 2001 2003 - Mar 22 0:00 1:00 - -Rule Iran 2001 2003 - Sep 22 0:00 0 - -Rule Iran 2004 only - Mar 21 0:00 1:00 - -Rule Iran 2004 only - Sep 21 0:00 0 - -Rule Iran 2005 only - Mar 22 0:00 1:00 - -Rule Iran 2005 only - Sep 22 0:00 0 - -Rule Iran 2008 only - Mar 21 0:00 1:00 - -Rule Iran 2008 only - Sep 21 0:00 0 - -Rule Iran 2009 2011 - Mar 22 0:00 1:00 - -Rule Iran 2009 2011 - Sep 22 0:00 0 - -Rule Iran 2012 only - Mar 21 0:00 1:00 - -Rule Iran 2012 only - Sep 21 0:00 0 - -Rule Iran 2013 2015 - Mar 22 0:00 1:00 - -Rule Iran 2013 2015 - Sep 22 0:00 0 - -Rule Iran 2016 only - Mar 21 0:00 1:00 - -Rule Iran 2016 only - Sep 21 0:00 0 - -Rule Iran 2017 2019 - Mar 22 0:00 1:00 - -Rule Iran 2017 2019 - Sep 22 0:00 0 - -Rule Iran 2020 only - Mar 21 0:00 1:00 - -Rule Iran 2020 only - Sep 21 0:00 0 - -Rule Iran 2021 2023 - Mar 22 0:00 1:00 - -Rule Iran 2021 2023 - Sep 22 0:00 0 - -Rule Iran 2024 only - Mar 21 0:00 1:00 - -Rule Iran 2024 only - Sep 21 0:00 0 - -Rule Iran 2025 2027 - Mar 22 0:00 1:00 - -Rule Iran 2025 2027 - Sep 22 0:00 0 - -Rule Iran 2028 2029 - Mar 21 0:00 1:00 - -Rule Iran 2028 2029 - Sep 21 0:00 0 - -Rule Iran 2030 2031 - Mar 22 0:00 1:00 - -Rule Iran 2030 2031 - Sep 22 0:00 0 - -Rule Iran 2032 2033 - Mar 21 0:00 1:00 - -Rule Iran 2032 2033 - Sep 21 0:00 0 - -Rule Iran 2034 2035 - Mar 22 0:00 1:00 - -Rule Iran 2034 2035 - Sep 22 0:00 0 - +Rule Iran 1978 1980 - Mar 20 24:00 1:00 - +Rule Iran 1978 only - Oct 20 24:00 0 - +Rule Iran 1979 only - Sep 18 24:00 0 - +Rule Iran 1980 only - Sep 22 24:00 0 - +Rule Iran 1991 only - May 2 24:00 1:00 - +Rule Iran 1992 1995 - Mar 21 24:00 1:00 - +Rule Iran 1991 1995 - Sep 21 24:00 0 - +Rule Iran 1996 only - Mar 20 24:00 1:00 - +Rule Iran 1996 only - Sep 20 24:00 0 - +Rule Iran 1997 1999 - Mar 21 24:00 1:00 - +Rule Iran 1997 1999 - Sep 21 24:00 0 - +Rule Iran 2000 only - Mar 20 24:00 1:00 - +Rule Iran 2000 only - Sep 20 24:00 0 - +Rule Iran 2001 2003 - Mar 21 24:00 1:00 - +Rule Iran 2001 2003 - Sep 21 24:00 0 - +Rule Iran 2004 only - Mar 20 24:00 1:00 - +Rule Iran 2004 only - Sep 20 24:00 0 - +Rule Iran 2005 only - Mar 21 24:00 1:00 - +Rule Iran 2005 only - Sep 21 24:00 0 - +Rule Iran 2008 only - Mar 20 24:00 1:00 - +Rule Iran 2008 only - Sep 20 24:00 0 - +Rule Iran 2009 2011 - Mar 21 24:00 1:00 - +Rule Iran 2009 2011 - Sep 21 24:00 0 - +Rule Iran 2012 only - Mar 20 24:00 1:00 - +Rule Iran 2012 only - Sep 20 24:00 0 - +Rule Iran 2013 2015 - Mar 21 24:00 1:00 - +Rule Iran 2013 2015 - Sep 21 24:00 0 - +Rule Iran 2016 only - Mar 20 24:00 1:00 - +Rule Iran 2016 only - Sep 20 24:00 0 - +Rule Iran 2017 2019 - Mar 21 24:00 1:00 - +Rule Iran 2017 2019 - Sep 21 24:00 0 - +Rule Iran 2020 only - Mar 20 24:00 1:00 - +Rule Iran 2020 only - Sep 20 24:00 0 - +Rule Iran 2021 2023 - Mar 21 24:00 1:00 - +Rule Iran 2021 2023 - Sep 21 24:00 0 - +Rule Iran 2024 only - Mar 20 24:00 1:00 - +Rule Iran 2024 only - Sep 20 24:00 0 - +Rule Iran 2025 2027 - Mar 21 24:00 1:00 - +Rule Iran 2025 2027 - Sep 21 24:00 0 - +Rule Iran 2028 2029 - Mar 20 24:00 1:00 - +Rule Iran 2028 2029 - Sep 20 24:00 0 - +Rule Iran 2030 2031 - Mar 21 24:00 1:00 - +Rule Iran 2030 2031 - Sep 21 24:00 0 - +Rule Iran 2032 2033 - Mar 20 24:00 1:00 - +Rule Iran 2032 2033 - Sep 20 24:00 0 - +Rule Iran 2034 2035 - Mar 21 24:00 1:00 - +Rule Iran 2034 2035 - Sep 21 24:00 0 - +Rule Iran 2036 2037 - Mar 20 24:00 1:00 - +Rule Iran 2036 2037 - Sep 20 24:00 0 - +Rule Iran 2038 2039 - Mar 21 24:00 1:00 - +Rule Iran 2038 2039 - Sep 21 24:00 0 - +Rule Iran 2040 2041 - Mar 20 24:00 1:00 - +Rule Iran 2040 2041 - Sep 20 24:00 0 - +Rule Iran 2042 2043 - Mar 21 24:00 1:00 - +Rule Iran 2042 2043 - Sep 21 24:00 0 - +Rule Iran 2044 2045 - Mar 20 24:00 1:00 - +Rule Iran 2044 2045 - Sep 20 24:00 0 - +Rule Iran 2046 2047 - Mar 21 24:00 1:00 - +Rule Iran 2046 2047 - Sep 21 24:00 0 - +Rule Iran 2048 2049 - Mar 20 24:00 1:00 - +Rule Iran 2048 2049 - Sep 20 24:00 0 - +Rule Iran 2050 2051 - Mar 21 24:00 1:00 - +Rule Iran 2050 2051 - Sep 21 24:00 0 - +Rule Iran 2052 2053 - Mar 20 24:00 1:00 - +Rule Iran 2052 2053 - Sep 20 24:00 0 - +Rule Iran 2054 2055 - Mar 21 24:00 1:00 - +Rule Iran 2054 2055 - Sep 21 24:00 0 - +Rule Iran 2056 2057 - Mar 20 24:00 1:00 - +Rule Iran 2056 2057 - Sep 20 24:00 0 - +Rule Iran 2058 2059 - Mar 21 24:00 1:00 - +Rule Iran 2058 2059 - Sep 21 24:00 0 - +Rule Iran 2060 2062 - Mar 20 24:00 1:00 - +Rule Iran 2060 2062 - Sep 20 24:00 0 - +Rule Iran 2063 only - Mar 21 24:00 1:00 - +Rule Iran 2063 only - Sep 21 24:00 0 - +Rule Iran 2064 2066 - Mar 20 24:00 1:00 - +Rule Iran 2064 2066 - Sep 20 24:00 0 - +Rule Iran 2067 only - Mar 21 24:00 1:00 - +Rule Iran 2067 only - Sep 21 24:00 0 - +Rule Iran 2068 2070 - Mar 20 24:00 1:00 - +Rule Iran 2068 2070 - Sep 20 24:00 0 - +Rule Iran 2071 only - Mar 21 24:00 1:00 - +Rule Iran 2071 only - Sep 21 24:00 0 - +Rule Iran 2072 2074 - Mar 20 24:00 1:00 - +Rule Iran 2072 2074 - Sep 20 24:00 0 - +Rule Iran 2075 only - Mar 21 24:00 1:00 - +Rule Iran 2075 only - Sep 21 24:00 0 - +Rule Iran 2076 2078 - Mar 20 24:00 1:00 - +Rule Iran 2076 2078 - Sep 20 24:00 0 - +Rule Iran 2079 only - Mar 21 24:00 1:00 - +Rule Iran 2079 only - Sep 21 24:00 0 - +Rule Iran 2080 2082 - Mar 20 24:00 1:00 - +Rule Iran 2080 2082 - Sep 20 24:00 0 - +Rule Iran 2083 only - Mar 21 24:00 1:00 - +Rule Iran 2083 only - Sep 21 24:00 0 - +Rule Iran 2084 2086 - Mar 20 24:00 1:00 - +Rule Iran 2084 2086 - Sep 20 24:00 0 - +Rule Iran 2087 only - Mar 21 24:00 1:00 - +Rule Iran 2087 only - Sep 21 24:00 0 - # -# The following rules are approximations starting in the year 2038. -# These are the best post-2037 approximations available, given the -# restrictions of a single rule using a Gregorian-based data format. +# The following rules are approximations starting in the year 2088. +# These are the best post-2088 approximations available, given the +# restrictions of a single rule using ordinary Gregorian dates. # At some point this table will need to be extended, though quite # possibly Iran will change the rules first. -Rule Iran 2036 max - Mar 21 0:00 1:00 - -Rule Iran 2036 max - Sep 21 0:00 0 - +Rule Iran 2088 max - Mar 20 24:00 1:00 - +Rule Iran 2088 max - Sep 20 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 @@ -1691,7 +1878,9 @@ Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u 9:00 Japan J%sT -# Since 1938, all Japanese possessions have been like Asia/Tokyo. +# Since 1938, all Japanese possessions have been like Asia/Tokyo, +# except that Truk (Chuuk), Ponape (Pohnpei), and Jaluit (Kosrae) did not +# switch from +10 to +09 until 1941-04-01; see the 'australasia' file. # Jordan # @@ -1981,8 +2170,10 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # and in Byalokoz) lists Ural river (plus 10 versts on its left bank) in # the third time belt (before 1930 this means +03). -# From Paul Eggert (2016-12-06): -# The tables below reflect Golosunov's remarks, with exceptions as noted. +# From Alexander Konzurovski (2018-12-20): +# Qyzyolrda Region (Asia/Qyzylorda) is changing its time zone from +# UTC+6 to UTC+5 effective December 21st, 2018. The legal document is +# located here: http://adilet.zan.kz/rus/docs/P1800000817 (russian language). # Zone NAME GMTOFF RULES FORMAT [UNTIL] # @@ -1996,8 +2187,6 @@ Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-A 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s 6:00 - +06 # Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY) -# This currently includes Qostanay (aka Kostanay, Kustanay) (KZ-KUS); -# see comments below. Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -2008,21 +2197,22 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s 6:00 RussiaAsia +06/+07 1992 Mar 29 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s - 6:00 - +06 -# The following zone is like Asia/Qyzylorda except for being one -# hour earlier from 1991-09-29 to 1992-03-29. The 1991/2 rules for -# Qostanay are unclear partly because of the 1997 Turgai -# reorganization, so this zone is commented out for now. -#Zone Asia/Qostanay 4:14:20 - LMT 1924 May 2 -# 4:00 - +04 1930 Jun 21 -# 5:00 - +05 1981 Apr 1 -# 5:00 1:00 +06 1981 Oct 1 -# 6:00 - +06 1982 Apr 1 -# 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s -# 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s -# 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s -# 6:00 - +06 + 6:00 - +06 2018 Dec 21 0:00 + 5:00 - +05 # +# Qostanay (aka Kostanay, Kustanay) (KZ-KUS) +# The 1991/2 rules are unclear partly because of the 1997 Turgai +# reorganization. +Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2 + 4:00 - +04 1930 Jun 21 + 5:00 - +05 1981 Apr 1 + 5:00 1:00 +06 1981 Oct 1 + 6:00 - +06 1982 Apr 1 + 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s + 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s + 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s + 6:00 - +06 + # Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 @@ -2116,21 +2306,43 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 # started at June 1 in that year. For another example, the article in # 1988 said that DST started at 2:00 AM in that year. +# From Phake Nick (2018-10-27): +# 1. According to official announcement from Korean government, the DST end +# date in South Korea should be +# 1955-09-08 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027977557 +# 1956-09-29 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027978341 +# 1957-09-21 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027979690#3 +# 1958-09-20 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027981189 +# 1959-09-19 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027982974#2 +# 1960-09-17 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0028044104 +# ... +# 2.... https://namu.wiki/w/대한민국%20표준시 ... [says] +# when Korea was using GMT+8:30 as standard time, the international +# aviation/marine/meteorological industry in the country refused to +# follow and continued to use GMT+9:00 for interoperability. + + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule ROK 1948 only - Jun 1 0:00 1:00 D -Rule ROK 1948 only - Sep 13 0:00 0 S -Rule ROK 1949 only - Apr 3 0:00 1:00 D -Rule ROK 1949 1951 - Sep Sun>=8 0:00 0 S -Rule ROK 1950 only - Apr 1 0:00 1:00 D -Rule ROK 1951 only - May 6 0:00 1:00 D -Rule ROK 1955 only - May 5 0:00 1:00 D -Rule ROK 1955 only - Sep 9 0:00 0 S -Rule ROK 1956 only - May 20 0:00 1:00 D -Rule ROK 1956 only - Sep 30 0:00 0 S -Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D -Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S -Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D -Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S +Rule ROK 1948 only - Jun 1 0:00 1:00 D +Rule ROK 1948 only - Sep 12 24:00 0 S +Rule ROK 1949 only - Apr 3 0:00 1:00 D +Rule ROK 1949 1951 - Sep Sat>=7 24:00 0 S +Rule ROK 1950 only - Apr 1 0:00 1:00 D +Rule ROK 1951 only - May 6 0:00 1:00 D +Rule ROK 1955 only - May 5 0:00 1:00 D +Rule ROK 1955 only - Sep 8 24:00 0 S +Rule ROK 1956 only - May 20 0:00 1:00 D +Rule ROK 1956 only - Sep 29 24:00 0 S +Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D +Rule ROK 1957 1960 - Sep Sat>=17 24:00 0 S +Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D +Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # From Paul Eggert (2016-08-23): # The Korean Wikipedia entry gives the following sources for UT offsets: @@ -2920,6 +3132,11 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # no information # Philippines + +# From Paul Eggert (2018-11-18): +# The Spanish initially used American (west-of-Greenwich) time. +# It is unknown what time Manila kept when the British occupied it from +# 1762-10-06 through 1764-04; for now assume it kept American time. # On 1844-08-16, Narciso Clavería, governor-general of the # Philippines, issued a proclamation announcing that 1844-12-30 was to # be immediately followed by 1845-01-01; see R.H. van Gent's @@ -3005,8 +3222,8 @@ Link Asia/Qatar Asia/Bahrain # going to run on Higgins Time.' And so, until last year, it did." See: # Antar E. Dinner at When? Saudi Aramco World, 1969 March/April. 2-3. # http://archive.aramcoworld.com/issue/196902/dinner.at.when.htm -# newspapers.com says a similar story about Higgins was published in the Port -# Angeles (WA) Evening News, 1965-03-10, page 5, but I lack access to the text. +# Also see: Antar EN. Arabian flying is confusing. +# Port Angeles (WA) Evening News. 1965-03-10. page 3. # # The TZ database cannot represent quasi-solar time; airline time is the best # we can do. The 1946 foreign air news digest of the U.S. Civil Aeronautics Modified: vendor/tzdata/dist/australasia ============================================================================== --- vendor/tzdata/dist/australasia Sun Dec 30 06:03:20 2018 (r342610) +++ vendor/tzdata/dist/australasia Sun Dec 30 08:13:51 2018 (r342611) @@ -402,10 +402,44 @@ Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete # it is uninhabited. # Guam + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# http://guamlegislature.com/Public_Laws_5th/PL05-025.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-59-7-Guam-Daylight-Savings-Time-May-6-1959.pdf +Rule Guam 1959 only - Jun 27 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-61-5-Revocation-of-Daylight-Saving-Time-and-Restoratio.pdf +Rule Guam 1961 only - Jan 29 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-67-13-Guam-Daylight-Savings-Time.pdf +Rule Guam 1967 only - Sep 1 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-69-2-Repeal-of-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jan 26 0:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-69-10-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jun 22 2:00 1:00 D +Rule Guam 1969 only - Aug 31 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-70-10-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-70-30-End-of-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-71-5-Guam-Daylight-Savings-Time.pdf +Rule Guam 1970 1971 - Apr lastSun 2:00 1:00 D +Rule Guam 1970 1971 - Sep Sun>=1 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-73-28.-Guam-Day-light-Saving-Time.pdf +Rule Guam 1973 only - Dec 16 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-74-7-Guam-Daylight-Savings-Time-Rescinded.pdf +Rule Guam 1974 only - Feb 24 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-76-13-Daylight-Savings-Time.pdf +Rule Guam 1976 only - May 26 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-76-25-Revocation-of-E.O.-76-13.pdf +Rule Guam 1976 only - Aug 22 2:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-77-4-Daylight-Savings-Time.pdf +Rule Guam 1977 only - Apr 24 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-77-18-Guam-Standard-Time.pdf +Rule Guam 1977 only - Aug 28 2:00 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Guam -14:21:00 - LMT 1844 Dec 31 9:39:00 - LMT 1901 # Agana - 10:00 - GST 2000 Dec 23 # Guam + 10:00 - GST 1941 Dec 10 # Guam + 9:00 - +09 1944 Jul 31 + 10:00 Guam G%sT 2000 Dec 23 10:00 - ChST # Chamorro Standard Time Link Pacific/Guam Pacific/Saipan # N Mariana Is @@ -427,31 +461,56 @@ Zone Pacific/Kiritimati -10:29:20 - LMT 1901 # Marshall Is # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Majuro 11:24:48 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 -Zone Pacific/Kwajalein 11:09:20 - LMT 1901 - 11:00 - +11 1969 Oct - -12:00 - -12 1993 Aug 20 - 12:00 - +12 +Zone Pacific/Majuro 11:24:48 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Jan 30 + 11:00 - +11 1969 Oct + 12:00 - +12 +Zone Pacific/Kwajalein 11:09:20 - LMT 1901 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Feb 6 + 11:00 - +11 1969 Oct + -12:00 - -12 1993 Aug 20 24:00 + 12:00 - +12 # Micronesia # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Chuuk 10:07:08 - LMT 1901 - 10:00 - +10 -Zone Pacific/Pohnpei 10:32:52 - LMT 1901 # Kolonia - 11:00 - +11 -Zone Pacific/Kosrae 10:51:56 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 1999 - 11:00 - +11 +Zone Pacific/Chuuk -13:52:52 - LMT 1844 Dec 31 + 10:07:08 - LMT 1901 + 10:00 - +10 1914 Oct + 9:00 - +09 1919 Feb 1 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 10:00 - +10 +Zone Pacific/Pohnpei -13:27:08 - LMT 1844 Dec 31 # Kolonia + 10:32:52 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 +Zone Pacific/Kosrae -13:08:04 - LMT 1844 Dec 31 + 10:51:56 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 1969 Oct + 12:00 - +12 1999 + 11:00 - +11 # Nauru # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe - 11:30 - +1130 1942 Mar 15 - 9:00 - +09 1944 Aug 15 - 11:30 - +1130 1979 May + 11:30 - +1130 1942 Aug 29 + 9:00 - +09 1945 Sep 8 + 11:30 - +1130 1979 Feb 10 2:00 12:00 - +12 # New Caledonia @@ -552,8 +611,9 @@ Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Palau 8:57:56 - LMT 1901 # Koror - 9:00 - +09 +Zone Pacific/Palau -15:02:04 - LMT 1844 Dec 31 # Koror + 8:57:56 - LMT 1901 + 9:00 - +09 # Papua New Guinea # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -815,7 +875,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2017-02-10): +# From Paul Eggert (2018-11-18): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -840,6 +900,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # +# I invented the abbreviation marked "*". # The following abbreviations are from other sources. # Corrections are welcome! # std dst @@ -847,7 +908,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # 8:00 AWST AWDT Western Australia # 9:30 ACST ACDT Central Australia # 10:00 AEST AEDT Eastern Australia -# 10:00 GST Guam through 2000 +# 10:00 GST GDT* Guam through 2000 # 10:00 ChST Chamorro # 11:30 NZMT NZST New Zealand through 1945 # 12:00 NZST NZDT New Zealand 1946-present @@ -1546,29 +1607,71 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # Kwajalein -# In comp.risks 14.87 (26 August 1993), Peter Neumann writes: -# I wonder what happened in Kwajalein, where there was NO Friday, -# 1993-08-20. Thursday night at midnight Kwajalein switched sides with *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 30 08:14:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52EF1141B888; Sun, 30 Dec 2018 08:14:10 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA4EA738B6; Sun, 30 Dec 2018 08:14:09 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDE4E202F1; Sun, 30 Dec 2018 08:14:09 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU8E9ix010476; Sun, 30 Dec 2018 08:14:09 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU8E95O010475; Sun, 30 Dec 2018 08:14:09 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201812300814.wBU8E95O010475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Sun, 30 Dec 2018 08:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r342612 - vendor/tzdata/tzdata2018h X-SVN-Group: vendor X-SVN-Commit-Author: philip X-SVN-Commit-Paths: vendor/tzdata/tzdata2018h X-SVN-Commit-Revision: 342612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA4EA738B6 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_LONG(-1.00)[-0.998,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: Sun, 30 Dec 2018 08:14:10 -0000 Author: philip Date: Sun Dec 30 08:14:09 2018 New Revision: 342612 URL: https://svnweb.freebsd.org/changeset/base/342612 Log: Tag import of tzdata2018h Added: vendor/tzdata/tzdata2018h/ - copied from r342611, vendor/tzdata/dist/ From owner-svn-src-all@freebsd.org Sun Dec 30 09:13:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 301C9141F7E2; Sun, 30 Dec 2018 09:13:39 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C894975E0E; Sun, 30 Dec 2018 09:13:38 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B628A20D89; Sun, 30 Dec 2018 09:13:38 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU9DcWf042231; Sun, 30 Dec 2018 09:13:38 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU9DcDX042230; Sun, 30 Dec 2018 09:13:38 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201812300913.wBU9DcDX042230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 30 Dec 2018 09:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342618 - stable/12/stand/libsa/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/libsa/zfs X-SVN-Commit-Revision: 342618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C894975E0E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.91)[-0.908,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 09:13:39 -0000 Author: tsoome Date: Sun Dec 30 09:13:38 2018 New Revision: 342618 URL: https://svnweb.freebsd.org/changeset/base/342618 Log: MFC r342151, r342161: loader: zfs reader should not probe partitionless disks First of all, normal setups can not boot such pools as the tools do not support installing boot programs. Secondly, for proper pool configuration detection, we need to checks all four label copies on disk, 2 from front and 2 from the end of the disk, but zfs label does not contain the size of the disk - so we depend on firmware to report the correct disk size or use information from the partition table. Without partition table, we only can rely on firmware to report and support disk IO properly. Relnotes: yes 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 Sun Dec 30 09:05:02 2018 (r342617) +++ stable/12/stand/libsa/zfs/zfs.c Sun Dec 30 09:13:38 2018 (r342618) @@ -33,15 +33,16 @@ __FBSDID("$FreeBSD$"); * Stand-alone file reading package. */ +#include #include #include #include #include +#include #include #include #include #include -#include #include #include "libzfs.h" @@ -517,6 +518,7 @@ zfs_probe_partition(void *arg, const char *partname, int zfs_probe_dev(const char *devname, uint64_t *pool_guid) { + struct disk_devdesc *dev; struct ptable *table; struct zfs_probe_args pa; uint64_t mediasz; @@ -527,10 +529,22 @@ 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; + + free(dev); + if (partition != -1 && slice != -1) { + ret = zfs_probe(pa.fd, pool_guid); + if (ret == 0) + return (0); + } + } /* Probe each partition */ ret = ioctl(pa.fd, DIOCGMEDIASIZE, &mediasz); From owner-svn-src-all@freebsd.org Sun Dec 30 09:35:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D788A14206BB; Sun, 30 Dec 2018 09:35:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CD3076BA0; Sun, 30 Dec 2018 09:35:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C58721189; Sun, 30 Dec 2018 09:35:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU9ZmMd052669; Sun, 30 Dec 2018 09:35:48 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU9Zlwg052665; Sun, 30 Dec 2018 09:35:47 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201812300935.wBU9Zlwg052665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 30 Dec 2018 09:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342619 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 342619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CD3076BA0 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.933,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2018 09:35:49 -0000 Author: tsoome Date: Sun Dec 30 09:35:47 2018 New Revision: 342619 URL: https://svnweb.freebsd.org/changeset/base/342619 Log: loader: create bio_alloc and bio_free for bios bounce buffer We do have 16KB buffer space defined in pxe.c, move it to bio.c and implement bio_alloc()/bio_free() interface to make it possible to use this space for other BIOS calls (notably, from biosdisk.c). MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D17131 Added: head/stand/i386/libi386/bio.c (contents, props changed) Modified: head/stand/i386/libi386/Makefile head/stand/i386/libi386/biosdisk.c head/stand/i386/libi386/libi386.h head/stand/i386/libi386/pxe.c Modified: head/stand/i386/libi386/Makefile ============================================================================== --- head/stand/i386/libi386/Makefile Sun Dec 30 09:13:38 2018 (r342618) +++ head/stand/i386/libi386/Makefile Sun Dec 30 09:35:47 2018 (r342619) @@ -4,7 +4,7 @@ LIB= i386 -SRCS= biosacpi.c biosdisk.c biosmem.c biospnp.c \ +SRCS= bio.c biosacpi.c biosdisk.c biosmem.c biospnp.c \ biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \ comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \ Added: head/stand/i386/libi386/bio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/i386/libi386/bio.c Sun Dec 30 09:35:47 2018 (r342619) @@ -0,0 +1,65 @@ +/*- + * 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 "libi386.h" + +/* + * The idea is borrowed from pxe.c and zfsimpl.c. The original buffer + * space in pxe.c was 2x 0x2000. Allocating it from BSS will give us needed + * memory below 1MB and usable for real mode calls. + * + * Note the allocations and frees are to be done in reverse order (LIFO). + */ + +static char bio_buffer[BIO_BUFFER_SIZE]; +static char *bio_buffer_end = bio_buffer + BIO_BUFFER_SIZE; +static char *bio_buffer_ptr = bio_buffer; + +void * +bio_alloc(size_t size) +{ + char *ptr; + + ptr = bio_buffer_ptr; + if (ptr + size > bio_buffer_end) + return (NULL); + bio_buffer_ptr += size; + + return (ptr); +} + +void +bio_free(void *ptr, size_t size) +{ + + if (ptr == NULL) + return; + + bio_buffer_ptr -= size; + if (bio_buffer_ptr != ptr) + panic("bio_alloc()/bio_free() mismatch\n"); +} Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sun Dec 30 09:13:38 2018 (r342618) +++ head/stand/i386/libi386/biosdisk.c Sun Dec 30 09:35:47 2018 (r342619) @@ -469,10 +469,10 @@ bd_get_diskinfo_ext(struct bdinfo *bd) * Sector size must be a multiple of 512 bytes. * An alternate test would be to check power of 2, * powerof2(params.sector_size). - * 4K is largest read buffer we can use at this time. + * 16K is largest read buffer we can use at this time. */ if (params.sector_size >= 512 && - params.sector_size <= 4096 && + params.sector_size <= 16384 && (params.sector_size % BIOSDISK_SECSIZE) == 0) bd->bd_sectorsize = params.sector_size; @@ -861,8 +861,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s struct disk_devdesc *dev = (struct disk_devdesc *)devdata; bdinfo_t *bd; uint64_t disk_blocks, offset, d_offset; - size_t blks, blkoff, bsize, rest; - caddr_t bbuf; + size_t blks, blkoff, bsize, bio_size, rest; + caddr_t bbuf = NULL; int rc; bd = bd_get_bdinfo(&dev->dd); @@ -937,14 +937,25 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s DEBUG("short I/O %d", blks); } - if (V86_IO_BUFFER_SIZE / bd->bd_sectorsize == 0) - panic("BUG: Real mode buffer is too small"); + bio_size = min(BIO_BUFFER_SIZE, size); + while (bio_size > bd->bd_sectorsize) { + bbuf = bio_alloc(bio_size); + if (bbuf != NULL) + break; + bio_size -= bd->bd_sectorsize; + } + if (bbuf == NULL) { + bio_size = V86_IO_BUFFER_SIZE; + if (bio_size / bd->bd_sectorsize == 0) + panic("BUG: Real mode buffer is too small"); - bbuf = PTOV(V86_IO_BUFFER); + /* Use alternate 4k buffer */ + bbuf = PTOV(V86_IO_BUFFER); + } rest = size; - + rc = 0; while (blks > 0) { - int x = min(blks, V86_IO_BUFFER_SIZE / bd->bd_sectorsize); + int x = min(blks, bio_size / bd->bd_sectorsize); switch (rw & F_MASK) { case F_READ: @@ -953,8 +964,10 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s if (rest < bsize) bsize = rest; - if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_RD)) != 0) - return (EIO); + if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_RD)) != 0) { + rc = EIO; + goto error; + } bcopy(bbuf + blkoff, buf, bsize); break; @@ -986,13 +999,16 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s * Put your Data In, and shake it all about */ bcopy(buf, bbuf + blkoff, bsize); - if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_WR)) != 0) - return (EIO); + if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_WR)) != 0) { + rc = EIO; + goto error; + } break; default: /* DO NOTHING */ - return (EROFS); + rc = EROFS; + goto error; } blkoff = 0; @@ -1004,7 +1020,10 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s if (rsize != NULL) *rsize = size; - return (0); +error: + if (bbuf != PTOV(V86_IO_BUFFER)) + bio_free(bbuf, bio_size); + return (rc); } static int Modified: head/stand/i386/libi386/libi386.h ============================================================================== --- head/stand/i386/libi386/libi386.h Sun Dec 30 09:13:38 2018 (r342618) +++ head/stand/i386/libi386/libi386.h Sun Dec 30 09:35:47 2018 (r342619) @@ -121,6 +121,11 @@ extern vm_offset_t memtop_copyin; /* memtop less heap extern uint32_t high_heap_size; /* extended memory region available */ extern vm_offset_t high_heap_base; /* for use as the heap */ +/* 16KB buffer space for real mode data transfers. */ +#define BIO_BUFFER_SIZE 0x4000 +void *bio_alloc(size_t size); +void bio_free(void *ptr, size_t size); + /* * Values for width parameter to biospci_{read,write}_config */ Modified: head/stand/i386/libi386/pxe.c ============================================================================== --- head/stand/i386/libi386/pxe.c Sun Dec 30 09:13:38 2018 (r342618) +++ head/stand/i386/libi386/pxe.c Sun Dec 30 09:35:47 2018 (r342619) @@ -48,18 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include "libi386.h" #include "btxv86.h" #include "pxe.h" -/* - * Allocate the PXE buffers statically instead of sticking grimy fingers into - * BTX's private data area. The scratch buffer is used to send information to - * the PXE BIOS, and the data buffer is used to receive data from the PXE BIOS. - */ -#define PXE_BUFFER_SIZE 0x2000 -static char scratch_buffer[PXE_BUFFER_SIZE]; -static char data_buffer[PXE_BUFFER_SIZE]; - static pxenv_t *pxenv_p = NULL; /* PXENV+ */ static pxe_t *pxe_p = NULL; /* !PXE */ @@ -68,9 +60,9 @@ static int pxe_debug = 0; #endif void pxe_enable(void *pxeinfo); -static void (*pxe_call)(int func); -static void pxenv_call(int func); -static void bangpxe_call(int func); +static void (*pxe_call)(int func, void *ptr); +static void pxenv_call(int func, void *ptr); +static void bangpxe_call(int func, void *ptr); static int pxe_init(void); static int pxe_print(int verbose); @@ -225,12 +217,17 @@ pxe_init(void) printf("@%04x:%04x\n", pxenv_p->RMEntry.segment, pxenv_p->RMEntry.offset); - gci_p = (t_PXENV_GET_CACHED_INFO *) scratch_buffer; + gci_p = bio_alloc(sizeof(*gci_p)); + if (gci_p == NULL) { + pxe_p = NULL; + return (0); + } bzero(gci_p, sizeof(*gci_p)); gci_p->PacketType = PXENV_PACKET_TYPE_BINL_REPLY; - pxe_call(PXENV_GET_CACHED_INFO); + pxe_call(PXENV_GET_CACHED_INFO, gci_p); if (gci_p->Status != 0) { pxe_perror(gci_p->Status); + bio_free(gci_p, sizeof(*gci_p)); pxe_p = NULL; return (0); } @@ -240,6 +237,7 @@ pxe_init(void) bcopy(PTOV((gci_p->Buffer.segment << 4) + gci_p->Buffer.offset), bootp_response, bootp_response_size); } + bio_free(gci_p, sizeof(*gci_p)); return (1); } @@ -262,31 +260,37 @@ pxe_print(int verbose) static void pxe_cleanup(void) { -#ifdef PXE_DEBUG - t_PXENV_UNLOAD_STACK *unload_stack_p = - (t_PXENV_UNLOAD_STACK *)scratch_buffer; - t_PXENV_UNDI_SHUTDOWN *undi_shutdown_p = - (t_PXENV_UNDI_SHUTDOWN *)scratch_buffer; -#endif + t_PXENV_UNLOAD_STACK *unload_stack_p; + t_PXENV_UNDI_SHUTDOWN *undi_shutdown_p; if (pxe_call == NULL) return; - pxe_call(PXENV_UNDI_SHUTDOWN); + undi_shutdown_p = bio_alloc(sizeof(*undi_shutdown_p)); + if (undi_shutdown_p != NULL) { + bzero(undi_shutdown_p, sizeof(*undi_shutdown_p)); + pxe_call(PXENV_UNDI_SHUTDOWN, undi_shutdown_p); #ifdef PXE_DEBUG - if (pxe_debug && undi_shutdown_p->Status != 0) - printf("pxe_cleanup: UNDI_SHUTDOWN failed %x\n", - undi_shutdown_p->Status); + if (pxe_debug && undi_shutdown_p->Status != 0) + printf("pxe_cleanup: UNDI_SHUTDOWN failed %x\n", + undi_shutdown_p->Status); #endif + bio_free(undi_shutdown_p, sizeof(*undi_shutdown_p)); + } - pxe_call(PXENV_UNLOAD_STACK); + unload_stack_p = bio_alloc(sizeof(*unload_stack_p)); + if (unload_stack_p != NULL) { + bzero(unload_stack_p, sizeof(*unload_stack_p)); + pxe_call(PXENV_UNLOAD_STACK, unload_stack_p); #ifdef PXE_DEBUG - if (pxe_debug && unload_stack_p->Status != 0) - printf("pxe_cleanup: UNLOAD_STACK failed %x\n", - unload_stack_p->Status); + if (pxe_debug && unload_stack_p->Status != 0) + printf("pxe_cleanup: UNLOAD_STACK failed %x\n", + unload_stack_p->Status); #endif + bio_free(unload_stack_p, sizeof(*unload_stack_p)); + } } void @@ -296,7 +300,7 @@ pxe_perror(int err) } void -pxenv_call(int func) +pxenv_call(int func, void *ptr) { #ifdef PXE_DEBUG if (pxe_debug) @@ -304,14 +308,13 @@ pxenv_call(int func) #endif bzero(&v86, sizeof(v86)); - bzero(data_buffer, sizeof(data_buffer)); __pxenvseg = pxenv_p->RMEntry.segment; __pxenvoff = pxenv_p->RMEntry.offset; v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; - v86.es = VTOPSEG(scratch_buffer); - v86.edi = VTOPOFF(scratch_buffer); + v86.es = VTOPSEG(ptr); + v86.edi = VTOPOFF(ptr); v86.addr = (VTOPSEG(__pxenventry) << 16) | VTOPOFF(__pxenventry); v86.ebx = func; v86int(); @@ -319,7 +322,7 @@ pxenv_call(int func) } void -bangpxe_call(int func) +bangpxe_call(int func, void *ptr) { #ifdef PXE_DEBUG if (pxe_debug) @@ -327,14 +330,13 @@ bangpxe_call(int func) #endif bzero(&v86, sizeof(v86)); - bzero(data_buffer, sizeof(data_buffer)); __bangpxeseg = pxe_p->EntryPointSP.segment; __bangpxeoff = pxe_p->EntryPointSP.offset; v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; - v86.edx = VTOPSEG(scratch_buffer); - v86.eax = VTOPOFF(scratch_buffer); + v86.edx = VTOPSEG(ptr); + v86.eax = VTOPOFF(ptr); v86.addr = (VTOPSEG(__bangpxeentry) << 16) | VTOPOFF(__bangpxeentry); v86.ebx = func; v86int(); @@ -362,11 +364,14 @@ pxe_netif_end(struct netif *nif) { t_PXENV_UNDI_CLOSE *undi_close_p; - undi_close_p = (t_PXENV_UNDI_CLOSE *)scratch_buffer; - bzero(undi_close_p, sizeof(*undi_close_p)); - pxe_call(PXENV_UNDI_CLOSE); - if (undi_close_p->Status != 0) - printf("undi close failed: %x\n", undi_close_p->Status); + undi_close_p = bio_alloc(sizeof(*undi_close_p)); + if (undi_close_p != NULL) { + bzero(undi_close_p, sizeof(*undi_close_p)); + pxe_call(PXENV_UNDI_CLOSE, undi_close_p); + if (undi_close_p->Status != 0) + printf("undi close failed: %x\n", undi_close_p->Status); + bio_free(undi_close_p, sizeof(*undi_close_p)); + } } static void @@ -377,11 +382,15 @@ pxe_netif_init(struct iodesc *desc, void *machdep_hint uint8_t *mac; int i, len; - undi_info_p = (t_PXENV_UNDI_GET_INFORMATION *)scratch_buffer; + undi_info_p = bio_alloc(sizeof(*undi_info_p)); + if (undi_info_p == NULL) + return; + bzero(undi_info_p, sizeof(*undi_info_p)); - pxe_call(PXENV_UNDI_GET_INFORMATION); + pxe_call(PXENV_UNDI_GET_INFORMATION, undi_info_p); if (undi_info_p->Status != 0) { printf("undi get info failed: %x\n", undi_info_p->Status); + bio_free(undi_info_p, sizeof(*undi_info_p)); return; } @@ -410,32 +419,44 @@ pxe_netif_init(struct iodesc *desc, void *machdep_hint else desc->xid = 0; - undi_open_p = (t_PXENV_UNDI_OPEN *)scratch_buffer; + bio_free(undi_info_p, sizeof(*undi_info_p)); + undi_open_p = bio_alloc(sizeof(*undi_open_p)); + if (undi_open_p == NULL) + return; bzero(undi_open_p, sizeof(*undi_open_p)); undi_open_p->PktFilter = FLTR_DIRECTED | FLTR_BRDCST; - pxe_call(PXENV_UNDI_OPEN); + pxe_call(PXENV_UNDI_OPEN, undi_open_p); if (undi_open_p->Status != 0) printf("undi open failed: %x\n", undi_open_p->Status); + bio_free(undi_open_p, sizeof(*undi_open_p)); } static int pxe_netif_receive(void **pkt) { - t_PXENV_UNDI_ISR *isr = (t_PXENV_UNDI_ISR *)scratch_buffer; + t_PXENV_UNDI_ISR *isr; char *buf, *ptr, *frame; size_t size, rsize; + isr = bio_alloc(sizeof(*isr)); + if (isr == NULL) + return (-1); + bzero(isr, sizeof(*isr)); isr->FuncFlag = PXENV_UNDI_ISR_IN_START; - pxe_call(PXENV_UNDI_ISR); - if (isr->Status != 0) + pxe_call(PXENV_UNDI_ISR, isr); + if (isr->Status != 0) { + bio_free(isr, sizeof(*isr)); return (-1); + } bzero(isr, sizeof(*isr)); isr->FuncFlag = PXENV_UNDI_ISR_IN_PROCESS; - pxe_call(PXENV_UNDI_ISR); - if (isr->Status != 0) + pxe_call(PXENV_UNDI_ISR, isr); + if (isr->Status != 0) { + bio_free(isr, sizeof(*isr)); return (-1); + } while (isr->FuncFlag == PXENV_UNDI_ISR_OUT_TRANSMIT) { /* @@ -443,26 +464,31 @@ pxe_netif_receive(void **pkt) */ bzero(isr, sizeof(*isr)); isr->FuncFlag = PXENV_UNDI_ISR_IN_GET_NEXT; - pxe_call(PXENV_UNDI_ISR); + pxe_call(PXENV_UNDI_ISR, isr); if (isr->Status != 0 || - isr->FuncFlag == PXENV_UNDI_ISR_OUT_DONE) + isr->FuncFlag == PXENV_UNDI_ISR_OUT_DONE) { + bio_free(isr, sizeof(*isr)); return (-1); + } } while (isr->FuncFlag != PXENV_UNDI_ISR_OUT_RECEIVE) { if (isr->Status != 0 || isr->FuncFlag == PXENV_UNDI_ISR_OUT_DONE) { + bio_free(isr, sizeof(*isr)); return (-1); } bzero(isr, sizeof(*isr)); isr->FuncFlag = PXENV_UNDI_ISR_IN_GET_NEXT; - pxe_call(PXENV_UNDI_ISR); + pxe_call(PXENV_UNDI_ISR, isr); } size = isr->FrameLength; buf = malloc(size + ETHER_ALIGN); - if (buf == NULL) + if (buf == NULL) { + bio_free(isr, sizeof(*isr)); return (-1); + } ptr = buf + ETHER_ALIGN; rsize = 0; @@ -475,8 +501,9 @@ pxe_netif_receive(void **pkt) bzero(isr, sizeof(*isr)); isr->FuncFlag = PXENV_UNDI_ISR_IN_GET_NEXT; - pxe_call(PXENV_UNDI_ISR); + pxe_call(PXENV_UNDI_ISR, isr); if (isr->Status != 0) { + bio_free(isr, sizeof(*isr)); free(buf); return (-1); } @@ -488,6 +515,7 @@ pxe_netif_receive(void **pkt) } *pkt = buf; + bio_free(isr, sizeof(*isr)); return (rsize); } @@ -515,26 +543,31 @@ pxe_netif_put(struct iodesc *desc, void *pkt, size_t l t_PXENV_UNDI_TRANSMIT *trans_p; t_PXENV_UNDI_TBD *tbd_p; char *data; + ssize_t rv = -1; - trans_p = (t_PXENV_UNDI_TRANSMIT *)scratch_buffer; - bzero(trans_p, sizeof(*trans_p)); - tbd_p = (t_PXENV_UNDI_TBD *)(scratch_buffer + sizeof(*trans_p)); - bzero(tbd_p, sizeof(*tbd_p)); + trans_p = bio_alloc(sizeof(*trans_p)); + tbd_p = bio_alloc(sizeof(*tbd_p)); + data = bio_alloc(len); - data = scratch_buffer + sizeof(*trans_p) + sizeof(*tbd_p); + if (trans_p != NULL && tbd_p != NULL && data != NULL) { + bzero(trans_p, sizeof(*trans_p)); + bzero(tbd_p, sizeof(*tbd_p)); - trans_p->TBD.segment = VTOPSEG(tbd_p); - trans_p->TBD.offset = VTOPOFF(tbd_p); + trans_p->TBD.segment = VTOPSEG(tbd_p); + trans_p->TBD.offset = VTOPOFF(tbd_p); - tbd_p->ImmedLength = len; - tbd_p->Xmit.segment = VTOPSEG(data); - tbd_p->Xmit.offset = VTOPOFF(data); - bcopy(pkt, data, len); + tbd_p->ImmedLength = len; + tbd_p->Xmit.segment = VTOPSEG(data); + tbd_p->Xmit.offset = VTOPOFF(data); + bcopy(pkt, data, len); - pxe_call(PXENV_UNDI_TRANSMIT); - if (trans_p->Status != 0) { - return (-1); + pxe_call(PXENV_UNDI_TRANSMIT, trans_p); + if (trans_p->Status == 0) + rv = len; } - return (len); + bio_free(data, len); + bio_free(tbd_p, sizeof(*tbd_p)); + bio_free(trans_p, sizeof(*trans_p)); + return (rv); } From owner-svn-src-all@freebsd.org Sun Dec 30 23:08:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D06A61438A81; Sun, 30 Dec 2018 23:08:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77F7D71C72; Sun, 30 Dec 2018 23:08:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A78F1D35; Sun, 30 Dec 2018 23:08:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBUN89gw084358; Sun, 30 Dec 2018 23:08:09 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUN87oG084339; Sun, 30 Dec 2018 23:08:07 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201812302308.wBUN87oG084339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 30 Dec 2018 23:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342634 - in head/sys: arm/broadcom/bcm2835 arm/nvidia arm/ti dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 arm/nvidia arm/ti dev/sdhci X-SVN-Commit-Revision: 342634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 77F7D71C72 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)[-0.998,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: Sun, 30 Dec 2018 23:08:10 -0000 Author: marius Date: Sun Dec 30 23:08:06 2018 New Revision: 342634 URL: https://svnweb.freebsd.org/changeset/base/342634 Log: o Don't allocate resources for SDMA in sdhci(4) if the controller or the front-end doesn't support SDMA or the latter implements a platform- specific transfer method instead. While at it, factor out allocation and freeing of SDMA resources to sdhci_dma_{alloc,free}() in order to keep the code more readable when adding support for ADMA variants. o Base the size of the SDMA bounce buffer on MAXPHYS up to the maximum of 512 KiB instead of using a fixed 4-KiB-buffer. With the default MAXPHYS of 128 KiB and depending on the controller and medium, this reduces the number of SDHCI interrupts by a factor of ~16 to ~32 on sequential reads while an increase of throughput of up to ~84 % was seen. Front-ends for broken controllers that only support an SDMA buffer boundary of a specific size may set SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY and supply a size via struct sdhci_slot. According to Linux, only Qualcomm MSM-type SDHCI controllers are affected by this, though. Requested by: Shreyank Amartya (unconditional bump to 512 KiB) o Introduce a SDHCI_DEPEND macro for specifying the dependency of the front-end modules on the sdhci(4) one and bump the module version of sdhci(4) to 2 via an also newly introduced SDHCI_VERSION in order to ensure that all components are in sync WRT struct sdhci_slot. o In sdhci(4): - Make pointers const were applicable, - replace a few device_printf(9) calls with slot_printf() for consistency, and - sync some local functions with their prototypes WRT static. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c head/sys/arm/nvidia/tegra_sdhci.c head/sys/arm/ti/ti_sdhci.c head/sys/dev/sdhci/fsl_sdhci.c head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_acpi.c head/sys/dev/sdhci/sdhci_fdt.c head/sys/dev/sdhci/sdhci_pci.c head/sys/dev/sdhci/sdhci_xenon.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Dec 30 23:08:06 2018 (r342634) @@ -683,7 +683,7 @@ static driver_t bcm_sdhci_driver = { DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_bcm, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_bcm); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_bcm); #endif Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c Sun Dec 30 23:08:06 2018 (r342634) @@ -1287,7 +1287,7 @@ static driver_t bcm_sdhost_driver = { DRIVER_MODULE(sdhost_bcm, simplebus, bcm_sdhost_driver, bcm_sdhost_devclass, NULL, NULL); -MODULE_DEPEND(sdhost_bcm, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhost_bcm); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhost_bcm); #endif Modified: head/sys/arm/nvidia/tegra_sdhci.c ============================================================================== --- head/sys/arm/nvidia/tegra_sdhci.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/arm/nvidia/tegra_sdhci.c Sun Dec 30 23:08:06 2018 (r342634) @@ -465,7 +465,7 @@ static DEFINE_CLASS_0(sdhci, tegra_sdhci_driver, tegra sizeof(struct tegra_sdhci_softc)); DRIVER_MODULE(sdhci_tegra, simplebus, tegra_sdhci_driver, tegra_sdhci_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_tegra, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_tegra); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci); #endif Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/arm/ti/ti_sdhci.c Sun Dec 30 23:08:06 2018 (r342634) @@ -755,7 +755,7 @@ static driver_t ti_sdhci_driver = { DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_ti, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_ti); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_ti); Modified: head/sys/dev/sdhci/fsl_sdhci.c ============================================================================== --- head/sys/dev/sdhci/fsl_sdhci.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/fsl_sdhci.c Sun Dec 30 23:08:06 2018 (r342634) @@ -1005,7 +1005,7 @@ static driver_t fsl_sdhci_driver = { DRIVER_MODULE(sdhci_fsl, simplebus, fsl_sdhci_driver, fsl_sdhci_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_fsl, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_fsl); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_fsl); Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/sdhci.c Sun Dec 30 23:08:06 2018 (r342634) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -108,19 +109,20 @@ static void sdhci_retune(void *arg); static void sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock); static void sdhci_set_power(struct sdhci_slot *slot, u_char power); static void sdhci_set_transfer_mode(struct sdhci_slot *slot, - struct mmc_data *data); + const struct mmc_data *data); static void sdhci_start(struct sdhci_slot *slot); static void sdhci_timeout(void *arg); static void sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd); -static void sdhci_start_data(struct sdhci_slot *slot, struct mmc_data *data); +static void sdhci_start_data(struct sdhci_slot *slot, + const struct mmc_data *data); static void sdhci_write_block_pio(struct sdhci_slot *slot); static void sdhci_transfer_pio(struct sdhci_slot *slot); #ifdef MMCCAM /* CAM-related */ static void sdhci_cam_action(struct cam_sim *sim, union ccb *ccb); -static int sdhci_cam_get_possible_host_clock(struct sdhci_slot *slot, +static int sdhci_cam_get_possible_host_clock(const struct sdhci_slot *slot, int proposed_clock); static void sdhci_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb); static void sdhci_cam_poll(struct cam_sim *sim); @@ -130,12 +132,14 @@ static int sdhci_cam_update_ios(struct sdhci_slot *slo #endif /* helper routines */ +static int sdhci_dma_alloc(struct sdhci_slot *slot); +static void sdhci_dma_free(struct sdhci_slot *slot); static void sdhci_dumpregs(struct sdhci_slot *slot); static void sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error); -static int slot_printf(struct sdhci_slot *slot, const char * fmt, ...) +static int slot_printf(const struct sdhci_slot *slot, const char * fmt, ...) __printflike(2, 3); -static uint32_t sdhci_tuning_intmask(struct sdhci_slot *slot); +static uint32_t sdhci_tuning_intmask(const struct sdhci_slot *slot); #define SDHCI_LOCK(_slot) mtx_lock(&(_slot)->mtx) #define SDHCI_UNLOCK(_slot) mtx_unlock(&(_slot)->mtx) @@ -179,7 +183,7 @@ sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int } static int -slot_printf(struct sdhci_slot *slot, const char * fmt, ...) +slot_printf(const struct sdhci_slot *slot, const char * fmt, ...) { va_list ap; int retval; @@ -290,7 +294,7 @@ sdhci_reset(struct sdhci_slot *slot, uint8_t mask) } static uint32_t -sdhci_tuning_intmask(struct sdhci_slot *slot) +sdhci_tuning_intmask(const struct sdhci_slot *slot) { uint32_t intmask; @@ -737,55 +741,94 @@ sdhci_card_poll(void *arg) sdhci_card_poll, slot); } -int -sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num) +static int +sdhci_dma_alloc(struct sdhci_slot *slot) { - kobjop_desc_t kobj_desc; - kobj_method_t *kobj_method; - uint32_t caps, caps2, freq, host_caps; int err; - SDHCI_LOCK_INIT(slot); + if (!(slot->quirks & SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY)) { + if (MAXPHYS <= 1024 * 4) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_4K; + else if (MAXPHYS <= 1024 * 8) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_8K; + else if (MAXPHYS <= 1024 * 16) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_16K; + else if (MAXPHYS <= 1024 * 32) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_32K; + else if (MAXPHYS <= 1024 * 64) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_64K; + else if (MAXPHYS <= 1024 * 128) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_128K; + else if (MAXPHYS <= 1024 * 256) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_256K; + else + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_512K; + } + slot->sdma_bbufsz = SDHCI_SDMA_BNDRY_TO_BBUFSZ(slot->sdma_boundary); - slot->num = num; - slot->bus = dev; - - /* Allocate DMA tag. */ - err = bus_dma_tag_create(bus_get_dma_tag(dev), - DMA_BLOCK_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, - BUS_SPACE_MAXADDR, NULL, NULL, - DMA_BLOCK_SIZE, 1, DMA_BLOCK_SIZE, - BUS_DMA_ALLOCNOW, NULL, NULL, - &slot->dmatag); + /* + * Allocate the DMA tag for an SDMA bounce buffer. + * Note that the SDHCI specification doesn't state any alignment + * constraint for the SDMA system address. However, controllers + * typically ignore the SDMA boundary bits in SDHCI_DMA_ADDRESS when + * forming the actual address of data, requiring the SDMA buffer to + * be aligned to the SDMA boundary. + */ + err = bus_dma_tag_create(bus_get_dma_tag(slot->bus), slot->sdma_bbufsz, + 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + slot->sdma_bbufsz, 1, slot->sdma_bbufsz, BUS_DMA_ALLOCNOW, + NULL, NULL, &slot->dmatag); if (err != 0) { - device_printf(dev, "Can't create DMA tag\n"); - SDHCI_LOCK_DESTROY(slot); + slot_printf(slot, "Can't create DMA tag for SDMA\n"); return (err); } - /* Allocate DMA memory. */ + /* Allocate DMA memory for the SDMA bounce buffer. */ err = bus_dmamem_alloc(slot->dmatag, (void **)&slot->dmamem, BUS_DMA_NOWAIT, &slot->dmamap); if (err != 0) { - device_printf(dev, "Can't alloc DMA memory\n"); + slot_printf(slot, "Can't alloc DMA memory for SDMA\n"); bus_dma_tag_destroy(slot->dmatag); - SDHCI_LOCK_DESTROY(slot); return (err); } - /* Map the memory. */ + /* Map the memory of the SDMA bounce buffer. */ err = bus_dmamap_load(slot->dmatag, slot->dmamap, - (void *)slot->dmamem, DMA_BLOCK_SIZE, - sdhci_getaddr, &slot->paddr, 0); + (void *)slot->dmamem, slot->sdma_bbufsz, sdhci_getaddr, + &slot->paddr, 0); if (err != 0 || slot->paddr == 0) { - device_printf(dev, "Can't load DMA memory\n"); + slot_printf(slot, "Can't load DMA memory for SDMA\n"); bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap); bus_dma_tag_destroy(slot->dmatag); - SDHCI_LOCK_DESTROY(slot); if (err) return (err); else return (EFAULT); } + return (0); +} + +static void +sdhci_dma_free(struct sdhci_slot *slot) +{ + + bus_dmamap_unload(slot->dmatag, slot->dmamap); + bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap); + bus_dma_tag_destroy(slot->dmatag); +} + +int +sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num) +{ + kobjop_desc_t kobj_desc; + kobj_method_t *kobj_method; + uint32_t caps, caps2, freq, host_caps; + int err; + + SDHCI_LOCK_INIT(slot); + + slot->num = num; + slot->bus = dev; + slot->version = (RD2(slot, SDHCI_HOST_VERSION) >> SDHCI_SPEC_VER_SHIFT) & SDHCI_SPEC_VER_MASK; if (slot->quirks & SDHCI_QUIRK_MISSING_CAPS) { @@ -801,12 +844,8 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, if (slot->version >= SDHCI_SPEC_300) { if ((caps & SDHCI_SLOTTYPE_MASK) != SDHCI_SLOTTYPE_REMOVABLE && (caps & SDHCI_SLOTTYPE_MASK) != SDHCI_SLOTTYPE_EMBEDDED) { - device_printf(dev, + slot_printf(slot, "Driver doesn't support shared bus slots\n"); - bus_dmamap_unload(slot->dmatag, slot->dmamap); - bus_dmamem_free(slot->dmatag, slot->dmamem, - slot->dmamap); - bus_dma_tag_destroy(slot->dmatag); SDHCI_LOCK_DESTROY(slot); return (ENXIO); } else if ((caps & SDHCI_SLOTTYPE_MASK) == @@ -830,7 +869,7 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, */ if (slot->max_clk == 0) { slot->max_clk = SDHCI_DEFAULT_MAX_FREQ * 1000000; - device_printf(dev, "Hardware doesn't specify base clock " + slot_printf(slot, "Hardware doesn't specify base clock " "frequency, using %dMHz as default.\n", SDHCI_DEFAULT_MAX_FREQ); } @@ -851,7 +890,7 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, * max timeout, but still mention it. */ if (slot->timeout_clk == 0) { - device_printf(dev, "Hardware doesn't specify timeout clock " + slot_printf(slot, "Hardware doesn't specify timeout clock " "frequency, setting BROKEN_TIMEOUT quirk.\n"); slot->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; } @@ -867,7 +906,7 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, if ((caps & SDHCI_CAN_VDD_180) && (slot->opt & SDHCI_SLOT_EMBEDDED)) slot->host.host_ocr |= MMC_OCR_LOW_VOLTAGE; if (slot->host.host_ocr == 0) { - device_printf(dev, "Hardware doesn't report any " + slot_printf(slot, "Hardware doesn't report any " "support voltages.\n"); } @@ -953,7 +992,7 @@ no_tuning: slot->retune_count = (caps2 & SDHCI_RETUNE_CNT_MASK) >> SDHCI_RETUNE_CNT_SHIFT; if (slot->retune_count > 0xb) { - device_printf(dev, "Unknown re-tuning count " + slot_printf(slot, "Unknown re-tuning count " "%x, using 1 sec\n", slot->retune_count); slot->retune_count = 1; } else if (slot->retune_count != 0) @@ -1012,6 +1051,19 @@ no_tuning: if (slot->opt & SDHCI_PLATFORM_TRANSFER) slot->opt &= ~SDHCI_HAVE_DMA; + if (slot->opt & SDHCI_HAVE_DMA) { + err = sdhci_dma_alloc(slot); + if (err != 0) { + if (slot->opt & SDHCI_TUNING_SUPPORTED) { + free(slot->tune_req, M_DEVBUF); + free(slot->tune_cmd, M_DEVBUF); + free(slot->tune_data, M_DEVBUF); + } + SDHCI_LOCK_DESTROY(slot); + return (err); + } + } + if (bootverbose || sdhci_debug) { slot_printf(slot, "%uMHz%s %s VDD:%s%s%s VCCQ: 3.3V%s%s DRV: B%s%s%s %s %s\n", @@ -1109,9 +1161,8 @@ sdhci_cleanup_slot(struct sdhci_slot *slot) SDHCI_LOCK(slot); sdhci_reset(slot, SDHCI_RESET_ALL); SDHCI_UNLOCK(slot); - bus_dmamap_unload(slot->dmatag, slot->dmamap); - bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap); - bus_dma_tag_destroy(slot->dmatag); + if (slot->opt & SDHCI_HAVE_DMA) + sdhci_dma_free(slot); if (slot->opt & SDHCI_TUNING_SUPPORTED) { free(slot->tune_req, M_DEVBUF); free(slot->tune_cmd, M_DEVBUF); @@ -1175,7 +1226,7 @@ sdhci_generic_get_card_present(device_t brdev __unused void sdhci_generic_set_uhs_timing(device_t brdev __unused, struct sdhci_slot *slot) { - struct mmc_ios *ios; + const struct mmc_ios *ios; uint16_t hostctrl2; if (slot->version < SDHCI_SPEC_300) @@ -1308,7 +1359,7 @@ int sdhci_generic_tune(device_t brdev __unused, device_t reqdev, bool hs400) { struct sdhci_slot *slot = device_get_ivars(reqdev); - struct mmc_ios *ios = &slot->host.ios; + const struct mmc_ios *ios = &slot->host.ios; struct mmc_command *tune_cmd; struct mmc_data *tune_data; uint32_t opcode; @@ -1564,7 +1615,7 @@ sdhci_timeout(void *arg) } static void -sdhci_set_transfer_mode(struct sdhci_slot *slot, struct mmc_data *data) +sdhci_set_transfer_mode(struct sdhci_slot *slot, const struct mmc_data *data) { uint16_t mode; @@ -1766,9 +1817,9 @@ sdhci_finish_command(struct sdhci_slot *slot) } static void -sdhci_start_data(struct sdhci_slot *slot, struct mmc_data *data) +sdhci_start_data(struct sdhci_slot *slot, const struct mmc_data *data) { - uint32_t target_timeout, current_timeout; + uint32_t blkcnt, blksz, current_timeout, sdma_bbufsz, target_timeout; uint8_t div; if (data == NULL && (slot->curcmd->flags & MMC_RSP_BUSY) == 0) { @@ -1804,7 +1855,7 @@ sdhci_start_data(struct sdhci_slot *slot, struct mmc_d /* Use DMA if possible. */ if ((slot->opt & SDHCI_HAVE_DMA)) slot->flags |= SDHCI_USE_DMA; - /* If data is small, broken DMA may return zeroes instead of data, */ + /* If data is small, broken DMA may return zeroes instead of data. */ if ((slot->quirks & SDHCI_QUIRK_BROKEN_TIMINGS) && (data->len <= 512)) slot->flags &= ~SDHCI_USE_DMA; @@ -1814,20 +1865,22 @@ sdhci_start_data(struct sdhci_slot *slot, struct mmc_d slot->flags &= ~SDHCI_USE_DMA; /* Load DMA buffer. */ if (slot->flags & SDHCI_USE_DMA) { + sdma_bbufsz = slot->sdma_bbufsz; if (data->flags & MMC_DATA_READ) bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREREAD); else { - memcpy(slot->dmamem, data->data, - (data->len < DMA_BLOCK_SIZE) ? - data->len : DMA_BLOCK_SIZE); + memcpy(slot->dmamem, data->data, ulmin(data->len, + sdma_bbufsz)); bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREWRITE); } WR4(slot, SDHCI_DMA_ADDRESS, slot->paddr); - /* Interrupt aggregation: Mask border interrupt - * for the last page and unmask else. */ - if (data->len == DMA_BLOCK_SIZE) + /* + * Interrupt aggregation: Mask border interrupt for the last + * bounce buffer and unmask otherwise. + */ + if (data->len == sdma_bbufsz) slot->intmask &= ~SDHCI_INT_DMA_END; else slot->intmask |= SDHCI_INT_DMA_END; @@ -1835,16 +1888,15 @@ sdhci_start_data(struct sdhci_slot *slot, struct mmc_d } /* Current data offset for both PIO and DMA. */ slot->offset = 0; - /* Set block size and request IRQ on 4K border. */ - WR2(slot, SDHCI_BLOCK_SIZE, SDHCI_MAKE_BLKSZ(DMA_BOUNDARY, - (data->len < 512) ? data->len : 512)); + /* Set block size and request border interrupts on the SDMA boundary. */ + blksz = SDHCI_MAKE_BLKSZ(slot->sdma_boundary, ulmin(data->len, 512)); + WR2(slot, SDHCI_BLOCK_SIZE, blksz); /* Set block count. */ - WR2(slot, SDHCI_BLOCK_COUNT, (data->len + 511) / 512); - + blkcnt = howmany(data->len, 512); + WR2(slot, SDHCI_BLOCK_COUNT, blkcnt); if (__predict_false(sdhci_debug > 1)) - slot_printf(slot, "Block size: %02x, count %lu\n", - (unsigned int)SDHCI_MAKE_BLKSZ(DMA_BOUNDARY, (data->len < 512) ? data->len : 512), - (unsigned long)(data->len + 511) / 512); + slot_printf(slot, "Blk size: 0x%08x | Blk cnt: 0x%08x\n", + blksz, blkcnt); } void @@ -1868,7 +1920,7 @@ sdhci_finish_data(struct sdhci_slot *slot) bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTREAD); memcpy((u_char*)data->data + slot->offset, slot->dmamem, - (left < DMA_BLOCK_SIZE) ? left : DMA_BLOCK_SIZE); + ulmin(left, slot->sdma_bbufsz)); } else bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTWRITE); @@ -1892,15 +1944,14 @@ sdhci_finish_data(struct sdhci_slot *slot) static void sdhci_start(struct sdhci_slot *slot) { - union ccb *ccb; + union ccb *ccb; + struct ccb_mmcio *mmcio; ccb = slot->ccb; if (ccb == NULL) return; - struct ccb_mmcio *mmcio; mmcio = &ccb->mmcio; - if (!(slot->flags & CMD_STARTED)) { slot->flags |= CMD_STARTED; sdhci_start_command(slot, &mmcio->cmd); @@ -1932,7 +1983,7 @@ sdhci_start(struct sdhci_slot *slot) static void sdhci_start(struct sdhci_slot *slot) { - struct mmc_request *req; + const struct mmc_request *req; req = slot->req; if (req == NULL) @@ -2061,6 +2112,7 @@ sdhci_data_irq(struct sdhci_slot *slot, uint32_t intma { struct mmc_data *data; size_t left; + uint32_t sdma_bbufsz; if (!slot->curcmd) { slot_printf(slot, "Got data interrupt 0x%08x, but " @@ -2115,6 +2167,7 @@ sdhci_data_irq(struct sdhci_slot *slot, uint32_t intma /* Handle DMA border. */ if (intmask & SDHCI_INT_DMA_END) { data = slot->curcmd->data; + sdma_bbufsz = slot->sdma_bbufsz; /* Unload DMA buffer ... */ left = data->len - slot->offset; @@ -2122,26 +2175,28 @@ sdhci_data_irq(struct sdhci_slot *slot, uint32_t intma bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTREAD); memcpy((u_char*)data->data + slot->offset, slot->dmamem, - (left < DMA_BLOCK_SIZE) ? left : DMA_BLOCK_SIZE); + ulmin(left, sdma_bbufsz)); } else { bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTWRITE); } /* ... and reload it again. */ - slot->offset += DMA_BLOCK_SIZE; + slot->offset += sdma_bbufsz; left = data->len - slot->offset; if (data->flags & MMC_DATA_READ) { bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREREAD); } else { memcpy(slot->dmamem, (u_char*)data->data + slot->offset, - (left < DMA_BLOCK_SIZE)? left : DMA_BLOCK_SIZE); + ulmin(left, sdma_bbufsz)); bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREWRITE); } - /* Interrupt aggregation: Mask border interrupt - * for the last page. */ - if (left == DMA_BLOCK_SIZE) { + /* + * Interrupt aggregation: Mask border interrupt for the last + * bounce buffer. + */ + if (left == sdma_bbufsz) { slot->intmask &= ~SDHCI_INT_DMA_END; WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } @@ -2264,7 +2319,7 @@ int sdhci_generic_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) { - struct sdhci_slot *slot = device_get_ivars(child); + const struct sdhci_slot *slot = device_get_ivars(child); switch (which) { default: @@ -2427,6 +2482,7 @@ sdhci_generic_write_ivar(device_t bus, device_t child, void sdhci_start_slot(struct sdhci_slot *slot) { + if ((slot->devq = cam_simq_alloc(1)) == NULL) { goto fail; } @@ -2586,7 +2642,8 @@ sdhci_cam_poll(struct cam_sim *sim) } static int -sdhci_cam_get_possible_host_clock(struct sdhci_slot *slot, int proposed_clock) +sdhci_cam_get_possible_host_clock(const struct sdhci_slot *slot, + int proposed_clock) { int max_clock, clock, i; @@ -2613,15 +2670,14 @@ sdhci_cam_get_possible_host_clock(struct sdhci_slot *s return clock; } -int +static int sdhci_cam_settran_settings(struct sdhci_slot *slot, union ccb *ccb) { struct mmc_ios *ios; - struct mmc_ios *new_ios; - struct ccb_trans_settings_mmc *cts; + const struct mmc_ios *new_ios; + const struct ccb_trans_settings_mmc *cts; ios = &slot->host.ios; - cts = &ccb->cts.proto_specific.mmc; new_ios = &cts->ios; @@ -2659,7 +2715,7 @@ sdhci_cam_settran_settings(struct sdhci_slot *slot, un return (sdhci_cam_update_ios(slot)); } -int +static int sdhci_cam_update_ios(struct sdhci_slot *slot) { struct mmc_ios *ios = &slot->host.ios; @@ -2701,10 +2757,10 @@ sdhci_cam_update_ios(struct sdhci_slot *slot) return (0); } -int +static int sdhci_cam_request(struct sdhci_slot *slot, union ccb *ccb) { - struct ccb_mmcio *mmcio; + const struct ccb_mmcio *mmcio; mmcio = &ccb->mmcio; @@ -2739,4 +2795,4 @@ sdhci_cam_request(struct sdhci_slot *slot, union ccb * } #endif /* MMCCAM */ -MODULE_VERSION(sdhci, 1); +MODULE_VERSION(sdhci, SDHCI_VERSION); Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/sdhci.h Sun Dec 30 23:08:06 2018 (r342634) @@ -32,8 +32,8 @@ #include "opt_mmccam.h" -#define DMA_BLOCK_SIZE 4096 -#define DMA_BOUNDARY 0 /* DMA reload every 4K */ +/* Macro for sizing the SDMA bounce buffer on the SDMA buffer boundary. */ +#define SDHCI_SDMA_BNDRY_TO_BBUFSZ(bndry) (4096 * (1 << bndry)) /* Controller doesn't honor resets unless we touch the clock register */ #define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1 << 0) @@ -95,6 +95,8 @@ #define SDHCI_QUIRK_BROKEN_AUTO_STOP (1 << 28) /* Controller supports eMMC HS400 mode if SDHCI_CAN_SDR104 is set. */ #define SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 (1 << 29) +/* SDMA boundary in SDHCI_BLOCK_SIZE broken - use front-end supplied value. */ +#define SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY (1 << 30) /* * Controller registers @@ -102,6 +104,14 @@ #define SDHCI_DMA_ADDRESS 0x00 #define SDHCI_BLOCK_SIZE 0x04 +#define SDHCI_BLKSZ_SDMA_BNDRY_4K 0x00 +#define SDHCI_BLKSZ_SDMA_BNDRY_8K 0x01 +#define SDHCI_BLKSZ_SDMA_BNDRY_16K 0x02 +#define SDHCI_BLKSZ_SDMA_BNDRY_32K 0x03 +#define SDHCI_BLKSZ_SDMA_BNDRY_64K 0x04 +#define SDHCI_BLKSZ_SDMA_BNDRY_128K 0x05 +#define SDHCI_BLKSZ_SDMA_BNDRY_256K 0x06 +#define SDHCI_BLKSZ_SDMA_BNDRY_512K 0x07 #define SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF)) #define SDHCI_BLOCK_COUNT 0x06 @@ -362,6 +372,8 @@ struct sdhci_slot { bus_dmamap_t dmamap; u_char *dmamem; bus_addr_t paddr; /* DMA buffer address */ + uint32_t sdma_bbufsz; /* SDMA bounce buffer size */ + uint8_t sdma_boundary; /* SDMA boundary */ struct task card_task; /* Card presence check task */ struct timeout_task card_delayed_task;/* Card insert delayed task */ @@ -433,5 +445,10 @@ uint32_t sdhci_generic_min_freq(device_t brdev, struct bool sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot); void sdhci_generic_set_uhs_timing(device_t brdev, struct sdhci_slot *slot); void sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present); + +#define SDHCI_VERSION 2 + +#define SDHCI_DEPEND(name) \ + MODULE_DEPEND(name, sdhci, SDHCI_VERSION, SDHCI_VERSION, SDHCI_VERSION); #endif /* __SDHCI_H__ */ Modified: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- head/sys/dev/sdhci/sdhci_acpi.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/sdhci_acpi.c Sun Dec 30 23:08:06 2018 (r342634) @@ -457,7 +457,7 @@ static devclass_t sdhci_acpi_devclass; DRIVER_MODULE(sdhci_acpi, acpi, sdhci_acpi_driver, sdhci_acpi_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_acpi, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_acpi); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_acpi); Modified: head/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/sdhci_fdt.c Sun Dec 30 23:08:06 2018 (r342634) @@ -80,6 +80,7 @@ struct sdhci_fdt_softc { u_int quirks; /* Chip specific quirks */ u_int caps; /* If we override SDHCI_CAPABILITIES */ uint32_t max_clk; /* Max possible freq */ + uint8_t sdma_boundary; /* If we override the SDMA boundary */ struct resource *irq_res; /* IRQ resource */ void *intrhand; /* Interrupt handle */ @@ -206,7 +207,9 @@ sdhci_fdt_probe(device_t dev) device_set_desc(dev, "generic fdt SDHCI controller"); break; case SDHCI_FDT_QUALCOMM: - sc->quirks = SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE; + sc->quirks = SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY; + sc->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_4K; device_set_desc(dev, "Qualcomm FDT SDHCI controller"); break; case SDHCI_FDT_XLNX_ZY7: @@ -271,6 +274,7 @@ sdhci_fdt_attach(device_t dev) slot->quirks = sc->quirks; slot->caps = sc->caps; slot->max_clk = sc->max_clk; + slot->sdma_boundary = sc->sdma_boundary; if (sdhci_init_slot(dev, slot, i) != 0) continue; @@ -353,7 +357,7 @@ static devclass_t sdhci_fdt_devclass; DRIVER_MODULE(sdhci_fdt, simplebus, sdhci_fdt_driver, sdhci_fdt_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_fdt, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_fdt); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_fdt); #endif Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/sdhci_pci.c Sun Dec 30 23:08:06 2018 (r342634) @@ -526,7 +526,7 @@ static devclass_t sdhci_pci_devclass; DRIVER_MODULE(sdhci_pci, pci, sdhci_pci_driver, sdhci_pci_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_pci, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_pci); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_pci); Modified: head/sys/dev/sdhci/sdhci_xenon.c ============================================================================== --- head/sys/dev/sdhci/sdhci_xenon.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/sdhci_xenon.c Sun Dec 30 23:08:06 2018 (r342634) @@ -550,7 +550,7 @@ static devclass_t sdhci_xenon_devclass; DRIVER_MODULE(sdhci_xenon, simplebus, sdhci_xenon_driver, sdhci_xenon_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_xenon, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_xenon); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_xenon); #endif From owner-svn-src-all@freebsd.org Sun Dec 30 15:21:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 501AB142B798; Sun, 30 Dec 2018 15:21:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA64B89456; Sun, 30 Dec 2018 15:21: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 20B8424D6D; Sun, 30 Dec 2018 15:21:26 +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 wBUFLPob034169; Sun, 30 Dec 2018 15:21:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFLP7a034168; Sun, 30 Dec 2018 15:21:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301521.wBUFLP7a034168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:21: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: r342623 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/ufs/ffs X-SVN-Commit-Revision: 342623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA64B89456 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.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 15:21:30 -0000 Author: kib Date: Sun Dec 30 15:21:25 2018 New Revision: 342623 URL: https://svnweb.freebsd.org/changeset/base/342623 Log: MFC r342381: Allocate v_object for the new snapshot vnode. Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_snapshot.c Sun Dec 30 15:20:35 2018 (r342622) +++ stable/11/sys/ufs/ffs/ffs_snapshot.c Sun Dec 30 15:21:25 2018 (r342623) @@ -300,6 +300,7 @@ restart: return (error); } vp = nd.ni_vp; + vnode_create_vobject(nd.ni_vp, fs->fs_size, td); vp->v_vflag |= VV_SYSTEM; ip = VTOI(vp); devvp = ITODEVVP(ip); From owner-svn-src-all@freebsd.org Sun Dec 30 15:28:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7881142B8AA; Sun, 30 Dec 2018 15:28:32 +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 6A3B2896F7; Sun, 30 Dec 2018 15:28:32 +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 55A8324DC9; Sun, 30 Dec 2018 15:28:32 +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 wBUFSWXI037736; Sun, 30 Dec 2018 15:28:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFSWDC037735; Sun, 30 Dec 2018 15:28:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301528.wBUFSWDC037735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342625 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 342625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A3B2896F7 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)[-0.998,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: Sun, 30 Dec 2018 15:28:32 -0000 Author: kib Date: Sun Dec 30 15:28:31 2018 New Revision: 342625 URL: https://svnweb.freebsd.org/changeset/base/342625 Log: Use IDX_TO_OFF(). Reviewed by: markj Discussed with: hselasky Tested by: zeising MFC after: 1 week Sponsored by: Mellanox Technologies Differential revision: https://reviews.freebsd.org/D18606 Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:22:26 2018 (r342624) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:28:31 2018 (r342625) @@ -538,7 +538,7 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde struct vm_fault vmf; /* fill out VM fault structure */ - vmf.virtual_address = (void *)((uintptr_t)pidx << PAGE_SHIFT); + vmf.virtual_address = (void *)IDX_TO_OFF(pidx); vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0; vmf.pgoff = 0; vmf.page = NULL; From owner-svn-src-all@freebsd.org Mon Dec 31 01:09:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36BEF143C7DD; Mon, 31 Dec 2018 01:09:24 +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 860AD765D6; Mon, 31 Dec 2018 01:09:23 +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 76FFE31C8; Mon, 31 Dec 2018 01:09:23 +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 wBV19NVd049647; Mon, 31 Dec 2018 01:09:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV19N7s049646; Mon, 31 Dec 2018 01:09:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201812310109.wBV19N7s049646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Dec 2018 01:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342639 - head/sys/dev/vt X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/vt X-SVN-Commit-Revision: 342639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 860AD765D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2018 01:09:24 -0000 Author: ian Date: Mon Dec 31 01:09:23 2018 New Revision: 342639 URL: https://svnweb.freebsd.org/changeset/base/342639 Log: When allocating a new keyboard at vt_upgrade() time, unwind any cngrabs done on the old keyboard and then do the corresponding number of grabs on the new keyboard. This fixes a race that can leave the system with a non-functioning keyboard. It goes like this... - The bios claims there is an AT keyboard, atkbd attaches. - SI_SUB_INT_CONFIG_HOOKS runs. - USB probes devices. Devices begin attaching, including disks. - GELI prompts for a password for a just-attached disk, which results in a cngrab() while atkbd is the keyboard. - A USB keyboard attaches. - vt_upgrade() runs and switches the keyboard to the new USB keyboard, but because cngrab was never called for it, it's not activated and keystrokes are ignored. - Now there is no functional keyboard and no way to get one; even plugging in a different USB keyboard doesn't help, because the console is still grabbed, still waiting for a GELI pw. Discussed with: ray@ Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon Dec 31 00:26:35 2018 (r342638) +++ head/sys/dev/vt/vt_core.c Mon Dec 31 01:09:23 2018 (r342639) @@ -977,10 +977,22 @@ vt_kbdevent(keyboard_t *kbd, int event, void *arg) static int vt_allocate_keyboard(struct vt_device *vd) { - int idx0, idx; + int grabbed, i, idx0, idx; keyboard_t *k0, *k; keyboard_info_t ki; + /* + * If vt_upgrade() happens while the console is grabbed, we are + * potentially going to switch keyboard devices while the keyboard is in + * use. Unwind the grabbing of the current keyboard first, then we will + * re-grab the new keyboard below, before we return. + */ + if (vd->vd_curwindow == &vt_conswindow) { + grabbed = vd->vd_curwindow->vw_grabbed; + for (i = 0; i < grabbed; ++i) + vtterm_cnungrab(vd->vd_curwindow->vw_terminal); + } + idx0 = kbd_allocate("kbdmux", -1, vd, vt_kbdevent, vd); if (idx0 >= 0) { DPRINTF(20, "%s: kbdmux allocated, idx = %d\n", __func__, idx0); @@ -1011,6 +1023,11 @@ vt_allocate_keyboard(struct vt_device *vd) } vd->vd_keyboard = idx0; DPRINTF(20, "%s: vd_keyboard = %d\n", __func__, vd->vd_keyboard); + + if (vd->vd_curwindow == &vt_conswindow) { + for (i = 0; i < grabbed; ++i) + vtterm_cngrab(vd->vd_curwindow->vw_terminal); + } return (idx0); } From owner-svn-src-all@freebsd.org Sun Dec 30 15:21:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF705142B66A; Sun, 30 Dec 2018 15:21:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61B2A8935D; Sun, 30 Dec 2018 15:21:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wBUFL4uJ060154; Sun, 30 Dec 2018 07:21:04 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wBUFL4ot060153; Sun, 30 Dec 2018 07:21:04 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201812301521.wBUFL4ot060153@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r342619 - head/stand/i386/libi386 In-Reply-To: <201812300935.wBU9Zlwg052665@repo.freebsd.org> To: Toomas Soome Date: Sun, 30 Dec 2018 07:21:04 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 61B2A8935D X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.924,0]; REPLY(-4.00)[]; 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, 30 Dec 2018 15:21:15 -0000 > Author: tsoome > Date: Sun Dec 30 09:35:47 2018 > New Revision: 342619 > URL: https://svnweb.freebsd.org/changeset/base/342619 > > Log: > loader: create bio_alloc and bio_free for bios bounce buffer > > We do have 16KB buffer space defined in pxe.c, move it to bio.c and implement > bio_alloc()/bio_free() interface to make it possible to use this space for > other BIOS calls (notably, from biosdisk.c). > > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D17131 > > Added: > head/stand/i386/libi386/bio.c (contents, props changed) > Modified: > head/stand/i386/libi386/Makefile > head/stand/i386/libi386/biosdisk.c > head/stand/i386/libi386/libi386.h > head/stand/i386/libi386/pxe.c > > Modified: head/stand/i386/libi386/Makefile > ============================================================================== > --- head/stand/i386/libi386/Makefile Sun Dec 30 09:13:38 2018 (r342618) > +++ head/stand/i386/libi386/Makefile Sun Dec 30 09:35:47 2018 (r342619) > @@ -4,7 +4,7 @@ > > LIB= i386 > > -SRCS= biosacpi.c biosdisk.c biosmem.c biospnp.c \ > +SRCS= bio.c biosacpi.c biosdisk.c biosmem.c biospnp.c \ > biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \ > comconsole.c devicename.c elf32_freebsd.c \ > elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \ > > Added: head/stand/i386/libi386/bio.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/stand/i386/libi386/bio.c Sun Dec 30 09:35:47 2018 (r342619) > @@ -0,0 +1,65 @@ > +/*- > + * 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. > + */ This file has no copyright... please correct that. > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include "libi386.h" > + > +/* > + * The idea is borrowed from pxe.c and zfsimpl.c. The original buffer > + * space in pxe.c was 2x 0x2000. Allocating it from BSS will give us needed > + * memory below 1MB and usable for real mode calls. > + * > + * Note the allocations and frees are to be done in reverse order (LIFO). > + */ > + > +static char bio_buffer[BIO_BUFFER_SIZE]; > +static char *bio_buffer_end = bio_buffer + BIO_BUFFER_SIZE; > +static char *bio_buffer_ptr = bio_buffer; > + > +void * > +bio_alloc(size_t size) > +{ > + char *ptr; > + > + ptr = bio_buffer_ptr; > + if (ptr + size > bio_buffer_end) > + return (NULL); > + bio_buffer_ptr += size; > + > + return (ptr); > +} > + > +void > +bio_free(void *ptr, size_t size) > +{ > + > + if (ptr == NULL) > + return; > + > + bio_buffer_ptr -= size; > + if (bio_buffer_ptr != ptr) > + panic("bio_alloc()/bio_free() mismatch\n"); > +} > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Dec 30 15:58:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66BF3142C13C; Sun, 30 Dec 2018 15:58:19 +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 F398D8A66C; Sun, 30 Dec 2018 15:58:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8AED25315; Sun, 30 Dec 2018 15:58:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBUFwIFq054442; Sun, 30 Dec 2018 15:58:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFwIHS054441; Sun, 30 Dec 2018 15:58:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301558.wBUFwIHS054441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342630 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 342630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F398D8A66C 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)[-0.998,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, 30 Dec 2018 15:58:19 -0000 Author: kib Date: Sun Dec 30 15:58:18 2018 New Revision: 342630 URL: https://svnweb.freebsd.org/changeset/base/342630 Log: Add 'v' modifier to the ddb 'show pginfo' command to display vm_page backing the provided kernel virtual address. Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Dec 30 15:55:30 2018 (r342629) +++ head/sys/vm/vm_page.c Sun Dec 30 15:58:18 2018 (r342630) @@ -4493,7 +4493,7 @@ DB_SHOW_COMMAND(pageq, vm_page_print_pageq_info) DB_SHOW_COMMAND(pginfo, vm_page_print_pginfo) { vm_page_t m; - boolean_t phys; + boolean_t phys, virt; if (!have_addr) { db_printf("show pginfo addr\n"); @@ -4501,7 +4501,10 @@ DB_SHOW_COMMAND(pginfo, vm_page_print_pginfo) } phys = strchr(modif, 'p') != NULL; - if (phys) + virt = strchr(modif, 'v') != NULL; + if (virt) + m = PHYS_TO_VM_PAGE(pmap_kextract(addr)); + else if (phys) m = PHYS_TO_VM_PAGE(addr); else m = (vm_page_t)addr; From owner-svn-src-all@freebsd.org Sun Dec 30 15:34:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9779B142BA7D; Sun, 30 Dec 2018 15:34:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EB3789AD1; Sun, 30 Dec 2018 15:34:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08F8624F84; Sun, 30 Dec 2018 15:34:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBUFYCW8042549; Sun, 30 Dec 2018 15:34:12 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFYC5O042548; Sun, 30 Dec 2018 15:34:12 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201812301534.wBUFYC5O042548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 30 Dec 2018 15:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342626 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 342626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1EB3789AD1 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.961,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2018 15:34:13 -0000 Author: tsoome Date: Sun Dec 30 15:34:12 2018 New Revision: 342626 URL: https://svnweb.freebsd.org/changeset/base/342626 Log: Add Copyright. Reported by: Rodney W. Grimes Modified: head/stand/i386/libi386/bio.c Modified: head/stand/i386/libi386/bio.c ============================================================================== --- head/stand/i386/libi386/bio.c Sun Dec 30 15:28:31 2018 (r342625) +++ head/stand/i386/libi386/bio.c Sun Dec 30 15:34:12 2018 (r342626) @@ -1,4 +1,6 @@ /*- + * Copyright 2018 Toomas Soome + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: From owner-svn-src-all@freebsd.org Sun Dec 30 15:20:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 487E5142B651; Sun, 30 Dec 2018 15:20:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF31F890E0; Sun, 30 Dec 2018 15:20: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 C5F9824C2B; Sun, 30 Dec 2018 15:20: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 wBUFKZXJ033344; Sun, 30 Dec 2018 15:20:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFKZq6033343; Sun, 30 Dec 2018 15:20:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301520.wBUFKZq6033343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:20: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: r342622 - 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: 342622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF31F890E0 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.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 15:20:36 -0000 Author: kib Date: Sun Dec 30 15:20:35 2018 New Revision: 342622 URL: https://svnweb.freebsd.org/changeset/base/342622 Log: MFC r342380: Properly test for vmio buffer in bnoreuselist(). Modified: stable/11/sys/kern/vfs_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Sun Dec 30 15:17:57 2018 (r342621) +++ stable/11/sys/kern/vfs_subr.c Sun Dec 30 15:20:35 2018 (r342622) @@ -1773,7 +1773,7 @@ again: * reused. Dirty buffers will have the hint applied once * they've been written. */ - if (bp->b_vp->v_object != NULL) + if ((bp->b_flags & B_VMIO) != 0) bp->b_flags |= B_NOREUSE; brelse(bp); BO_RLOCK(bo); From owner-svn-src-all@freebsd.org Sun Dec 30 15:22:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 466BE142B7BF; Sun, 30 Dec 2018 15:22:27 +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 E0B22895D3; Sun, 30 Dec 2018 15:22:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3AC024DB9; Sun, 30 Dec 2018 15:22:26 +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 wBUFMQ8W037443; Sun, 30 Dec 2018 15:22:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFMQHT037442; Sun, 30 Dec 2018 15:22:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301522.wBUFMQHT037442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342624 - stable/12/sys/dev/nvdimm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/nvdimm X-SVN-Commit-Revision: 342624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E0B22895D3 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.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 15:22:27 -0000 Author: kib Date: Sun Dec 30 15:22:26 2018 New Revision: 342624 URL: https://svnweb.freebsd.org/changeset/base/342624 Log: MFC r342382: nvdimm SPA geom: Update bio fields needed for devstat_end_transaction_bio(). Modified: stable/12/sys/dev/nvdimm/nvdimm_spa.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvdimm/nvdimm_spa.c ============================================================================== --- stable/12/sys/dev/nvdimm/nvdimm_spa.c Sun Dec 30 15:21:25 2018 (r342623) +++ stable/12/sys/dev/nvdimm/nvdimm_spa.c Sun Dec 30 15:22:26 2018 (r342624) @@ -336,8 +336,10 @@ nvdimm_spa_g_thread(void *arg) auio.uio_td = curthread; error = uiomove_fromphys(bp->bio_ma, bp->bio_ma_offset, bp->bio_length, &auio); + bp->bio_resid = auio.uio_resid; } else { nvdimm_spa_g_all_unmapped(spa, bp, bp->bio_cmd); + bp->bio_resid = bp->bio_length; error = 0; } } else { @@ -352,7 +354,9 @@ nvdimm_spa_g_thread(void *arg) UIO_WRITE; auio.uio_td = curthread; error = nvdimm_spa_uio(spa, &auio); + bp->bio_resid = auio.uio_resid; } + bp->bio_bcount = bp->bio_length; devstat_end_transaction_bio(spa->spa_g_devstat, bp); completed: bp->bio_completed = bp->bio_length; From owner-svn-src-all@freebsd.org Sun Dec 30 23:04:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22EB814386F0; Sun, 30 Dec 2018 23:04:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B65407197D; Sun, 30 Dec 2018 23:04:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CB961D2C; Sun, 30 Dec 2018 23:04:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBUN43x6084055; Sun, 30 Dec 2018 23:04:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUN42bZ084045; Sun, 30 Dec 2018 23:04:02 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201812302304.wBUN42bZ084045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 30 Dec 2018 23:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342633 - head/share/timedef X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/share/timedef X-SVN-Commit-Revision: 342633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B65407197D 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.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2018 23:04:04 -0000 Author: delphij Date: Sun Dec 30 23:04:02 2018 New Revision: 342633 URL: https://svnweb.freebsd.org/changeset/base/342633 Log: Fix various issues with Chinese locales: - Change short weekday names to use only one Chinese character. (note: this is a somewhat misunfortunate compromise due to the fact that some applications are using short buffer for weekday names, and in ~1905 when 星期 system was created to replace the traditional 七曜 system, which can use 日月ç«æ°´æœ¨é‡‘土 to represent Sunday through Saturday with just one character without any confusion). - for zh_CN locales: use Arabic numerals for month names, matching the practice of all other CJK locales - Regenerate zh_CN.{GB2312,GBK} locales from zh_CN.UTF-8. Reported by: ygy Reviewed by: kevlo MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18689 Modified: head/share/timedef/zh_CN.GB2312.src head/share/timedef/zh_CN.GBK.src head/share/timedef/zh_CN.UTF-8.src (contents, props changed) head/share/timedef/zh_HK.UTF-8.src head/share/timedef/zh_TW.UTF-8.src Modified: head/share/timedef/zh_CN.GB2312.src ============================================================================== --- head/share/timedef/zh_CN.GB2312.src Sun Dec 30 19:44:50 2018 (r342632) +++ head/share/timedef/zh_CN.GB2312.src Sun Dec 30 23:04:02 2018 (r342633) @@ -4,41 +4,41 @@ # ----------------------------------------------------------------------------- # # Short month names -!!#1TB -!!#2TB -!!#3TB -!!#4TB -!!#5TB -!!#6TB -!!#7TB -!!#8TB -!!#9TB -#1#0TB -#1#1TB -#1#2TB + 1Ô + 2Ô + 3Ô + 4Ô + 5Ô + 6Ô + 7Ô + 8Ô + 9Ô +10Ô +11Ô +12Ô # # Long month names (as in a date) -Ò»Ô -¶þÔ -ÈýÔ -ËÄÔ -ÎåÔ -ÁùÔ -ÆßÔ -°ËÔ -¾ÅÔ -ʮԠ-ʮһÔ -Ê®¶þÔ +1Ô +2Ô +3Ô +4Ô +5Ô +6Ô +7Ô +8Ô +9Ô +10Ô +11Ô +12Ô # # Short weekday names -ÖÜÈÕ -ÖÜÒ» -Öܶþ -ÖÜÈý -ÖÜËÄ -ÖÜÎå -ÖÜÁù +ÈÕ +Ò» +¶þ +Èý +ËÄ +Îå +Áù # # Long weekday names ÐÇÆÚÈÕ @@ -66,18 +66,18 @@ %YÄê%_mÔÂ%eÈÕ %A %X %Z # # Long month names (without case ending) -Ò»Ô -¶þÔ -ÈýÔ -ËÄÔ -ÎåÔ -ÁùÔ -ÆßÔ -°ËÔ -¾ÅÔ -ʮԠ-ʮһÔ -Ê®¶þÔ +1Ô +2Ô +3Ô +4Ô +5Ô +6Ô +7Ô +8Ô +9Ô +10Ô +11Ô +12Ô # # md_order md Modified: head/share/timedef/zh_CN.GBK.src ============================================================================== --- head/share/timedef/zh_CN.GBK.src Sun Dec 30 19:44:50 2018 (r342632) +++ head/share/timedef/zh_CN.GBK.src Sun Dec 30 23:04:02 2018 (r342633) @@ -18,27 +18,27 @@ 12Ô # # Long month names (as in a date) -Ò»Ô -¶þÔ -ÈýÔ -ËÄÔ -ÎåÔ -ÁùÔ -ÆßÔ -°ËÔ -¾ÅÔ -ʮԠ-ʮһÔ -Ê®¶þÔ +1Ô +2Ô +3Ô +4Ô +5Ô +6Ô +7Ô +8Ô +9Ô +10Ô +11Ô +12Ô # # Short weekday names -ÖÜÈÕ -ÖÜÒ» -Öܶþ -ÖÜÈý -ÖÜËÄ -ÖÜÎå -ÖÜÁù +ÈÕ +Ò» +¶þ +Èý +ËÄ +Îå +Áù # # Long weekday names ÐÇÆÚÈÕ @@ -66,18 +66,18 @@ %YÄê%_mÔÂ%eÈÕ %A %X %Z # # Long month names (without case ending) -Ò»Ô -¶þÔ -ÈýÔ -ËÄÔ -ÎåÔ -ÁùÔ -ÆßÔ -°ËÔ -¾ÅÔ -ʮԠ-ʮһÔ -Ê®¶þÔ +1Ô +2Ô +3Ô +4Ô +5Ô +6Ô +7Ô +8Ô +9Ô +10Ô +11Ô +12Ô # # md_order md Modified: head/share/timedef/zh_CN.UTF-8.src ============================================================================== --- head/share/timedef/zh_CN.UTF-8.src Sun Dec 30 19:44:50 2018 (r342632) +++ head/share/timedef/zh_CN.UTF-8.src Sun Dec 30 23:04:02 2018 (r342633) @@ -18,27 +18,27 @@ 12月 # # Long month names (as in a date) -一月 -二月 -三月 -四月 -五月 -六月 -七月 -八月 -ä¹æœˆ -å月 -å一月 -å二月 +1月 +2月 +3月 +4月 +5月 +6月 +7月 +8月 +9月 +10月 +11月 +12月 # # Short weekday names -周日 -周一 -周二 -周三 -周四 -周五 -周六 +æ—¥ +一 +二 +三 +å›› +五 +å…­ # # Long weekday names 星期日 @@ -66,18 +66,18 @@ %Yå¹´%_m月%eæ—¥ %A %X %Z # # Long month names (without case ending) -一月 -二月 -三月 -四月 -五月 -六月 -七月 -八月 -ä¹æœˆ -å月 -å一月 -å二月 +1月 +2月 +3月 +4月 +5月 +6月 +7月 +8月 +9月 +10月 +11月 +12月 # # md_order md Modified: head/share/timedef/zh_HK.UTF-8.src ============================================================================== --- head/share/timedef/zh_HK.UTF-8.src Sun Dec 30 19:44:50 2018 (r342632) +++ head/share/timedef/zh_HK.UTF-8.src Sun Dec 30 23:04:02 2018 (r342633) @@ -32,13 +32,13 @@ 12月 # # Short weekday names -週日 -週一 -週二 -週三 -週四 -週五 -週六 +æ—¥ +一 +二 +三 +å›› +五 +å…­ # # Long weekday names 星期日 Modified: head/share/timedef/zh_TW.UTF-8.src ============================================================================== --- head/share/timedef/zh_TW.UTF-8.src Sun Dec 30 19:44:50 2018 (r342632) +++ head/share/timedef/zh_TW.UTF-8.src Sun Dec 30 23:04:02 2018 (r342633) @@ -32,13 +32,13 @@ 12月 # # Short weekday names -週日 -週一 -週二 -週三 -週四 -週五 -週六 +æ—¥ +一 +二 +三 +å›› +五 +å…­ # # Long weekday names 星期日 From owner-svn-src-all@freebsd.org Mon Dec 31 03:08:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFF67141E4B1; Mon, 31 Dec 2018 03:08:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8806E8360F; Mon, 31 Dec 2018 03:08:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7202048CC; Mon, 31 Dec 2018 03:08:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV381rC013160; Mon, 31 Dec 2018 03:08:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV381ep013159; Mon, 31 Dec 2018 03:08:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201812310308.wBV381ep013159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 31 Dec 2018 03:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342640 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 342640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8806E8360F 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)[-0.998,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, 31 Dec 2018 03:08:02 -0000 Author: delphij Date: Mon Dec 31 03:08:01 2018 New Revision: 342640 URL: https://svnweb.freebsd.org/changeset/base/342640 Log: Ensure buffer is nul-terminated. MFC after: 2 weeks Modified: head/lib/libutil/quotafile.c Modified: head/lib/libutil/quotafile.c ============================================================================== --- head/lib/libutil/quotafile.c Mon Dec 31 01:09:23 2018 (r342639) +++ head/lib/libutil/quotafile.c Mon Dec 31 03:08:01 2018 (r342640) @@ -103,7 +103,7 @@ hasquota(struct fstab *fs, int type, char *qfnamep, in return (0); } if (cp) { - strncpy(qfnamep, cp, qfbufsize); + strlcpy(qfnamep, cp, qfbufsize); } else { (void)snprintf(qfnamep, qfbufsize, "%s/%s.%s", fs->fs_file, QUOTAFILENAME, qfextension[type]); From owner-svn-src-all@freebsd.org Mon Dec 31 00:26:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE236143B291; Mon, 31 Dec 2018 00:26:36 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65C5874EC9; Mon, 31 Dec 2018 00:26:36 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5806A2AEE; Mon, 31 Dec 2018 00:26:36 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV0Qato028647; Mon, 31 Dec 2018 00:26:36 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV0QahE028646; Mon, 31 Dec 2018 00:26:36 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201812310026.wBV0QahE028646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Mon, 31 Dec 2018 00:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342638 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 342638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65C5874EC9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 31 Dec 2018 00:26:36 -0000 Author: bcran Date: Mon Dec 31 00:26:35 2018 New Revision: 342638 URL: https://svnweb.freebsd.org/changeset/base/342638 Log: Use the --activate efibootmgr(8) flag when creating entries in bootconfig Sponsored by: Netflix Modified: head/usr.sbin/bsdinstall/scripts/bootconfig Modified: head/usr.sbin/bsdinstall/scripts/bootconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/bootconfig Mon Dec 31 00:20:58 2018 (r342637) +++ head/usr.sbin/bsdinstall/scripts/bootconfig Mon Dec 31 00:26:35 2018 (r342638) @@ -143,18 +143,12 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" fi echo "Creating UEFI boot entry" - efibootmgr --create --label "$bootlabel" --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null + efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null echo "Unmounting ESP" umount "${mntpt}" rmdir "${mntpt}" - # When creating new entries, efibootmgr doesn't mark them active, so we need to - # do so. It doesn't make it easy to find which entry it just added, so rely on - # the fact that it places the new entry first in BootOrder. - bootorder=$(efivar --name 8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder --print --no-name --hex | head -1) - bootentry=$(echo "$bootorder" | cut -w -f 3)$(echo "$bootorder" | cut -w -f 2) - efibootmgr --activate "$bootentry" > /dev/null echo "Finished configuring /dev/${esp} as ESP" done fi From owner-svn-src-all@freebsd.org Mon Dec 31 00:20:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05307143ADBB; Mon, 31 Dec 2018 00:20:59 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AAB274A2B; Mon, 31 Dec 2018 00:20:58 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88AD12967; Mon, 31 Dec 2018 00:20:58 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV0Kwfl024309; Mon, 31 Dec 2018 00:20:58 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV0Kwbo024308; Mon, 31 Dec 2018 00:20:58 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201812310020.wBV0Kwbo024308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Mon, 31 Dec 2018 00:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342637 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 342637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9AAB274A2B 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.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 31 Dec 2018 00:20:59 -0000 Author: bcran Date: Mon Dec 31 00:20:58 2018 New Revision: 342637 URL: https://svnweb.freebsd.org/changeset/base/342637 Log: Fix ESP generation when using a gmirror, and when booting from RO medium When using a gmirror, entries in /dev can be removed. So instead of using kern.disks, get the list of disks from "gpart status -sg" instead. We assume that any 'efi' partition that can't be mounted as msdosfs should be used as an ESP. However, the ESP on the CD/DVD can't be mounted read-write and so was being treated as if unformatted. Try the mount as read-only instead, to catch cases like this. Relnotes: yes Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18645 Modified: head/usr.sbin/bsdinstall/scripts/bootconfig Modified: head/usr.sbin/bsdinstall/scripts/bootconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/bootconfig Mon Dec 31 00:15:05 2018 (r342636) +++ head/usr.sbin/bsdinstall/scripts/bootconfig Mon Dec 31 00:20:58 2018 (r342637) @@ -84,10 +84,11 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" # The installer hasn't given us any ESPs to use. # Try and figure out which to use by looking for an # unformatted efi partition - for disk in $(sysctl -n kern.disks); do - hasfreebsd=$(gpart show "$disk" | cut -w -f 4,5 | grep "freebsd") + + for geom in $(gpart status -sg | awk '{print $1}'); do + hasfreebsd=$(gpart show "${geom}" | cut -w -f 4,5 | grep "freebsd") if [ -n "$hasfreebsd" ]; then - index=$(gpart show "$disk" | cut -w -f 4,5 | grep "efi" | cut -w -f 1) + index=$(gpart show "${geom}" | cut -w -f 4,5 | grep "efi" | cut -w -f 1) # Check that $index is a valid integer [ -n "$index" ] && [ "$index" -eq "$index" ] && [ "$index" -ge 0 ] 2> /dev/null if [ $? -ne 0 ]; then @@ -95,17 +96,17 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" fi mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) - if [ -e "/dev/${disk}p${index}" ]; then - dev=${disk}p${index} - elif [ -e "/dev/${disk}s${index}" ]; then - dev=/${disk}s${index} + if [ -e "/dev/${geom}p${index}" ]; then + dev=${geom}p${index} + elif [ -e "/dev/${geom}s${index}" ]; then + dev=/${geom}s${index} else continue fi # Try and mount it. If it fails, assume it's # unformatted and should be used. - mount -t msdosfs "/dev/${dev}" "${mntpt}" + mount -t msdosfs -o ro "/dev/${dev}" "${mntpt}" if [ $? -ne 0 ]; then ESPS="$ESPS ${dev}" num_esps=$((num_esps + 1)) @@ -118,17 +119,20 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" fi for esp in $ESPS; do + echo "Formatting /dev/${esp} as FAT32" newfs_msdos -F 32 -c 1 -L EFISYS "/dev/$esp" > /dev/null 2>&1 if [ $? -ne 0 ]; then die "Failed to format ESP $esp as FAT32" fi mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) + echo "Mounting ESP /dev/${esp}" mount -t msdosfs "/dev/${esp}" "${mntpt}" if [ $? -ne 0 ]; then die "Failed to mount ESP ${dev} on ${mntpt}" fi + echo "Installing loader.efi onto ESP" mkdir -p "$mntpt/EFI/freebsd" cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/EFI/freebsd/loader.efi" @@ -138,8 +142,10 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" bootlabel="FreeBSD" fi + echo "Creating UEFI boot entry" efibootmgr --create --label "$bootlabel" --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null + echo "Unmounting ESP" umount "${mntpt}" rmdir "${mntpt}" @@ -149,6 +155,7 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" bootorder=$(efivar --name 8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder --print --no-name --hex | head -1) bootentry=$(echo "$bootorder" | cut -w -f 3)$(echo "$bootorder" | cut -w -f 2) efibootmgr --activate "$bootentry" > /dev/null + echo "Finished configuring /dev/${esp} as ESP" done fi From owner-svn-src-all@freebsd.org Mon Dec 31 03:53:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 298C9141FB33; Mon, 31 Dec 2018 03:53:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C404B84EDE; Mon, 31 Dec 2018 03:53:33 +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 B817351AB; Mon, 31 Dec 2018 03:53:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV3rXWb039173; Mon, 31 Dec 2018 03:53:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV3rXMJ039172; Mon, 31 Dec 2018 03:53:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812310353.wBV3rXMJ039172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 31 Dec 2018 03:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342641 - in stable: 10/sys/contrib/ipfilter/netinet 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: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C404B84EDE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 31 Dec 2018 03:53:34 -0000 Author: cy Date: Mon Dec 31 03:53:33 2018 New Revision: 342641 URL: https://svnweb.freebsd.org/changeset/base/342641 Log: MFC r342385: Remove an empty #if block. The interesting thing is that looking through Darren's commit logs, the line containing an extern ppsratecheck() definition was removed from the v5-1-RELEASE branch but not from HEAD (I have taken his CVS tree and converted it to GIT). There is a commit adding an additional #if defined to the empty block. I can only assume that this was intentional for something later. Looking through HEAD the extern ppsratecheck() is there. However if we put it back it would conflict with a static ppsratecheck() definition in fil.c when building ipftest. Therefore we remove this empty block. ppsratecheck() is a function in the FreeBSD kernel. However ipftest cannot call the ppsratecheck() in the kernel. Therefore one exists in fil.c for use when building the userland ipftest utility which approximates the packet filter in userland for testing of ipfilter rules against packets captured with tcpdump. Modified: 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/10/sys/contrib/ipfilter/netinet/ip_fil.h stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Mon Dec 31 03:08:01 2018 (r342640) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Mon Dec 31 03:53:33 2018 (r342641) @@ -1813,9 +1813,6 @@ extern int ipf_resolvefunc __P((ipf_main_softc_t *, vo extern void *ipf_resolvenic __P((ipf_main_softc_t *, char *, int)); extern int ipf_send_icmp_err __P((int, fr_info_t *, int)); extern int ipf_send_reset __P((fr_info_t *)); -#if (defined(__FreeBSD_version) && (__FreeBSD_version < 501000)) || \ - !defined(_KERNEL) || defined(linux) -#endif extern void ipf_apply_timeout __P((ipftq_t *, u_int)); extern ipftq_t *ipf_addtimeoutqueue __P((ipf_main_softc_t *, ipftq_t **, u_int)); From owner-svn-src-all@freebsd.org Mon Dec 31 03:53:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63E58141FB34; Mon, 31 Dec 2018 03:53:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06F5E84EDF; Mon, 31 Dec 2018 03:53:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE86F51AC; Mon, 31 Dec 2018 03:53:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV3rXoO039179; Mon, 31 Dec 2018 03:53:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV3rXs3039178; Mon, 31 Dec 2018 03:53:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812310353.wBV3rXs3039178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 31 Dec 2018 03:53: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: r342641 - in stable: 10/sys/contrib/ipfilter/netinet 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: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 06F5E84EDF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 31 Dec 2018 03:53:34 -0000 Author: cy Date: Mon Dec 31 03:53:33 2018 New Revision: 342641 URL: https://svnweb.freebsd.org/changeset/base/342641 Log: MFC r342385: Remove an empty #if block. The interesting thing is that looking through Darren's commit logs, the line containing an extern ppsratecheck() definition was removed from the v5-1-RELEASE branch but not from HEAD (I have taken his CVS tree and converted it to GIT). There is a commit adding an additional #if defined to the empty block. I can only assume that this was intentional for something later. Looking through HEAD the extern ppsratecheck() is there. However if we put it back it would conflict with a static ppsratecheck() definition in fil.c when building ipftest. Therefore we remove this empty block. ppsratecheck() is a function in the FreeBSD kernel. However ipftest cannot call the ppsratecheck() in the kernel. Therefore one exists in fil.c for use when building the userland ipftest utility which approximates the packet filter in userland for testing of ipfilter rules against packets captured with tcpdump. Modified: 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/10/sys/contrib/ipfilter/netinet/ip_fil.h stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Mon Dec 31 03:08:01 2018 (r342640) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Mon Dec 31 03:53:33 2018 (r342641) @@ -1813,9 +1813,6 @@ extern int ipf_resolvefunc __P((ipf_main_softc_t *, vo extern void *ipf_resolvenic __P((ipf_main_softc_t *, char *, int)); extern int ipf_send_icmp_err __P((int, fr_info_t *, int)); extern int ipf_send_reset __P((fr_info_t *)); -#if (defined(__FreeBSD_version) && (__FreeBSD_version < 501000)) || \ - !defined(_KERNEL) || defined(linux) -#endif extern void ipf_apply_timeout __P((ipftq_t *, u_int)); extern ipftq_t *ipf_addtimeoutqueue __P((ipf_main_softc_t *, ipftq_t **, u_int)); From owner-svn-src-all@freebsd.org Mon Dec 31 00:15:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE1BE143AA53; Mon, 31 Dec 2018 00:15:05 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86F3A74779; Mon, 31 Dec 2018 00:15:05 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A1692935; Mon, 31 Dec 2018 00:15:05 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV0F5Bp023243; Mon, 31 Dec 2018 00:15:05 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV0F5Y6023242; Mon, 31 Dec 2018 00:15:05 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201812310015.wBV0F5Y6023242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Mon, 31 Dec 2018 00:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342636 - head X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 342636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 86F3A74779 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 31 Dec 2018 00:15:06 -0000 Author: bcran Date: Mon Dec 31 00:15:05 2018 New Revision: 342636 URL: https://svnweb.freebsd.org/changeset/base/342636 Log: Add UPDATING entry for r342635. Sponsored by: Netflix Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Dec 31 00:09:45 2018 (r342635) +++ head/UPDATING Mon Dec 31 00:15:05 2018 (r342636) @@ -31,6 +31,12 @@ 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".) +20181230: + r342635 changes the way efibootmgr(8) works by requiring users to add + the -b (bootnum) parameter for commands where the bootnum was previously + specified with each option. For example 'efibootmgr -B 0001' is now + 'efibootmgr -B -b 0001'. + 20181220: r342286 modifies the NFSv4 server so that it obeys vfs.nfsd.nfs_privport in the same as it is applied to NFSv2 and 3. This implies that NFSv4 From owner-svn-src-all@freebsd.org Sun Dec 30 19:44:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A8A11433393; Sun, 30 Dec 2018 19:44:51 +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 2CB286B94D; Sun, 30 Dec 2018 19:44:51 +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 1A7AA27A87; Sun, 30 Dec 2018 19:44:51 +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 wBUJioUl077030; Sun, 30 Dec 2018 19:44:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUJioTd077028; Sun, 30 Dec 2018 19:44:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201812301944.wBUJioTd077028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 30 Dec 2018 19:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342632 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 342632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2CB286B94D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 30 Dec 2018 19:44:51 -0000 Author: pfg Date: Sun Dec 30 19:44:50 2018 New Revision: 342632 URL: https://svnweb.freebsd.org/changeset/base/342632 Log: ext2fs.5: Update the manpage. General update of the driver description and mention some important credits. Add a symlink for ext4fs as it is of special interest nowadays. Fic some `mandoc -Tlint` issues while here. MFC after: 15 days Differential Revision: https://reviews.freebsd.org/D18445 Modified: head/share/man/man5/Makefile head/share/man/man5/ext2fs.5 Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Sun Dec 30 16:39:26 2018 (r342631) +++ head/share/man/man5/Makefile Sun Dec 30 19:44:50 2018 (r342632) @@ -71,6 +71,7 @@ MAN= acct.5 \ tmpfs.5 MLINKS= dir.5 dirent.5 +MLINKS+=ext2fs.5 ext4fs.5 MLINKS+=fs.5 inode.5 MLINKS+=hosts.equiv.5 rhosts.5 MLINKS+=msdosfs.5 msdos.5 Modified: head/share/man/man5/ext2fs.5 ============================================================================== --- head/share/man/man5/ext2fs.5 Sun Dec 30 16:39:26 2018 (r342631) +++ head/share/man/man5/ext2fs.5 Sun Dec 30 19:44:50 2018 (r342632) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 4, 2018 +.Dd December 30, 2018 .Dt EXT2FS 5 .Os .Sh NAME @@ -47,13 +47,15 @@ The driver will permit the .Fx kernel to access -.Tn ext2 , -.Tn ext3 , +ext2 +file systems and its derivatives. +It currently implements most of the features required by +.Em ext3 and -.Tn ext4 +.Em ext4 file systems. Support for Extended Attributes in -.Tn ext4 +.Em ext4 is experimental. Journalling and encryption are currently not supported. .Sh EXAMPLES @@ -77,14 +79,28 @@ driver first appeared in .An -nosplit The .Nm -kernel implementation was written by +kernel implementation is derived from code written, +or modified, +by .An Godmar Back -or modified by him using the CSRG sources. +using the UFS CSRG sources for CMU Mach. .Pp .An John Dyson -and others in the +did the initial port to +.Fx . +.An Aditya Sarawgi +merged important parts of the allocation code from a clean-room +.Nx +implementation. +.An Zheng Liu +and +.An Fedor Upurov +implemented the read and write support respectively for +.Em ext4 +filesystems. +The .Fx -Project made modifications. +community has contributed a huge amount of modifications. .Pp -This manual page was written by +The initial version of this manual page was written by .An Craig Rodrigues Aq Mt rodrigc@FreeBSD.org . From owner-svn-src-all@freebsd.org Mon Dec 31 03:53:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA630141FB3C; Mon, 31 Dec 2018 03:53:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59F7A84EE1; Mon, 31 Dec 2018 03:53:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C1FE51AD; Mon, 31 Dec 2018 03:53:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV3rYpf039185; Mon, 31 Dec 2018 03:53:34 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV3rYee039184; Mon, 31 Dec 2018 03:53:34 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812310353.wBV3rYee039184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 31 Dec 2018 03:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342641 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59F7A84EE1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2018 03:53:35 -0000 Author: cy Date: Mon Dec 31 03:53:33 2018 New Revision: 342641 URL: https://svnweb.freebsd.org/changeset/base/342641 Log: MFC r342385: Remove an empty #if block. The interesting thing is that looking through Darren's commit logs, the line containing an extern ppsratecheck() definition was removed from the v5-1-RELEASE branch but not from HEAD (I have taken his CVS tree and converted it to GIT). There is a commit adding an additional #if defined to the empty block. I can only assume that this was intentional for something later. Looking through HEAD the extern ppsratecheck() is there. However if we put it back it would conflict with a static ppsratecheck() definition in fil.c when building ipftest. Therefore we remove this empty block. ppsratecheck() is a function in the FreeBSD kernel. However ipftest cannot call the ppsratecheck() in the kernel. Therefore one exists in fil.c for use when building the userland ipftest utility which approximates the packet filter in userland for testing of ipfilter rules against packets captured with tcpdump. Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_fil.h Mon Dec 31 03:08:01 2018 (r342640) +++ stable/10/sys/contrib/ipfilter/netinet/ip_fil.h Mon Dec 31 03:53:33 2018 (r342641) @@ -1813,9 +1813,6 @@ extern int ipf_resolvefunc __P((ipf_main_softc_t *, vo extern void *ipf_resolvenic __P((ipf_main_softc_t *, char *, int)); extern int ipf_send_icmp_err __P((int, fr_info_t *, int)); extern int ipf_send_reset __P((fr_info_t *)); -#if (defined(__FreeBSD_version) && (__FreeBSD_version < 501000)) || \ - !defined(_KERNEL) || defined(linux) -#endif extern void ipf_apply_timeout __P((ipftq_t *, u_int)); extern ipftq_t *ipf_addtimeoutqueue __P((ipf_main_softc_t *, ipftq_t **, u_int)); From owner-svn-src-all@freebsd.org Mon Dec 31 00:09:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4152A143A7D4; Mon, 31 Dec 2018 00:09:46 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D61927429D; Mon, 31 Dec 2018 00:09:45 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C43C9275E; Mon, 31 Dec 2018 00:09:45 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV09jU8017570; Mon, 31 Dec 2018 00:09:45 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV09jZO017569; Mon, 31 Dec 2018 00:09:45 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201812310009.wBV09jZO017569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Mon, 31 Dec 2018 00:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342635 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 342635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D61927429D 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.96)[-0.957,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)[-0.998,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, 31 Dec 2018 00:09:46 -0000 Author: bcran Date: Mon Dec 31 00:09:45 2018 New Revision: 342635 URL: https://svnweb.freebsd.org/changeset/base/342635 Log: Change the way efibootmgr works by specifying bootnum via -b parameter Instead of passing the bootnum to each different parameter, require users to specify -b when running operations that need a bootnum. This allows activation of a new boot entry at the same time it's created by adding -a onto the command line. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18648 Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Sun Dec 30 23:08:06 2018 (r342634) +++ head/usr.sbin/efibootmgr/efibootmgr.c Mon Dec 31 00:09:45 2018 (r342635) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017 Netflix, Inc. + * Copyright (c) 2017-2018 Netflix, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -94,16 +94,16 @@ typedef struct _bmgr_opts { } bmgr_opts_t; static struct option lopts[] = { - {"activate", required_argument, NULL, 'a'}, - {"bootnext", required_argument, NULL, 'n'}, /* set bootnext */ + {"activate", no_argument, NULL, 'a'}, + {"bootnext", no_argument, NULL, 'n'}, /* set bootnext */ {"bootnum", required_argument, NULL, 'b'}, {"bootorder", required_argument, NULL, 'o'}, /* set order */ {"copy", required_argument, NULL, 'C'}, /* Copy boot method */ {"create", no_argument, NULL, 'c'}, - {"deactivate", required_argument, NULL, 'A'}, + {"deactivate", no_argument, NULL, 'A'}, {"del-timout", no_argument, NULL, 'T'}, - {"delete", required_argument, NULL, 'B'}, - {"delete-bootnext", required_argument, NULL, 'N'}, + {"delete", no_argument, NULL, 'B'}, + {"delete-bootnext", no_argument, NULL, 'N'}, {"dry-run", no_argument, NULL, 'D'}, {"env", required_argument, NULL, 'e'}, {"help", no_argument, NULL, 'h'}, @@ -171,37 +171,35 @@ set_bootvar(const char *name, uint8_t *data, size_t si #define USAGE \ - " [-aAnNB Bootvar] [-t timeout] [-T] [-o bootorder] [-O] [--verbose] [--help] \n\ - [-c -l loader [-k kernel ] [-L label] [--dry-run] [-b Bootvar]]" + " [-aAnB -b bootnum] [-N] [-t timeout] [-T] [-o bootorder] [-O] [--verbose] [--help]\n\ + [-c -l loader [-k kernel] [-L label] [--dry-run] [-b bootnum]]" #define CREATE_USAGE \ - " efibootmgr -c -l loader [-k kernel] [-L label] [--dry-run]" + " efibootmgr -c -l loader [-k kernel] [-L label] [--dry-run] [-b bootnum] [-a]" #define ORDER_USAGE \ " efibootmgr -o bootvarnum1,bootvarnum2,..." #define TIMEOUT_USAGE \ " efibootmgr -t seconds" #define DELETE_USAGE \ - " efibootmgr -B bootvarnum" + " efibootmgr -B -b bootnum" #define ACTIVE_USAGE \ - " efibootmgr [-a | -A] bootvarnum" + " efibootmgr [-a | -A] -b bootnum" #define BOOTNEXT_USAGE \ - " efibootmgr [-n | -N] bootvarnum" + " efibootmgr [-n | -N] -b bootnum" static void parse_args(int argc, char *argv[]) { int ch; - while ((ch = getopt_long(argc, argv, "A:a:B:b:C:cDe:hk:L:l:Nn:Oo:Tt:v", + while ((ch = getopt_long(argc, argv, "AaBb:C:cDe:hk:L:l:NnOo:Tt:v", lopts, NULL)) != -1) { switch (ch) { case 'A': opts.set_inactive = true; - opts.bootnum = strtoul(optarg, NULL, 16); break; case 'a': opts.set_active = true; - opts.bootnum = strtoul(optarg, NULL, 16); break; case 'b': opts.has_bootnum = true; @@ -209,7 +207,6 @@ parse_args(int argc, char *argv[]) break; case 'B': opts.delete = true; - opts.bootnum = strtoul(optarg, NULL, 16); break; case 'C': opts.copy = true; @@ -246,7 +243,6 @@ parse_args(int argc, char *argv[]) break; case 'n': opts.set_bootnext = true; - opts.bootnum = strtoul(optarg, NULL, 16); break; case 'O': opts.once = true; @@ -275,6 +271,15 @@ parse_args(int argc, char *argv[]) if (opts.order && !(opts.order)) errx(1, "%s", ORDER_USAGE); + + if ((opts.set_inactive || opts.set_active) && !opts.has_bootnum) + errx(1, "%s", ACTIVE_USAGE); + + if (opts.delete && !opts.has_bootnum) + errx(1, "%s", DELETE_USAGE); + + if (opts.set_bootnext && !opts.has_bootnum) + errx(1, "%s", BOOTNEXT_USAGE); } From owner-svn-src-all@freebsd.org Mon Dec 31 07:55:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4C0C142A698; Mon, 31 Dec 2018 07:55:14 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 799CE8E7B0; Mon, 31 Dec 2018 07:55:14 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 669137A1B; Mon, 31 Dec 2018 07:55:14 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV7tESQ065977; Mon, 31 Dec 2018 07:55:14 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV7tDfP065974; Mon, 31 Dec 2018 07:55:13 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201812310755.wBV7tDfP065974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Mon, 31 Dec 2018 07:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r342642 - vendor/tzdata/dist X-SVN-Group: vendor X-SVN-Commit-Author: philip X-SVN-Commit-Paths: vendor/tzdata/dist X-SVN-Commit-Revision: 342642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 799CE8E7B0 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)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2018 07:55:15 -0000 Author: philip Date: Mon Dec 31 07:55:13 2018 New Revision: 342642 URL: https://svnweb.freebsd.org/changeset/base/342642 Log: Import tzdata 2018i Modified: vendor/tzdata/dist/NEWS vendor/tzdata/dist/africa vendor/tzdata/dist/version Modified: vendor/tzdata/dist/NEWS ============================================================================== --- vendor/tzdata/dist/NEWS Mon Dec 31 03:53:33 2018 (r342641) +++ vendor/tzdata/dist/NEWS Mon Dec 31 07:55:13 2018 (r342642) @@ -1,5 +1,17 @@ News for the tz database +Release 2018i - 2018-12-30 11:05:43 -0800 + + Briefly: + São Tomé and Príncipe switches from +01 to +00 on 2019-01-01. + + Changes to future timestamps + + Due to a change in government, São Tomé and Príncipe switches back + from +01 to +00 on 2019-01-01 at 02:00. (Thanks to Vadim + Nasardinov and Michael Deckers.) + + Release 2018h - 2018-12-23 17:59:32 -0800 Briefly: Modified: vendor/tzdata/dist/africa ============================================================================== --- vendor/tzdata/dist/africa Mon Dec 31 03:53:33 2018 (r342641) +++ vendor/tzdata/dist/africa Mon Dec 31 07:55:13 2018 (r342642) @@ -1144,10 +1144,20 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Den # the switch is from 01:00 to 02:00 ... [Decree No. 25/2017] # http://www.mnec.gov.st/index.php/publicacoes/documentos/file/90-decreto-lei-n-25-2017 +# From Vadim Nasardinov (2018-12-29): +# São Tomé and Príncipe is about to do the following on Jan 1, 2019: +# https://www.stp-press.st/2018/12/05/governo-jesus-ja-decidiu-repor-hora-legal-sao-tomense/ +# +# From Michael Deckers (2018-12-30): +# https://www.legis-palop.org/download.jsp?idFile=102818 +# ... [The legal time of the country, which coincides with universal +# coordinated time, will be restituted at 2 o'clock on day 1 of January, 2019.] + Zone Africa/Sao_Tome 0:26:56 - LMT 1884 -0:36:45 - LMT 1912 Jan 1 00:00u # Lisbon MT 0:00 - GMT 2018 Jan 1 01:00 - 1:00 - WAT + 1:00 - WAT 2019 Jan 1 02:00 + 0:00 - GMT # Senegal # See Africa/Abidjan. Modified: vendor/tzdata/dist/version ============================================================================== --- vendor/tzdata/dist/version Mon Dec 31 03:53:33 2018 (r342641) +++ vendor/tzdata/dist/version Mon Dec 31 07:55:13 2018 (r342642) @@ -1 +1 @@ -2018h +2018i From owner-svn-src-all@freebsd.org Mon Dec 31 07:55:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F131142A6F6; Mon, 31 Dec 2018 07:55:49 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 255128E8CE; Mon, 31 Dec 2018 07:55:49 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F139A7A1C; Mon, 31 Dec 2018 07:55:48 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV7tmG2066051; Mon, 31 Dec 2018 07:55:48 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV7tmZo066050; Mon, 31 Dec 2018 07:55:48 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201812310755.wBV7tmZo066050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Mon, 31 Dec 2018 07:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r342643 - vendor/tzdata/tzdata2018i X-SVN-Group: vendor X-SVN-Commit-Author: philip X-SVN-Commit-Paths: vendor/tzdata/tzdata2018i X-SVN-Commit-Revision: 342643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 255128E8CE 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.955,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2018 07:55:49 -0000 Author: philip Date: Mon Dec 31 07:55:48 2018 New Revision: 342643 URL: https://svnweb.freebsd.org/changeset/base/342643 Log: Tag import of tzdata2018i Added: vendor/tzdata/tzdata2018i/ - copied from r342642, vendor/tzdata/dist/ From owner-svn-src-all@freebsd.org Mon Dec 31 07:57:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F02D142A7F4; Mon, 31 Dec 2018 07:57:39 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A93518EA50; Mon, 31 Dec 2018 07:57:38 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 829357A1F; Mon, 31 Dec 2018 07:57:38 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV7vckF066178; Mon, 31 Dec 2018 07:57:38 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV7vbVw066175; Mon, 31 Dec 2018 07:57:37 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201812310757.wBV7vbVw066175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Mon, 31 Dec 2018 07:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342644 - head/contrib/tzdata X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/contrib/tzdata X-SVN-Commit-Revision: 342644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A93518EA50 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)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2018 07:57:39 -0000 Author: philip Date: Mon Dec 31 07:57:37 2018 New Revision: 342644 URL: https://svnweb.freebsd.org/changeset/base/342644 Log: Import tzdata 2018i Changes: https://github.com/eggert/tz/blob/2018i/NEWS MFC after: 2 days Modified: head/contrib/tzdata/NEWS head/contrib/tzdata/africa head/contrib/tzdata/version Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Mon Dec 31 07:55:48 2018 (r342643) +++ head/contrib/tzdata/NEWS Mon Dec 31 07:57:37 2018 (r342644) @@ -1,5 +1,17 @@ News for the tz database +Release 2018i - 2018-12-30 11:05:43 -0800 + + Briefly: + São Tomé and Príncipe switches from +01 to +00 on 2019-01-01. + + Changes to future timestamps + + Due to a change in government, São Tomé and Príncipe switches back + from +01 to +00 on 2019-01-01 at 02:00. (Thanks to Vadim + Nasardinov and Michael Deckers.) + + Release 2018h - 2018-12-23 17:59:32 -0800 Briefly: Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Mon Dec 31 07:55:48 2018 (r342643) +++ head/contrib/tzdata/africa Mon Dec 31 07:57:37 2018 (r342644) @@ -1144,10 +1144,20 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Den # the switch is from 01:00 to 02:00 ... [Decree No. 25/2017] # http://www.mnec.gov.st/index.php/publicacoes/documentos/file/90-decreto-lei-n-25-2017 +# From Vadim Nasardinov (2018-12-29): +# São Tomé and Príncipe is about to do the following on Jan 1, 2019: +# https://www.stp-press.st/2018/12/05/governo-jesus-ja-decidiu-repor-hora-legal-sao-tomense/ +# +# From Michael Deckers (2018-12-30): +# https://www.legis-palop.org/download.jsp?idFile=102818 +# ... [The legal time of the country, which coincides with universal +# coordinated time, will be restituted at 2 o'clock on day 1 of January, 2019.] + Zone Africa/Sao_Tome 0:26:56 - LMT 1884 -0:36:45 - LMT 1912 Jan 1 00:00u # Lisbon MT 0:00 - GMT 2018 Jan 1 01:00 - 1:00 - WAT + 1:00 - WAT 2019 Jan 1 02:00 + 0:00 - GMT # Senegal # See Africa/Abidjan. Modified: head/contrib/tzdata/version ============================================================================== --- head/contrib/tzdata/version Mon Dec 31 07:55:48 2018 (r342643) +++ head/contrib/tzdata/version Mon Dec 31 07:57:37 2018 (r342644) @@ -1 +1 @@ -2018h +2018i From owner-svn-src-all@freebsd.org Mon Dec 31 10:17:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1BF6142E30B; Mon, 31 Dec 2018 10:17:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68EAC92E84; Mon, 31 Dec 2018 10:17:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A7689188; Mon, 31 Dec 2018 10:17:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVAHhCL039292; Mon, 31 Dec 2018 10:17:43 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVAHhRo039291; Mon, 31 Dec 2018 10:17:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201812311017.wBVAHhRo039291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 31 Dec 2018 10:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342645 - head/share/skel X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/skel X-SVN-Commit-Revision: 342645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 68EAC92E84 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 31 Dec 2018 10:17:43 -0000 Author: trasz Date: Mon Dec 31 10:17:42 2018 New Revision: 342645 URL: https://svnweb.freebsd.org/changeset/base/342645 Log: Add current working directory to the default (although commented out) sh(1) prompt, so it looks just like the tcsh(1) one when you uncomment it. Reviewed by: jilles MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18673 Modified: head/share/skel/dot.shrc Modified: head/share/skel/dot.shrc ============================================================================== --- head/share/skel/dot.shrc Mon Dec 31 07:57:37 2018 (r342644) +++ head/share/skel/dot.shrc Mon Dec 31 10:17:42 2018 (r342645) @@ -32,8 +32,8 @@ alias g='egrep -i' # alias rm='rm -i' -# # set prompt: ``username@hostname$ '' -# PS1="`whoami`@\h\\$ " +# # set prompt: ``username@hostname:directory $ '' +# PS1="`whoami`@\h:\w \\$ " # search path for cd(1) # CDPATH=:$HOME From owner-svn-src-all@freebsd.org Mon Dec 31 10:59:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCD60142F570; Mon, 31 Dec 2018 10:59:31 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A25994329; Mon, 31 Dec 2018 10:59:31 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 103599831; Mon, 31 Dec 2018 10:59:31 +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 wBVAxUes060531; Mon, 31 Dec 2018 10:59:30 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVAxUQd060530; Mon, 31 Dec 2018 10:59:30 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812311059.wBVAxUQd060530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 31 Dec 2018 10:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342646 - stable/12/sys/dev/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/netmap X-SVN-Commit-Revision: 342646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A25994329 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2018 10:59:32 -0000 Author: vmaffione Date: Mon Dec 31 10:59:30 2018 New Revision: 342646 URL: https://svnweb.freebsd.org/changeset/base/342646 Log: MFC r342368, r342369 netmap: fix bug in netmap_poll() optimization The bug was introduced by r339639, although it is present in the upstream netmap code since 2015. It is due to resetting the want_rx variable to POLLIN, rather than resetting it to POLLIN|POLLRDNORM. It only affects select(), which uses POLLRDNORM. poll() is not affected, because it uses POLLIN. Also, it only affects FreeBSD, because Linux skips the optimization implemented by the piece of code where the bug occurs. To check if txsync can be skipped, it is necessary to look for unseen TX space. However, this means comparing ring->cur against ring->tail, rather than ring->head against ring->tail (like nm_ring_empty() does). Sponsored by: Sunny Valley Networks Modified: stable/12/sys/dev/netmap/netmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/netmap.c ============================================================================== --- stable/12/sys/dev/netmap/netmap.c Mon Dec 31 10:17:42 2018 (r342645) +++ stable/12/sys/dev/netmap/netmap.c Mon Dec 31 10:59:30 2018 (r342646) @@ -3292,28 +3292,38 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM * that we must call nm_os_selrecord() unconditionally. */ if (want_tx) { - enum txrx t = NR_TX; - for (i = priv->np_qfirst[t]; want[t] && i < priv->np_qlast[t]; i++) { + const enum txrx t = NR_TX; + for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { kring = NMR(na, t)[i]; - /* XXX compare ring->cur and kring->tail */ - if (!nm_ring_empty(kring->ring)) { + if (kring->ring->cur != kring->ring->tail) { + /* Some unseen TX space is available, so what + * we don't need to run txsync. */ revents |= want[t]; - want[t] = 0; /* also breaks the loop */ + want[t] = 0; + break; } } } if (want_rx) { - enum txrx t = NR_RX; - want_rx = 0; /* look for a reason to run the handlers */ + const enum txrx t = NR_RX; + int rxsync_needed = 0; + for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { kring = NMR(na, t)[i]; - if (kring->ring->cur == kring->ring->tail /* try fetch new buffers */ - || kring->rhead != kring->ring->head /* release buffers */) { - want_rx = 1; + if (kring->ring->cur == kring->ring->tail + || kring->rhead != kring->ring->head) { + /* There are no unseen packets on this ring, + * or there are some buffers to be returned + * to the netmap port. We therefore go ahead + * and run rxsync. */ + rxsync_needed = 1; + break; } } - if (!want_rx) - revents |= events & (POLLIN | POLLRDNORM); /* we have data */ + if (!rxsync_needed) { + revents |= want_rx; + want_rx = 0; + } } #endif From owner-svn-src-all@freebsd.org Mon Dec 31 11:05:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6E2E142F782; Mon, 31 Dec 2018 11:05:39 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46FB9946F4; Mon, 31 Dec 2018 11:05:39 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26D2D99D6; Mon, 31 Dec 2018 11:05:39 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVB5cjC065946; Mon, 31 Dec 2018 11:05:38 GMT (envelope-from mr@FreeBSD.org) Received: (from mr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVB5c0X065945; Mon, 31 Dec 2018 11:05:38 GMT (envelope-from mr@FreeBSD.org) Message-Id: <201812311105.wBVB5c0X065945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mr set sender to mr@FreeBSD.org using -f From: Michael Reifenberger Date: Mon, 31 Dec 2018 11:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342647 - stable/11/etc/periodic/daily X-SVN-Group: stable-11 X-SVN-Commit-Author: mr X-SVN-Commit-Paths: stable/11/etc/periodic/daily X-SVN-Commit-Revision: 342647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46FB9946F4 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)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2018 11:05:39 -0000 Author: mr Date: Mon Dec 31 11:05:38 2018 New Revision: 342647 URL: https://svnweb.freebsd.org/changeset/base/342647 Log: Merge forgotten r318577 to close PR. PR: 217622 Modified: stable/11/etc/periodic/daily/800.scrub-zfs Modified: stable/11/etc/periodic/daily/800.scrub-zfs ============================================================================== --- stable/11/etc/periodic/daily/800.scrub-zfs Mon Dec 31 10:59:30 2018 (r342646) +++ stable/11/etc/periodic/daily/800.scrub-zfs Mon Dec 31 11:05:38 2018 (r342647) @@ -71,7 +71,7 @@ case "$daily_scrub_zfs_enable" in # Now minus last scrub (both in seconds) converted to days. _scrub_diff=$(expr -e \( $(date +%s) - \ - $(date -j -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24) + $(date -j -v -70M -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24) if [ ${_scrub_diff} -lt ${_pool_threshold} ]; then echo " skipping scrubbing of pool '${pool}':" echo " last scrubbing is ${_scrub_diff} days ago, threshold is set to ${_pool_threshold} days" From owner-svn-src-all@freebsd.org Mon Dec 31 11:10:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81466142F82D; Mon, 31 Dec 2018 11:10:03 +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 1F51D9486E; Mon, 31 Dec 2018 11:10:03 +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 E83F799DE; Mon, 31 Dec 2018 11:10:02 +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 wBVBA2mg066298; Mon, 31 Dec 2018 11:10:02 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVBA2E8066297; Mon, 31 Dec 2018 11:10:02 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812311110.wBVBA2E8066297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 31 Dec 2018 11:10:02 +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: r342648 - stable/11/sys/dev/netmap X-SVN-Group: stable-11 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/11/sys/dev/netmap X-SVN-Commit-Revision: 342648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F51D9486E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.976,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)[-0.998,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, 31 Dec 2018 11:10:03 -0000 Author: vmaffione Date: Mon Dec 31 11:10:02 2018 New Revision: 342648 URL: https://svnweb.freebsd.org/changeset/base/342648 Log: MFC r342368, r342369 netmap: fix bug in netmap_poll() optimization The bug was introduced by r339639, although it is present in the upstream netmap code since 2015. It is due to resetting the want_rx variable to POLLIN, rather than resetting it to POLLIN|POLLRDNORM. It only affects select(), which uses POLLRDNORM. poll() is not affected, because it uses POLLIN. Also, it only affects FreeBSD, because Linux skips the optimization implemented by the piece of code where the bug occurs. To check if txsync can be skipped, it is necessary to look for unseen TX space. However, this means comparing ring->cur against ring->tail, rather than ring->head against ring->tail (like nm_ring_empty() does). Sponsored by: Sunny Valley Networks Modified: stable/11/sys/dev/netmap/netmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/netmap/netmap.c ============================================================================== --- stable/11/sys/dev/netmap/netmap.c Mon Dec 31 11:05:38 2018 (r342647) +++ stable/11/sys/dev/netmap/netmap.c Mon Dec 31 11:10:02 2018 (r342648) @@ -3293,28 +3293,38 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM * that we must call nm_os_selrecord() unconditionally. */ if (want_tx) { - enum txrx t = NR_TX; - for (i = priv->np_qfirst[t]; want[t] && i < priv->np_qlast[t]; i++) { + const enum txrx t = NR_TX; + for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { kring = NMR(na, t)[i]; - /* XXX compare ring->cur and kring->tail */ - if (!nm_ring_empty(kring->ring)) { + if (kring->ring->cur != kring->ring->tail) { + /* Some unseen TX space is available, so what + * we don't need to run txsync. */ revents |= want[t]; - want[t] = 0; /* also breaks the loop */ + want[t] = 0; + break; } } } if (want_rx) { - enum txrx t = NR_RX; - want_rx = 0; /* look for a reason to run the handlers */ + const enum txrx t = NR_RX; + int rxsync_needed = 0; + for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { kring = NMR(na, t)[i]; - if (kring->ring->cur == kring->ring->tail /* try fetch new buffers */ - || kring->rhead != kring->ring->head /* release buffers */) { - want_rx = 1; + if (kring->ring->cur == kring->ring->tail + || kring->rhead != kring->ring->head) { + /* There are no unseen packets on this ring, + * or there are some buffers to be returned + * to the netmap port. We therefore go ahead + * and run rxsync. */ + rxsync_needed = 1; + break; } } - if (!want_rx) - revents |= events & (POLLIN | POLLRDNORM); /* we have data */ + if (!rxsync_needed) { + revents |= want_rx; + want_rx = 0; + } } #endif From owner-svn-src-all@freebsd.org Mon Dec 31 11:18:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82EA6142FA56; Mon, 31 Dec 2018 11:18:00 +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 A2C9A94D27; Mon, 31 Dec 2018 11:17:59 +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 84FDE9B93; Mon, 31 Dec 2018 11:17:59 +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 wBVBHxI8071851; Mon, 31 Dec 2018 11:17:59 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVBHwGO071847; Mon, 31 Dec 2018 11:17:58 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812311117.wBVBHwGO071847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 31 Dec 2018 11:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342649 - in head: etc/mtree tests/sys tests/sys/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head: etc/mtree tests/sys tests/sys/netmap X-SVN-Commit-Revision: 342649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2C9A94D27 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 31 Dec 2018 11:18:01 -0000 Author: vmaffione Date: Mon Dec 31 11:17:58 2018 New Revision: 342649 URL: https://svnweb.freebsd.org/changeset/base/342649 Log: netmap: add suite of unit tests Import the unit tests from upstream (https://github.com/luigirizzo/netmap ba02539859d46d33), and make them ready for use with Kyua. There are currently 38 regression tests, which test the kernel control ABI exposed by netmap to userspace applications: 1: test for port info get 2-5: tests for basic port registration 6-9: tests for VALE 10-11: tests for getting netmap allocator info 12-15: tests for netmap pipes 16: test on polling mode 17-18: tests on options 19-27: tests for sync-kloop subsystem 28-39: tests for null ports 31-38: tests for the legacy NIOCREGIF registers Reviewed by: ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18490 Added: head/tests/sys/netmap/ head/tests/sys/netmap/Makefile (contents, props changed) head/tests/sys/netmap/ctrl-api-test.c (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/tests/sys/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Dec 31 11:10:02 2018 (r342648) +++ head/etc/mtree/BSD.tests.dist Mon Dec 31 11:17:58 2018 (r342649) @@ -760,6 +760,8 @@ tunnel .. .. + netmap + .. netpfil pf ioctl Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Mon Dec 31 11:10:02 2018 (r342648) +++ head/tests/sys/Makefile Mon Dec 31 11:17:58 2018 (r342649) @@ -20,6 +20,7 @@ TESTS_SUBDIRS+= mac TESTS_SUBDIRS+= mqueue TESTS_SUBDIRS+= netinet TESTS_SUBDIRS+= netipsec +TESTS_SUBDIRS+= netmap TESTS_SUBDIRS+= netpfil TESTS_SUBDIRS+= opencrypto TESTS_SUBDIRS+= posixshm Added: head/tests/sys/netmap/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netmap/Makefile Mon Dec 31 11:17:58 2018 (r342649) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/netmap +TEST_METADATA+= required_user="root" +TEST_METADATA+= is_exclusive=true + +LDFLAGS+= -lpthread +PLAIN_TESTS_C+= ctrl-api-test + +WARNS?= 6 + +.include Added: head/tests/sys/netmap/ctrl-api-test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netmap/ctrl-api-test.c Mon Dec 31 11:17:58 2018 (r342649) @@ -0,0 +1,1905 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2018 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$ + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __linux__ +#include +#else +static int +eventfd(int x __unused, int y __unused) +{ + errno = ENODEV; + return -1; +} +#endif /* __linux__ */ + +static int +exec_command(int argc, const char *const argv[]) +{ + pid_t child_pid; + pid_t wret; + int child_status; + int i; + + printf("Executing command: "); + for (i = 0; i < argc - 1; i++) { + if (!argv[i]) { + /* Invalid argument. */ + return -1; + } + if (i > 0) { + putchar(' '); + } + printf("%s", argv[i]); + } + putchar('\n'); + + child_pid = fork(); + if (child_pid == 0) { + char **av; + + /* Child process. Redirect stdin, stdout + * and stderr. */ + close(0); + close(1); + close(2); + if (open("/dev/null", O_RDONLY) < 0 || + open("/dev/null", O_RDONLY) < 0 || + open("/dev/null", O_RDONLY) < 0) { + return -1; + } + + /* Make a copy of the arguments, passing them to execvp. */ + av = calloc(argc, sizeof(av[0])); + if (!av) { + exit(EXIT_FAILURE); + } + for (i = 0; i < argc - 1; i++) { + av[i] = strdup(argv[i]); + if (!av[i]) { + exit(EXIT_FAILURE); + } + } + execvp(av[0], av); + perror("execvp()"); + exit(EXIT_FAILURE); + } + + wret = waitpid(child_pid, &child_status, 0); + if (wret < 0) { + fprintf(stderr, "waitpid() failed: %s\n", strerror(errno)); + return wret; + } + if (WIFEXITED(child_status)) { + return WEXITSTATUS(child_status); + } + + return -1; +} + + +#define THRET_SUCCESS ((void *)128) +#define THRET_FAILURE ((void *)0) + +struct TestContext { + char ifname[128]; + char bdgname[64]; + uint32_t nr_tx_slots; /* slots in tx rings */ + uint32_t nr_rx_slots; /* slots in rx rings */ + uint16_t nr_tx_rings; /* number of tx rings */ + uint16_t nr_rx_rings; /* number of rx rings */ + uint16_t nr_mem_id; /* id of the memory allocator */ + uint16_t nr_ringid; /* ring(s) we care about */ + uint32_t nr_mode; /* specify NR_REG_* modes */ + uint32_t nr_extra_bufs; /* number of requested extra buffers */ + uint64_t nr_flags; /* additional flags (see below) */ + uint32_t nr_hdr_len; /* for PORT_HDR_SET and PORT_HDR_GET */ + uint32_t nr_first_cpu_id; /* vale polling */ + uint32_t nr_num_polling_cpus; /* vale polling */ + int fd; /* netmap file descriptor */ + + void *csb; /* CSB entries (atok and ktoa) */ + struct nmreq_option *nr_opt; /* list of options */ + sem_t *sem; /* for thread synchronization */ + struct nmport_d *nmport; /* nmport descriptor from libnetmap */ +}; + +static struct TestContext ctx_; + +typedef int (*testfunc_t)(struct TestContext *ctx); + +static void +nmreq_hdr_init(struct nmreq_header *hdr, const char *ifname) +{ + memset(hdr, 0, sizeof(*hdr)); + hdr->nr_version = NETMAP_API; + strncpy(hdr->nr_name, ifname, sizeof(hdr->nr_name) - 1); +} + +/* Single NETMAP_REQ_PORT_INFO_GET. */ +static int +port_info_get(struct TestContext *ctx) +{ + struct nmreq_port_info_get req; + struct nmreq_header hdr; + int success; + int ret; + + printf("Testing NETMAP_REQ_PORT_INFO_GET on '%s'\n", ctx->ifname); + + nmreq_hdr_init(&hdr, ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_PORT_INFO_GET; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + req.nr_mem_id = ctx->nr_mem_id; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, PORT_INFO_GET)"); + return ret; + } + printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_tx_slots %u\n", req.nr_tx_slots); + printf("nr_rx_slots %u\n", req.nr_rx_slots); + printf("nr_tx_rings %u\n", req.nr_tx_rings); + printf("nr_rx_rings %u\n", req.nr_rx_rings); + printf("nr_mem_id %u\n", req.nr_mem_id); + + success = req.nr_memsize && req.nr_tx_slots && req.nr_rx_slots && + req.nr_tx_rings && req.nr_rx_rings && req.nr_tx_rings; + if (!success) { + return -1; + } + + /* Write back results to the context structure. */ + ctx->nr_tx_slots = req.nr_tx_slots; + ctx->nr_rx_slots = req.nr_rx_slots; + ctx->nr_tx_rings = req.nr_tx_rings; + ctx->nr_rx_rings = req.nr_rx_rings; + ctx->nr_mem_id = req.nr_mem_id; + + return 0; +} + +/* Single NETMAP_REQ_REGISTER, no use. */ +static int +port_register(struct TestContext *ctx) +{ + struct nmreq_register req; + struct nmreq_header hdr; + int success; + int ret; + + printf("Testing NETMAP_REQ_REGISTER(mode=%d,ringid=%d," + "flags=0x%lx) on '%s'\n", + ctx->nr_mode, ctx->nr_ringid, ctx->nr_flags, ctx->ifname); + + nmreq_hdr_init(&hdr, ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_REGISTER; + hdr.nr_body = (uintptr_t)&req; + hdr.nr_options = (uintptr_t)ctx->nr_opt; + memset(&req, 0, sizeof(req)); + req.nr_mem_id = ctx->nr_mem_id; + req.nr_mode = ctx->nr_mode; + req.nr_ringid = ctx->nr_ringid; + req.nr_flags = ctx->nr_flags; + req.nr_tx_slots = ctx->nr_tx_slots; + req.nr_rx_slots = ctx->nr_rx_slots; + req.nr_tx_rings = ctx->nr_tx_rings; + req.nr_rx_rings = ctx->nr_rx_rings; + req.nr_extra_bufs = ctx->nr_extra_bufs; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, REGISTER)"); + return ret; + } + printf("nr_offset 0x%lx\n", req.nr_offset); + printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_tx_slots %u\n", req.nr_tx_slots); + printf("nr_rx_slots %u\n", req.nr_rx_slots); + printf("nr_tx_rings %u\n", req.nr_tx_rings); + printf("nr_rx_rings %u\n", req.nr_rx_rings); + printf("nr_mem_id %u\n", req.nr_mem_id); + printf("nr_extra_bufs %u\n", req.nr_extra_bufs); + + success = req.nr_memsize && (ctx->nr_mode == req.nr_mode) && + (ctx->nr_ringid == req.nr_ringid) && + (ctx->nr_flags == req.nr_flags) && + ((!ctx->nr_tx_slots && req.nr_tx_slots) || + (ctx->nr_tx_slots == req.nr_tx_slots)) && + ((!ctx->nr_rx_slots && req.nr_rx_slots) || + (ctx->nr_rx_slots == req.nr_rx_slots)) && + ((!ctx->nr_tx_rings && req.nr_tx_rings) || + (ctx->nr_tx_rings == req.nr_tx_rings)) && + ((!ctx->nr_rx_rings && req.nr_rx_rings) || + (ctx->nr_rx_rings == req.nr_rx_rings)) && + ((!ctx->nr_mem_id && req.nr_mem_id) || + (ctx->nr_mem_id == req.nr_mem_id)) && + (ctx->nr_extra_bufs == req.nr_extra_bufs); + if (!success) { + return -1; + } + + /* Write back results to the context structure.*/ + ctx->nr_tx_slots = req.nr_tx_slots; + ctx->nr_rx_slots = req.nr_rx_slots; + ctx->nr_tx_rings = req.nr_tx_rings; + ctx->nr_rx_rings = req.nr_rx_rings; + ctx->nr_mem_id = req.nr_mem_id; + ctx->nr_extra_bufs = req.nr_extra_bufs; + + return 0; +} + +static int +niocregif(struct TestContext *ctx, int netmap_api) +{ + struct nmreq req; + int success; + int ret; + + printf("Testing legacy NIOCREGIF on '%s'\n", ctx->ifname); + + memset(&req, 0, sizeof(req)); + memcpy(req.nr_name, ctx->ifname, sizeof(req.nr_name)); + req.nr_name[sizeof(req.nr_name) - 1] = '\0'; + req.nr_version = netmap_api; + req.nr_ringid = ctx->nr_ringid; + req.nr_flags = ctx->nr_mode | ctx->nr_flags; + req.nr_tx_slots = ctx->nr_tx_slots; + req.nr_rx_slots = ctx->nr_rx_slots; + req.nr_tx_rings = ctx->nr_tx_rings; + req.nr_rx_rings = ctx->nr_rx_rings; + req.nr_arg2 = ctx->nr_mem_id; + req.nr_arg3 = ctx->nr_extra_bufs; + + ret = ioctl(ctx->fd, NIOCREGIF, &req); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCREGIF)"); + return ret; + } + + printf("nr_offset 0x%x\n", req.nr_offset); + printf("nr_memsize %u\n", req.nr_memsize); + printf("nr_tx_slots %u\n", req.nr_tx_slots); + printf("nr_rx_slots %u\n", req.nr_rx_slots); + printf("nr_tx_rings %u\n", req.nr_tx_rings); + printf("nr_rx_rings %u\n", req.nr_rx_rings); + printf("nr_version %d\n", req.nr_version); + printf("nr_ringid %x\n", req.nr_ringid); + printf("nr_flags %x\n", req.nr_flags); + printf("nr_arg2 %u\n", req.nr_arg2); + printf("nr_arg3 %u\n", req.nr_arg3); + + success = req.nr_memsize && + (ctx->nr_ringid == req.nr_ringid) && + ((ctx->nr_mode | ctx->nr_flags) == req.nr_flags) && + ((!ctx->nr_tx_slots && req.nr_tx_slots) || + (ctx->nr_tx_slots == req.nr_tx_slots)) && + ((!ctx->nr_rx_slots && req.nr_rx_slots) || + (ctx->nr_rx_slots == req.nr_rx_slots)) && + ((!ctx->nr_tx_rings && req.nr_tx_rings) || + (ctx->nr_tx_rings == req.nr_tx_rings)) && + ((!ctx->nr_rx_rings && req.nr_rx_rings) || + (ctx->nr_rx_rings == req.nr_rx_rings)) && + ((!ctx->nr_mem_id && req.nr_arg2) || + (ctx->nr_mem_id == req.nr_arg2)) && + (ctx->nr_extra_bufs == req.nr_arg3); + if (!success) { + return -1; + } + + /* Write back results to the context structure.*/ + ctx->nr_tx_slots = req.nr_tx_slots; + ctx->nr_rx_slots = req.nr_rx_slots; + ctx->nr_tx_rings = req.nr_tx_rings; + ctx->nr_rx_rings = req.nr_rx_rings; + ctx->nr_mem_id = req.nr_arg2; + ctx->nr_extra_bufs = req.nr_arg3; + + return ret; +} + +/* The 11 ABI is the one right before the introduction of the new NIOCCTRL + * ABI. The 11 ABI is useful to perform tests with legacy applications + * (which use the 11 ABI) and new kernel (which uses 12, or higher). */ +#define NETMAP_API_NIOCREGIF 11 + +static int +legacy_regif_default(struct TestContext *ctx) +{ + return niocregif(ctx, NETMAP_API_NIOCREGIF); +} + +static int +legacy_regif_all_nic(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ALL_NIC; + return niocregif(ctx, NETMAP_API); +} + +static int +legacy_regif_12(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ALL_NIC; + return niocregif(ctx, NETMAP_API_NIOCREGIF+1); +} + +static int +legacy_regif_sw(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_SW; + return niocregif(ctx, NETMAP_API_NIOCREGIF); +} + +static int +legacy_regif_future(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_NIC_SW; + /* Test forward compatibility for the legacy ABI. This means + * using an older kernel (with ABI 12 or higher) and a newer + * application (with ABI greater than NETMAP_API). */ + return niocregif(ctx, NETMAP_API+2); +} + +static int +legacy_regif_extra_bufs(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ALL_NIC; + ctx->nr_extra_bufs = 20; /* arbitrary number of extra bufs */ + return niocregif(ctx, NETMAP_API_NIOCREGIF); +} + +static int +legacy_regif_extra_bufs_pipe(struct TestContext *ctx) +{ + strncat(ctx->ifname, "{pipeexbuf", sizeof(ctx->ifname)); + ctx->nr_mode = NR_REG_ALL_NIC; + ctx->nr_extra_bufs = 58; /* arbitrary number of extra bufs */ + + return niocregif(ctx, NETMAP_API_NIOCREGIF); +} + +static int +legacy_regif_extra_bufs_pipe_vale(struct TestContext *ctx) +{ + strncpy(ctx->ifname, "valeX1:Y4", sizeof(ctx->ifname)); + return legacy_regif_extra_bufs_pipe(ctx); +} + +/* Only valid after a successful port_register(). */ +static int +num_registered_rings(struct TestContext *ctx) +{ + if (ctx->nr_flags & NR_TX_RINGS_ONLY) { + return ctx->nr_tx_rings; + } + if (ctx->nr_flags & NR_RX_RINGS_ONLY) { + return ctx->nr_rx_rings; + } + + return ctx->nr_tx_rings + ctx->nr_rx_rings; +} + +static int +port_register_hwall_host(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_NIC_SW; + return port_register(ctx); +} + +static int +port_register_host(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_SW; + return port_register(ctx); +} + +static int +port_register_hwall(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ALL_NIC; + return port_register(ctx); +} + +static int +port_register_single_ring_couple(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ONE_NIC; + ctx->nr_ringid = 0; + return port_register(ctx); +} + +static int +port_register_hwall_tx(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ALL_NIC; + ctx->nr_flags |= NR_TX_RINGS_ONLY; + return port_register(ctx); +} + +static int +port_register_hwall_rx(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ALL_NIC; + ctx->nr_flags |= NR_RX_RINGS_ONLY; + return port_register(ctx); +} + +/* NETMAP_REQ_VALE_ATTACH */ +static int +vale_attach(struct TestContext *ctx) +{ + struct nmreq_vale_attach req; + struct nmreq_header hdr; + char vpname[sizeof(ctx->bdgname) + 1 + sizeof(ctx->ifname)]; + int ret; + + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + + printf("Testing NETMAP_REQ_VALE_ATTACH on '%s'\n", vpname); + nmreq_hdr_init(&hdr, vpname); + hdr.nr_reqtype = NETMAP_REQ_VALE_ATTACH; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + req.reg.nr_mem_id = ctx->nr_mem_id; + if (ctx->nr_mode == 0) { + ctx->nr_mode = NR_REG_ALL_NIC; /* default */ + } + req.reg.nr_mode = ctx->nr_mode; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, VALE_ATTACH)"); + return ret; + } + printf("nr_mem_id %u\n", req.reg.nr_mem_id); + + return ((!ctx->nr_mem_id && req.reg.nr_mem_id > 1) || + (ctx->nr_mem_id == req.reg.nr_mem_id)) && + (ctx->nr_flags == req.reg.nr_flags) + ? 0 + : -1; +} + +/* NETMAP_REQ_VALE_DETACH */ +static int +vale_detach(struct TestContext *ctx) +{ + struct nmreq_header hdr; + struct nmreq_vale_detach req; + char vpname[256]; + int ret; + + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + + printf("Testing NETMAP_REQ_VALE_DETACH on '%s'\n", vpname); + nmreq_hdr_init(&hdr, vpname); + hdr.nr_reqtype = NETMAP_REQ_VALE_DETACH; + hdr.nr_body = (uintptr_t)&req; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, VALE_DETACH)"); + return ret; + } + + return 0; +} + +/* First NETMAP_REQ_VALE_ATTACH, then NETMAP_REQ_VALE_DETACH. */ +static int +vale_attach_detach(struct TestContext *ctx) +{ + int ret; + + if ((ret = vale_attach(ctx)) != 0) { + return ret; + } + + return vale_detach(ctx); +} + +static int +vale_attach_detach_host_rings(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_NIC_SW; + return vale_attach_detach(ctx); +} + +/* First NETMAP_REQ_PORT_HDR_SET and the NETMAP_REQ_PORT_HDR_GET + * to check that we get the same value. */ +static int +port_hdr_set_and_get(struct TestContext *ctx) +{ + struct nmreq_port_hdr req; + struct nmreq_header hdr; + int ret; + + printf("Testing NETMAP_REQ_PORT_HDR_SET on '%s'\n", ctx->ifname); + + nmreq_hdr_init(&hdr, ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_PORT_HDR_SET; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + req.nr_hdr_len = ctx->nr_hdr_len; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, PORT_HDR_SET)"); + return ret; + } + + if (req.nr_hdr_len != ctx->nr_hdr_len) { + return -1; + } + + printf("Testing NETMAP_REQ_PORT_HDR_GET on '%s'\n", ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_PORT_HDR_GET; + req.nr_hdr_len = 0; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, PORT_HDR_SET)"); + return ret; + } + printf("nr_hdr_len %u\n", req.nr_hdr_len); + + return (req.nr_hdr_len == ctx->nr_hdr_len) ? 0 : -1; +} + +/* + * Possible lengths for the VirtIO network header, as specified by + * the standard: + * http://docs.oasis-open.org/virtio/virtio/v1.0/cs04/virtio-v1.0-cs04.html + */ +#define VIRTIO_NET_HDR_LEN 10 +#define VIRTIO_NET_HDR_LEN_WITH_MERGEABLE_RXBUFS 12 + +static int +vale_ephemeral_port_hdr_manipulation(struct TestContext *ctx) +{ + int ret; + + strncpy(ctx->ifname, "vale:eph0", sizeof(ctx->ifname)); + ctx->nr_mode = NR_REG_ALL_NIC; + if ((ret = port_register(ctx))) { + return ret; + } + /* Try to set and get all the acceptable values. */ + ctx->nr_hdr_len = VIRTIO_NET_HDR_LEN_WITH_MERGEABLE_RXBUFS; + if ((ret = port_hdr_set_and_get(ctx))) { + return ret; + } + ctx->nr_hdr_len = 0; + if ((ret = port_hdr_set_and_get(ctx))) { + return ret; + } + ctx->nr_hdr_len = VIRTIO_NET_HDR_LEN; + if ((ret = port_hdr_set_and_get(ctx))) { + return ret; + } + return 0; +} + +static int +vale_persistent_port(struct TestContext *ctx) +{ + struct nmreq_vale_newif req; + struct nmreq_header hdr; + int result; + int ret; + + strncpy(ctx->ifname, "per4", sizeof(ctx->ifname)); + + printf("Testing NETMAP_REQ_VALE_NEWIF on '%s'\n", ctx->ifname); + + nmreq_hdr_init(&hdr, ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_VALE_NEWIF; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + req.nr_mem_id = ctx->nr_mem_id; + req.nr_tx_slots = ctx->nr_tx_slots; + req.nr_rx_slots = ctx->nr_rx_slots; + req.nr_tx_rings = ctx->nr_tx_rings; + req.nr_rx_rings = ctx->nr_rx_rings; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, VALE_NEWIF)"); + return ret; + } + + /* Attach the persistent VALE port to a switch and then detach. */ + result = vale_attach_detach(ctx); + + printf("Testing NETMAP_REQ_VALE_DELIF on '%s'\n", ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_VALE_DELIF; + hdr.nr_body = (uintptr_t)NULL; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, VALE_NEWIF)"); + if (result == 0) { + result = ret; + } + } + + return result; +} + +/* Single NETMAP_REQ_POOLS_INFO_GET. */ +static int +pools_info_get(struct TestContext *ctx) +{ + struct nmreq_pools_info req; + struct nmreq_header hdr; + int ret; + + printf("Testing NETMAP_REQ_POOLS_INFO_GET on '%s'\n", ctx->ifname); + + nmreq_hdr_init(&hdr, ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_POOLS_INFO_GET; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + req.nr_mem_id = ctx->nr_mem_id; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, POOLS_INFO_GET)"); + return ret; + } + printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_mem_id %u\n", req.nr_mem_id); + printf("nr_if_pool_offset 0x%lx\n", req.nr_if_pool_offset); + printf("nr_if_pool_objtotal %u\n", req.nr_if_pool_objtotal); + printf("nr_if_pool_objsize %u\n", req.nr_if_pool_objsize); + printf("nr_ring_pool_offset 0x%lx\n", req.nr_if_pool_offset); + printf("nr_ring_pool_objtotal %u\n", req.nr_ring_pool_objtotal); + printf("nr_ring_pool_objsize %u\n", req.nr_ring_pool_objsize); + printf("nr_buf_pool_offset 0x%lx\n", req.nr_buf_pool_offset); + printf("nr_buf_pool_objtotal %u\n", req.nr_buf_pool_objtotal); + printf("nr_buf_pool_objsize %u\n", req.nr_buf_pool_objsize); + + return req.nr_memsize && req.nr_if_pool_objtotal && + req.nr_if_pool_objsize && + req.nr_ring_pool_objtotal && + req.nr_ring_pool_objsize && + req.nr_buf_pool_objtotal && + req.nr_buf_pool_objsize + ? 0 + : -1; +} + +static int +pools_info_get_and_register(struct TestContext *ctx) +{ + int ret; + + /* Check that we can get pools info before we register + * a netmap interface. */ + ret = pools_info_get(ctx); + if (ret != 0) { + return ret; + } + + ctx->nr_mode = NR_REG_ONE_NIC; + ret = port_register(ctx); + if (ret != 0) { + return ret; + } + ctx->nr_mem_id = 1; + + /* Check that we can get pools info also after we register. */ + return pools_info_get(ctx); +} + +static int +pools_info_get_empty_ifname(struct TestContext *ctx) +{ + strncpy(ctx->ifname, "", sizeof(ctx->ifname)); + return pools_info_get(ctx) != 0 ? 0 : -1; +} + +static int +pipe_master(struct TestContext *ctx) +{ + strncat(ctx->ifname, "{pipeid1", sizeof(ctx->ifname)); + ctx->nr_mode = NR_REG_NIC_SW; + + if (port_register(ctx) == 0) { + printf("pipes should not accept NR_REG_NIC_SW\n"); + return -1; + } + ctx->nr_mode = NR_REG_ALL_NIC; + + return port_register(ctx); +} + +static int +pipe_slave(struct TestContext *ctx) +{ + strncat(ctx->ifname, "}pipeid2", sizeof(ctx->ifname)); + ctx->nr_mode = NR_REG_ALL_NIC; + + return port_register(ctx); +} + +/* Test PORT_INFO_GET and POOLS_INFO_GET on a pipe. This is useful to test the + * registration request used internall by netmap. */ +static int +pipe_port_info_get(struct TestContext *ctx) +{ + strncat(ctx->ifname, "}pipeid3", sizeof(ctx->ifname)); + + return port_info_get(ctx); +} + +static int +pipe_pools_info_get(struct TestContext *ctx) +{ + strncat(ctx->ifname, "{xid", sizeof(ctx->ifname)); + + return pools_info_get(ctx); +} + +/* NETMAP_REQ_VALE_POLLING_ENABLE */ +static int +vale_polling_enable(struct TestContext *ctx) +{ + struct nmreq_vale_polling req; + struct nmreq_header hdr; + char vpname[256]; + int ret; + + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + printf("Testing NETMAP_REQ_VALE_POLLING_ENABLE on '%s'\n", vpname); + + nmreq_hdr_init(&hdr, vpname); + hdr.nr_reqtype = NETMAP_REQ_VALE_POLLING_ENABLE; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + req.nr_mode = ctx->nr_mode; + req.nr_first_cpu_id = ctx->nr_first_cpu_id; + req.nr_num_polling_cpus = ctx->nr_num_polling_cpus; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, VALE_POLLING_ENABLE)"); + return ret; + } + + return (req.nr_mode == ctx->nr_mode && + req.nr_first_cpu_id == ctx->nr_first_cpu_id && + req.nr_num_polling_cpus == ctx->nr_num_polling_cpus) + ? 0 + : -1; +} + +/* NETMAP_REQ_VALE_POLLING_DISABLE */ +static int +vale_polling_disable(struct TestContext *ctx) +{ + struct nmreq_vale_polling req; + struct nmreq_header hdr; + char vpname[256]; + int ret; + + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + printf("Testing NETMAP_REQ_VALE_POLLING_DISABLE on '%s'\n", vpname); + + nmreq_hdr_init(&hdr, vpname); + hdr.nr_reqtype = NETMAP_REQ_VALE_POLLING_DISABLE; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, VALE_POLLING_DISABLE)"); + return ret; + } + + return 0; +} + +static int +vale_polling_enable_disable(struct TestContext *ctx) +{ + int ret = 0; + + if ((ret = vale_attach(ctx)) != 0) { + return ret; + } + + ctx->nr_mode = NETMAP_POLLING_MODE_SINGLE_CPU; + ctx->nr_num_polling_cpus = 1; + ctx->nr_first_cpu_id = 0; + if ((ret = vale_polling_enable(ctx))) { + vale_detach(ctx); +#ifdef __FreeBSD__ + /* NETMAP_REQ_VALE_POLLING_DISABLE is disabled on FreeBSD, + * because it is currently broken. We are happy to see that + * it fails. */ + return 0; +#endif + return ret; + } + + if ((ret = vale_polling_disable(ctx))) { + vale_detach(ctx); + return ret; + } + + return vale_detach(ctx); +} + +static void +push_option(struct nmreq_option *opt, struct TestContext *ctx) +{ + opt->nro_next = (uintptr_t)ctx->nr_opt; + ctx->nr_opt = opt; +} + +static void +clear_options(struct TestContext *ctx) +{ + ctx->nr_opt = NULL; +} + +static int +checkoption(struct nmreq_option *opt, struct nmreq_option *exp) +{ + if (opt->nro_next != exp->nro_next) { + printf("nro_next %p expected %p\n", + (void *)(uintptr_t)opt->nro_next, + (void *)(uintptr_t)exp->nro_next); + return -1; + } + if (opt->nro_reqtype != exp->nro_reqtype) { + printf("nro_reqtype %u expected %u\n", opt->nro_reqtype, + exp->nro_reqtype); + return -1; + } + if (opt->nro_status != exp->nro_status) { + printf("nro_status %u expected %u\n", opt->nro_status, + exp->nro_status); + return -1; + } + return 0; +} + +static int +unsupported_option(struct TestContext *ctx) +{ + struct nmreq_option opt, save; + + printf("Testing unsupported option on %s\n", ctx->ifname); + + memset(&opt, 0, sizeof(opt)); + opt.nro_reqtype = 1234; + push_option(&opt, ctx); + save = opt; + + if (port_register_hwall(ctx) >= 0) + return -1; + + clear_options(ctx); + save.nro_status = EOPNOTSUPP; + return checkoption(&opt, &save); +} + +static int +infinite_options(struct TestContext *ctx) +{ + struct nmreq_option opt; + + printf("Testing infinite list of options on %s\n", ctx->ifname); + + opt.nro_reqtype = 1234; + push_option(&opt, ctx); + opt.nro_next = (uintptr_t)&opt; + if (port_register_hwall(ctx) >= 0) + return -1; + clear_options(ctx); + return (errno == EMSGSIZE ? 0 : -1); +} + +#ifdef CONFIG_NETMAP_EXTMEM +int +change_param(const char *pname, unsigned long newv, unsigned long *poldv) +{ +#ifdef __linux__ + char param[256] = "/sys/module/netmap/parameters/"; + unsigned long oldv; + FILE *f; + + strncat(param, pname, sizeof(param) - 1); + + f = fopen(param, "r+"); + if (f == NULL) { + perror(param); + return -1; + } + if (fscanf(f, "%ld", &oldv) != 1) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Dec 31 12:07:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 842741431A70; Mon, 31 Dec 2018 12:07:18 +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 D343E96931; Mon, 31 Dec 2018 12:07:17 +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 9EB0AA406; Mon, 31 Dec 2018 12:07:17 +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 wBVC7Hfr098278; Mon, 31 Dec 2018 12:07:17 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVC7HwL098277; Mon, 31 Dec 2018 12:07:17 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812311207.wBVC7HwL098277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 31 Dec 2018 12:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342650 - head/tests/sys/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tests/sys/netmap X-SVN-Commit-Revision: 342650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D343E96931 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)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,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, 31 Dec 2018 12:07:18 -0000 Author: vmaffione Date: Mon Dec 31 12:07:17 2018 New Revision: 342650 URL: https://svnweb.freebsd.org/changeset/base/342650 Log: netmap: fix warnings on unit tests Fix some printf() format string warnings raised for ctrl-api-test.c on some architectures. MFC after: 1 week Sponsored by: Sunny Valley Networks Modified: head/tests/sys/netmap/ctrl-api-test.c Modified: head/tests/sys/netmap/ctrl-api-test.c ============================================================================== --- head/tests/sys/netmap/ctrl-api-test.c Mon Dec 31 11:17:58 2018 (r342649) +++ head/tests/sys/netmap/ctrl-api-test.c Mon Dec 31 12:07:17 2018 (r342650) @@ -183,7 +183,7 @@ port_info_get(struct TestContext *ctx) perror("ioctl(/dev/netmap, NIOCCTRL, PORT_INFO_GET)"); return ret; } - printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_memsize %llu\n", (unsigned long long)req.nr_memsize); printf("nr_tx_slots %u\n", req.nr_tx_slots); printf("nr_rx_slots %u\n", req.nr_rx_slots); printf("nr_tx_rings %u\n", req.nr_tx_rings); @@ -216,8 +216,9 @@ port_register(struct TestContext *ctx) int ret; printf("Testing NETMAP_REQ_REGISTER(mode=%d,ringid=%d," - "flags=0x%lx) on '%s'\n", - ctx->nr_mode, ctx->nr_ringid, ctx->nr_flags, ctx->ifname); + "flags=0x%llx) on '%s'\n", + ctx->nr_mode, ctx->nr_ringid, (unsigned long long)ctx->nr_flags, + ctx->ifname); nmreq_hdr_init(&hdr, ctx->ifname); hdr.nr_reqtype = NETMAP_REQ_REGISTER; @@ -238,8 +239,8 @@ port_register(struct TestContext *ctx) perror("ioctl(/dev/netmap, NIOCCTRL, REGISTER)"); return ret; } - printf("nr_offset 0x%lx\n", req.nr_offset); - printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_offset 0x%llx\n", (unsigned long long)req.nr_offset); + printf("nr_memsize %llu\n", (unsigned long long)req.nr_memsize); printf("nr_tx_slots %u\n", req.nr_tx_slots); printf("nr_rx_slots %u\n", req.nr_rx_slots); printf("nr_tx_rings %u\n", req.nr_tx_rings); @@ -687,15 +688,18 @@ pools_info_get(struct TestContext *ctx) perror("ioctl(/dev/netmap, NIOCCTRL, POOLS_INFO_GET)"); return ret; } - printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_memsize %llu\n", (unsigned long long)req.nr_memsize); printf("nr_mem_id %u\n", req.nr_mem_id); - printf("nr_if_pool_offset 0x%lx\n", req.nr_if_pool_offset); + printf("nr_if_pool_offset 0x%llx\n", + (unsigned long long)req.nr_if_pool_offset); printf("nr_if_pool_objtotal %u\n", req.nr_if_pool_objtotal); printf("nr_if_pool_objsize %u\n", req.nr_if_pool_objsize); - printf("nr_ring_pool_offset 0x%lx\n", req.nr_if_pool_offset); + printf("nr_ring_pool_offset 0x%llx\n", + (unsigned long long)req.nr_if_pool_offset); printf("nr_ring_pool_objtotal %u\n", req.nr_ring_pool_objtotal); printf("nr_ring_pool_objsize %u\n", req.nr_ring_pool_objsize); - printf("nr_buf_pool_offset 0x%lx\n", req.nr_buf_pool_offset); + printf("nr_buf_pool_offset 0x%llx\n", + (unsigned long long)req.nr_buf_pool_offset); printf("nr_buf_pool_objtotal %u\n", req.nr_buf_pool_objtotal); printf("nr_buf_pool_objsize %u\n", req.nr_buf_pool_objsize); From owner-svn-src-all@freebsd.org Mon Dec 31 15:43:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 362EF14385AD; Mon, 31 Dec 2018 15:43:07 +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 CAF817133F; Mon, 31 Dec 2018 15:43:06 +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 B7ACACAE4; Mon, 31 Dec 2018 15:43:06 +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 wBVFh6ZA017937; Mon, 31 Dec 2018 15:43:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVFh6JT017935; Mon, 31 Dec 2018 15:43:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201812311543.wBVFh6JT017935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 31 Dec 2018 15:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342651 - in head/lib/msun: ld128 src X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/lib/msun: ld128 src X-SVN-Commit-Revision: 342651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CAF817133F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2018 15:43:07 -0000 Author: pfg Date: Mon Dec 31 15:43:06 2018 New Revision: 342651 URL: https://svnweb.freebsd.org/changeset/base/342651 Log: msun: Fix some old typos. Seen in a posting from July 27 by "CM Graff" in musl-libc. Modified: head/lib/msun/ld128/e_powl.c head/lib/msun/src/k_rem_pio2.c Modified: head/lib/msun/ld128/e_powl.c ============================================================================== --- head/lib/msun/ld128/e_powl.c Mon Dec 31 12:07:17 2018 (r342650) +++ head/lib/msun/ld128/e_powl.c Mon Dec 31 15:43:06 2018 (r342651) @@ -32,7 +32,7 @@ * 1. Compute and return log2(x) in two pieces: * log2(x) = w1 + w2, * where w1 has 113-53 = 60 bit trailing zeros. - * 2. Perform y*log2(x) = n+y' by simulating muti-precision + * 2. Perform y*log2(x) = n+y' by simulating multi-precision * arithmetic, where |y'|<=0.5. * 3. Return x**y = 2**n*exp(y'*log2) * Modified: head/lib/msun/src/k_rem_pio2.c ============================================================================== --- head/lib/msun/src/k_rem_pio2.c Mon Dec 31 12:07:17 2018 (r342650) +++ head/lib/msun/src/k_rem_pio2.c Mon Dec 31 15:43:06 2018 (r342651) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); * 64-bit precision 2 * 113-bit precision 3 * The actual value is the sum of them. Thus for 113-bit - * precison, one may have to do something like: + * precision, one may have to do something like: * * long double t,w,r_head, r_tail; * t = (long double)y[2] + (long double)y[1]; From owner-svn-src-all@freebsd.org Mon Dec 31 16:01:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 072CA1438AA7; Mon, 31 Dec 2018 16:01:23 +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 A0CB471B11; Mon, 31 Dec 2018 16:01:22 +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 947C3CCE7; Mon, 31 Dec 2018 16:01:22 +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 wBVG1Mfh024423; Mon, 31 Dec 2018 16:01:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVG1MKi024422; Mon, 31 Dec 2018 16:01:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201812311601.wBVG1MKi024422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Dec 2018 16:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342652 - head/sys/arm/ti X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti X-SVN-Commit-Revision: 342652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0CB471B11 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 31 Dec 2018 16:01:23 -0000 Author: ian Date: Mon Dec 31 16:01:22 2018 New Revision: 342652 URL: https://svnweb.freebsd.org/changeset/base/342652 Log: Support the SPI mode and bus clock frequency parameters set by the devices requesting SPI transfers. Reported by: SAITOU Toshihide Modified: head/sys/arm/ti/ti_spi.c Modified: head/sys/arm/ti/ti_spi.c ============================================================================== --- head/sys/arm/ti/ti_spi.c Mon Dec 31 15:43:06 2018 (r342651) +++ head/sys/arm/ti/ti_spi.c Mon Dec 31 16:01:22 2018 (r342652) @@ -446,7 +446,7 @@ ti_spi_transfer(device_t dev, device_t child, struct s { int err; struct ti_spi_softc *sc; - uint32_t reg, cs; + uint32_t clockhz, cs, mode, reg; sc = device_get_softc(dev); @@ -457,6 +457,8 @@ ti_spi_transfer(device_t dev, device_t child, struct s /* Get the proper chip select for this child. */ spibus_get_cs(child, &cs); + spibus_get_clock(child, &clockhz); + spibus_get_mode(child, &mode); cs &= ~SPIBUS_CS_HIGH; @@ -466,6 +468,13 @@ ti_spi_transfer(device_t dev, device_t child, struct s return (EINVAL); } + if (mode > 3) + { + device_printf(dev, "Invalid mode %d requested by %s\n", mode, + device_get_nameunit(child)); + return (EINVAL); + } + TI_SPI_LOCK(sc); /* If the controller is in use wait until it is available. */ @@ -487,8 +496,8 @@ ti_spi_transfer(device_t dev, device_t child, struct s /* Disable FIFO for now. */ sc->sc_fifolvl = 1; - /* Use a safe clock - 500kHz. */ - ti_spi_set_clock(sc, sc->sc_cs, 500000); + /* Set the bus frequency. */ + ti_spi_set_clock(sc, sc->sc_cs, clockhz); /* Disable the FIFO. */ TI_SPI_WRITE(sc, MCSPI_XFERLEVEL, 0); @@ -500,6 +509,7 @@ ti_spi_transfer(device_t dev, device_t child, struct s MCSPI_CONF_DPE1 | MCSPI_CONF_DPE0 | MCSPI_CONF_DMAR | MCSPI_CONF_DMAW | MCSPI_CONF_EPOL); reg |= MCSPI_CONF_DPE0 | MCSPI_CONF_EPOL | MCSPI_CONF_WL8BITS; + reg |= mode; /* POL and PHA are the low bits, we can just OR-in mode */ TI_SPI_WRITE(sc, MCSPI_CONF_CH(sc->sc_cs), reg); #if 0 From owner-svn-src-all@freebsd.org Mon Dec 31 18:05:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0D72143B7D5; Mon, 31 Dec 2018 18:05: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 5A94176098; Mon, 31 Dec 2018 18:05: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 4A67BE264; Mon, 31 Dec 2018 18:05: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 wBVI5nlX000960; Mon, 31 Dec 2018 18:05:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVI5nMb000959; Mon, 31 Dec 2018 18:05:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812311805.wBVI5nMb000959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 31 Dec 2018 18:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342653 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 342653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A94176098 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)[-0.998,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, 31 Dec 2018 18:05:50 -0000 Author: kib Date: Mon Dec 31 18:05:48 2018 New Revision: 342653 URL: https://svnweb.freebsd.org/changeset/base/342653 Log: Update comments: paging is initialized in pmap_cold(). MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Dec 31 16:01:22 2018 (r342652) +++ head/sys/i386/i386/pmap.c Mon Dec 31 18:05:48 2018 (r342653) @@ -569,9 +569,9 @@ pmap_cold(void) /* * Bootstrap the system enough to run with virtual memory. * - * On the i386 this is called after mapping has already been enabled - * in locore.s with the page table created in pmap_cold(), - * and just syncs the pmap module with what has already been done. + * On the i386 this is called after pmap_cold() created intial + * kernel page table and enabled paging, and just syncs the pmap + * module with what has already been done. */ void pmap_bootstrap(vm_paddr_t firstaddr) @@ -594,11 +594,12 @@ pmap_bootstrap(vm_paddr_t firstaddr) vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt)); /* - * Initialize the first available kernel virtual address. However, - * using "firstaddr" may waste a few pages of the kernel virtual - * address space, because locore may not have mapped every physical - * page that it allocated. Preferably, locore would provide a first - * unused virtual address in addition to "firstaddr". + * Initialize the first available kernel virtual address. + * However, using "firstaddr" may waste a few pages of the + * kernel virtual address space, because pmap_cold() may not + * have mapped every physical page that it allocated. + * Preferably, pmap_cold() would provide a first unused + * virtual address in addition to "firstaddr". */ virtual_avail = (vm_offset_t)firstaddr; virtual_end = VM_MAX_KERNEL_ADDRESS; @@ -665,7 +666,7 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* * KPTmap is used by pmap_kextract(). * - * KPTmap is first initialized by locore. However, that initial + * KPTmap is first initialized by pmap_cold(). However, that initial * KPTmap can only support NKPT page table pages. Here, a larger * KPTmap is created that can support KVA_PAGES page table pages. */ From owner-svn-src-all@freebsd.org Mon Dec 31 18:11:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7858F143BADE; Mon, 31 Dec 2018 18:11:05 +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 1BF1676572; Mon, 31 Dec 2018 18:11:05 +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 F3CBEE290; Mon, 31 Dec 2018 18:11:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVIB4Cf002023; Mon, 31 Dec 2018 18:11:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVIB4AA002022; Mon, 31 Dec 2018 18:11:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812311811.wBVIB4AA002022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 31 Dec 2018 18:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342654 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 342654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1BF1676572 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 31 Dec 2018 18:11:05 -0000 Author: kib Date: Mon Dec 31 18:11:04 2018 New Revision: 342654 URL: https://svnweb.freebsd.org/changeset/base/342654 Log: More references to pmap_cold(). MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/include/pmap.h Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Mon Dec 31 18:05:48 2018 (r342653) +++ head/sys/i386/include/pmap.h Mon Dec 31 18:11:04 2018 (r342654) @@ -125,7 +125,7 @@ /* * The initial number of kernel page table pages that are constructed - * by locore must be sufficient to map vm_page_array. That number can + * by pmap_cold() must be sufficient to map vm_page_array[]. That number can * be calculated as follows: * max_phys / PAGE_SIZE * sizeof(struct vm_page) / NBPDR * PAE: max_phys 16G, sizeof(vm_page) 76, NBPDR 2M, 152 page table pages. @@ -228,7 +228,7 @@ extern pd_entry_t *IdlePTD; /* physical address of "Id * a kernel page table page after the corresponding virtual addresses have * been promoted to a 2/4MB page mapping. * - * KPTmap is first initialized by locore to support just NPKT page table + * KPTmap is first initialized by pmap_cold() to support just NPKT page table * pages. Later, it is reinitialized by pmap_bootstrap() to allow for * expansion of the kernel page table. */ From owner-svn-src-all@freebsd.org Mon Dec 31 21:55:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F7FC141B625; Mon, 31 Dec 2018 21:55:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A95F786BF8; Mon, 31 Dec 2018 21:55:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D666189C8; Mon, 31 Dec 2018 21:55:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVLtD1M026242; Mon, 31 Dec 2018 21:55:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVLtDvf026241; Mon, 31 Dec 2018 21:55:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201812312155.wBVLtDvf026241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 31 Dec 2018 21:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342655 - stable/12/sys/dev/cxgbe/tom X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 342655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A95F786BF8 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)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2018 21:55:14 -0000 Author: jhb Date: Mon Dec 31 21:55:12 2018 New Revision: 342655 URL: https://svnweb.freebsd.org/changeset/base/342655 Log: MFC 340465: Use sbsndptr_adv() instead of sbsndptr() for TOE TLS. For TOE TLS, we just want to advance the send pointer to skip over the record just sent to the TOE. The recently added sbsndptr_adv() is sufficient for that and is cheaper. Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- stable/12/sys/dev/cxgbe/tom/t4_tls.c Mon Dec 31 18:11:04 2018 (r342654) +++ stable/12/sys/dev/cxgbe/tom/t4_tls.c Mon Dec 31 21:55:12 2018 (r342655) @@ -1368,7 +1368,7 @@ t4_push_tls_records(struct adapter *sc, struct toepcb tp->snd_max += plen; SOCKBUF_LOCK(sb); - sbsndptr(sb, tls_ofld->sb_off, plen, &sndptroff); + sbsndptr_adv(sb, sb->sb_sndptr, plen); tls_ofld->sb_off += plen; SOCKBUF_UNLOCK(sb); From owner-svn-src-all@freebsd.org Mon Dec 31 22:09:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77159141BA28; Mon, 31 Dec 2018 22:09:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF348722E; Mon, 31 Dec 2018 22:09:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0066D18B87; Mon, 31 Dec 2018 22:09:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVM99Cp031759; Mon, 31 Dec 2018 22:09:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVM997N031756; Mon, 31 Dec 2018 22:09:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201812312209.wBVM997N031756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 31 Dec 2018 22:09: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: r342656 - in stable: 11/sys/x86/include 11/sys/x86/x86 11/sys/x86/xen 12/sys/x86/include 12/sys/x86/x86 12/sys/x86/xen X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/x86/include 11/sys/x86/x86 11/sys/x86/xen 12/sys/x86/include 12/sys/x86/x86 12/sys/x86/xen X-SVN-Commit-Revision: 342656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1BF348722E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 31 Dec 2018 22:09:10 -0000 Author: jhb Date: Mon Dec 31 22:09:08 2018 New Revision: 342656 URL: https://svnweb.freebsd.org/changeset/base/342656 Log: MFC 340460: Convert the number of MSI IRQs on x86 from a constant to a tunable. The number of MSI IRQs still defaults to 512, but it can now be changed at boot time via the machdep.num_msi_irqs tunable. Relnotes: yes Modified: stable/12/sys/x86/include/intr_machdep.h stable/12/sys/x86/x86/msi.c stable/12/sys/x86/xen/xen_intr.c stable/12/sys/x86/xen/xen_msi.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/x86/include/intr_machdep.h stable/11/sys/x86/x86/msi.c stable/11/sys/x86/xen/xen_intr.c stable/11/sys/x86/xen/xen_msi.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/x86/include/intr_machdep.h ============================================================================== --- stable/12/sys/x86/include/intr_machdep.h Mon Dec 31 21:55:12 2018 (r342655) +++ stable/12/sys/x86/include/intr_machdep.h Mon Dec 31 22:09:08 2018 (r342656) @@ -58,11 +58,11 @@ * the minimum IRQ value for MSI interrupts to attempt to leave 255 * unused since 255 is used in PCI to indicate an invalid INTx IRQ. */ -#define NUM_MSI_INTS 512 #define MINIMUM_MSI_INT 256 extern u_int first_msi_irq; extern u_int num_io_irqs; +extern u_int num_msi_irqs; /* * Default base address for MSI messages on x86 platforms. Modified: stable/12/sys/x86/x86/msi.c ============================================================================== --- stable/12/sys/x86/x86/msi.c Mon Dec 31 21:55:12 2018 (r342655) +++ stable/12/sys/x86/x86/msi.c Mon Dec 31 22:09:08 2018 (r342656) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -153,6 +154,10 @@ struct pic msi_pic = { u_int first_msi_irq; +u_int num_msi_irqs = 512; +SYSCTL_UINT(_machdep, OID_AUTO, num_msi_irqs, CTLFLAG_RDTUN, &num_msi_irqs, 0, + "Number of IRQs reserved for MSI and MSI-X interrupts"); + #ifdef SMP /** * Xen hypervisors prior to 4.6.0 do not properly handle updates to @@ -331,8 +336,13 @@ msi_init(void) } #endif + if (num_msi_irqs == 0) + return; + first_msi_irq = max(MINIMUM_MSI_INT, num_io_irqs); - num_io_irqs = first_msi_irq + NUM_MSI_INTS; + if (num_msi_irqs > UINT_MAX - first_msi_irq) + panic("num_msi_irq too high"); + num_io_irqs = first_msi_irq + num_msi_irqs; msi_enabled = 1; intr_register_pic(&msi_pic); @@ -346,7 +356,7 @@ msi_create_source(void) u_int irq; mtx_lock(&msi_lock); - if (msi_last_irq >= NUM_MSI_INTS) { + if (msi_last_irq >= num_msi_irqs) { mtx_unlock(&msi_lock); return; } @@ -390,7 +400,7 @@ again: /* Try to find 'count' free IRQs. */ cnt = 0; - for (i = first_msi_irq; i < first_msi_irq + NUM_MSI_INTS; i++) { + for (i = first_msi_irq; i < first_msi_irq + num_msi_irqs; i++) { msi = (struct msi_intsrc *)intr_lookup_source(i); /* End of allocated sources, so break. */ @@ -409,7 +419,7 @@ again: /* Do we need to create some new sources? */ if (cnt < count) { /* If we would exceed the max, give up. */ - if (i + (count - cnt) > first_msi_irq + NUM_MSI_INTS) { + if (i + (count - cnt) > first_msi_irq + num_msi_irqs) { mtx_unlock(&msi_lock); free(mirqs, M_MSI); return (ENXIO); @@ -585,7 +595,7 @@ msi_map(int irq, uint64_t *addr, uint32_t *data) #ifdef ACPI_DMAR if (!msi->msi_msix) { for (k = msi->msi_count - 1, i = first_msi_irq; k > 0 && - i < first_msi_irq + NUM_MSI_INTS; i++) { + i < first_msi_irq + num_msi_irqs; i++) { if (i == msi->msi_irq) continue; msi1 = (struct msi_intsrc *)intr_lookup_source(i); @@ -635,7 +645,7 @@ again: mtx_lock(&msi_lock); /* Find a free IRQ. */ - for (i = first_msi_irq; i < first_msi_irq + NUM_MSI_INTS; i++) { + for (i = first_msi_irq; i < first_msi_irq + num_msi_irqs; i++) { msi = (struct msi_intsrc *)intr_lookup_source(i); /* End of allocated sources, so break. */ @@ -648,7 +658,7 @@ again: } /* Are all IRQs in use? */ - if (i == first_msi_irq + NUM_MSI_INTS) { + if (i == first_msi_irq + num_msi_irqs) { mtx_unlock(&msi_lock); return (ENXIO); } Modified: stable/12/sys/x86/xen/xen_intr.c ============================================================================== --- stable/12/sys/x86/xen/xen_intr.c Mon Dec 31 21:55:12 2018 (r342655) +++ stable/12/sys/x86/xen/xen_intr.c Mon Dec 31 22:09:08 2018 (r342656) @@ -690,6 +690,8 @@ void xen_intr_alloc_irqs(void) { + if (num_io_irqs > UINT_MAX - NR_EVENT_CHANNELS) + panic("IRQ allocation overflow (num_msi_irqs too high?)"); first_evtchn_irq = num_io_irqs; num_io_irqs += NR_EVENT_CHANNELS; } Modified: stable/12/sys/x86/xen/xen_msi.c ============================================================================== --- stable/12/sys/x86/xen/xen_msi.c Mon Dec 31 21:55:12 2018 (r342655) +++ stable/12/sys/x86/xen/xen_msi.c Mon Dec 31 22:09:08 2018 (r342656) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -57,7 +58,9 @@ xen_msi_init(void) MPASS(num_io_irqs > 0); first_msi_irq = min(MINIMUM_MSI_INT, num_io_irqs); - num_io_irqs = first_msi_irq + NUM_MSI_INTS; + if (num_msi_irqs > UINT_MAX - first_msi_irq) + panic("num_msi_irq too high"); + num_io_irqs = first_msi_irq + num_msi_irqs; mtx_init(&msi_lock, "msi", NULL, MTX_DEF); } @@ -73,7 +76,7 @@ xen_msi_alloc(device_t dev, int count, int maxcount, i mtx_lock(&msi_lock); /* If we would exceed the max, give up. */ - if ((msi_last_irq + count) > NUM_MSI_INTS) { + if (msi_last_irq + count > num_msi_irqs) { mtx_unlock(&msi_lock); return (ENXIO); } From owner-svn-src-all@freebsd.org Mon Dec 31 22:09:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42805141BA2C; Mon, 31 Dec 2018 22:09:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD5828722F; Mon, 31 Dec 2018 22:09:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0DB818B88; Mon, 31 Dec 2018 22:09:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVM9A7E031769; Mon, 31 Dec 2018 22:09:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVM9A4C031766; Mon, 31 Dec 2018 22:09:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201812312209.wBVM9A4C031766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 31 Dec 2018 22:09: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: r342656 - in stable: 11/sys/x86/include 11/sys/x86/x86 11/sys/x86/xen 12/sys/x86/include 12/sys/x86/x86 12/sys/x86/xen X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/x86/include 11/sys/x86/x86 11/sys/x86/xen 12/sys/x86/include 12/sys/x86/x86 12/sys/x86/xen X-SVN-Commit-Revision: 342656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD5828722F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 31 Dec 2018 22:09:11 -0000 Author: jhb Date: Mon Dec 31 22:09:08 2018 New Revision: 342656 URL: https://svnweb.freebsd.org/changeset/base/342656 Log: MFC 340460: Convert the number of MSI IRQs on x86 from a constant to a tunable. The number of MSI IRQs still defaults to 512, but it can now be changed at boot time via the machdep.num_msi_irqs tunable. Relnotes: yes Modified: stable/11/sys/x86/include/intr_machdep.h stable/11/sys/x86/x86/msi.c stable/11/sys/x86/xen/xen_intr.c stable/11/sys/x86/xen/xen_msi.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/x86/include/intr_machdep.h stable/12/sys/x86/x86/msi.c stable/12/sys/x86/xen/xen_intr.c stable/12/sys/x86/xen/xen_msi.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/x86/include/intr_machdep.h ============================================================================== --- stable/11/sys/x86/include/intr_machdep.h Mon Dec 31 21:55:12 2018 (r342655) +++ stable/11/sys/x86/include/intr_machdep.h Mon Dec 31 22:09:08 2018 (r342656) @@ -56,11 +56,11 @@ * the minimum IRQ value for MSI interrupts to attempt to leave 255 * unused since 255 is used in PCI to indicate an invalid INTx IRQ. */ -#define NUM_MSI_INTS 512 #define MINIMUM_MSI_INT 256 extern u_int first_msi_irq; extern u_int num_io_irqs; +extern u_int num_msi_irqs; /* * Default base address for MSI messages on x86 platforms. Modified: stable/11/sys/x86/x86/msi.c ============================================================================== --- stable/11/sys/x86/x86/msi.c Mon Dec 31 21:55:12 2018 (r342655) +++ stable/11/sys/x86/x86/msi.c Mon Dec 31 22:09:08 2018 (r342656) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -151,6 +152,10 @@ struct pic msi_pic = { u_int first_msi_irq; +u_int num_msi_irqs = 512; +SYSCTL_UINT(_machdep, OID_AUTO, num_msi_irqs, CTLFLAG_RDTUN, &num_msi_irqs, 0, + "Number of IRQs reserved for MSI and MSI-X interrupts"); + #ifdef SMP /** * Xen hypervisors prior to 4.6.0 do not properly handle updates to @@ -329,8 +334,13 @@ msi_init(void) } #endif + if (num_msi_irqs == 0) + return; + first_msi_irq = max(MINIMUM_MSI_INT, num_io_irqs); - num_io_irqs = first_msi_irq + NUM_MSI_INTS; + if (num_msi_irqs > UINT_MAX - first_msi_irq) + panic("num_msi_irq too high"); + num_io_irqs = first_msi_irq + num_msi_irqs; msi_enabled = 1; intr_register_pic(&msi_pic); @@ -344,7 +354,7 @@ msi_create_source(void) u_int irq; mtx_lock(&msi_lock); - if (msi_last_irq >= NUM_MSI_INTS) { + if (msi_last_irq >= num_msi_irqs) { mtx_unlock(&msi_lock); return; } @@ -385,7 +395,7 @@ again: /* Try to find 'count' free IRQs. */ cnt = 0; - for (i = first_msi_irq; i < first_msi_irq + NUM_MSI_INTS; i++) { + for (i = first_msi_irq; i < first_msi_irq + num_msi_irqs; i++) { msi = (struct msi_intsrc *)intr_lookup_source(i); /* End of allocated sources, so break. */ @@ -404,7 +414,7 @@ again: /* Do we need to create some new sources? */ if (cnt < count) { /* If we would exceed the max, give up. */ - if (i + (count - cnt) > first_msi_irq + NUM_MSI_INTS) { + if (i + (count - cnt) > first_msi_irq + num_msi_irqs) { mtx_unlock(&msi_lock); free(mirqs, M_MSI); return (ENXIO); @@ -580,7 +590,7 @@ msi_map(int irq, uint64_t *addr, uint32_t *data) #ifdef ACPI_DMAR if (!msi->msi_msix) { for (k = msi->msi_count - 1, i = first_msi_irq; k > 0 && - i < first_msi_irq + NUM_MSI_INTS; i++) { + i < first_msi_irq + num_msi_irqs; i++) { if (i == msi->msi_irq) continue; msi1 = (struct msi_intsrc *)intr_lookup_source(i); @@ -627,7 +637,7 @@ again: mtx_lock(&msi_lock); /* Find a free IRQ. */ - for (i = first_msi_irq; i < first_msi_irq + NUM_MSI_INTS; i++) { + for (i = first_msi_irq; i < first_msi_irq + num_msi_irqs; i++) { msi = (struct msi_intsrc *)intr_lookup_source(i); /* End of allocated sources, so break. */ @@ -640,7 +650,7 @@ again: } /* Are all IRQs in use? */ - if (i == first_msi_irq + NUM_MSI_INTS) { + if (i == first_msi_irq + num_msi_irqs) { mtx_unlock(&msi_lock); return (ENXIO); } Modified: stable/11/sys/x86/xen/xen_intr.c ============================================================================== --- stable/11/sys/x86/xen/xen_intr.c Mon Dec 31 21:55:12 2018 (r342655) +++ stable/11/sys/x86/xen/xen_intr.c Mon Dec 31 22:09:08 2018 (r342656) @@ -689,6 +689,8 @@ void xen_intr_alloc_irqs(void) { + if (num_io_irqs > UINT_MAX - NR_EVENT_CHANNELS) + panic("IRQ allocation overflow (num_msi_irqs too high?)"); first_evtchn_irq = num_io_irqs; num_io_irqs += NR_EVENT_CHANNELS; } Modified: stable/11/sys/x86/xen/xen_msi.c ============================================================================== --- stable/11/sys/x86/xen/xen_msi.c Mon Dec 31 21:55:12 2018 (r342655) +++ stable/11/sys/x86/xen/xen_msi.c Mon Dec 31 22:09:08 2018 (r342656) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -57,7 +58,9 @@ xen_msi_init(void) MPASS(num_io_irqs > 0); first_msi_irq = min(MINIMUM_MSI_INT, num_io_irqs); - num_io_irqs = first_msi_irq + NUM_MSI_INTS; + if (num_msi_irqs > UINT_MAX - first_msi_irq) + panic("num_msi_irq too high"); + num_io_irqs = first_msi_irq + num_msi_irqs; mtx_init(&msi_lock, "msi", NULL, MTX_DEF); } @@ -73,7 +76,7 @@ xen_msi_alloc(device_t dev, int count, int maxcount, i mtx_lock(&msi_lock); /* If we would exceed the max, give up. */ - if ((msi_last_irq + count) > NUM_MSI_INTS) { + if (msi_last_irq + count > num_msi_irqs) { mtx_unlock(&msi_lock); return (ENXIO); } From owner-svn-src-all@freebsd.org Mon Dec 31 22:20:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AE96141BCE2; Mon, 31 Dec 2018 22:20:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3EEA877D9; Mon, 31 Dec 2018 22:20:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DD2D18D47; Mon, 31 Dec 2018 22:20:30 +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 wBVMKUIn037339; Mon, 31 Dec 2018 22:20:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVMKUUF037338; Mon, 31 Dec 2018 22:20:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812312220.wBVMKUUF037338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 31 Dec 2018 22:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342657 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 342657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B3EEA877D9 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)[-0.998,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, 31 Dec 2018 22:20:31 -0000 Author: imp Date: Mon Dec 31 22:20:30 2018 New Revision: 342657 URL: https://svnweb.freebsd.org/changeset/base/342657 Log: Add NO_RC16 quirk for Chipfancier 16GB USB stick... Submitted by: osef.lar@gmail.com PR: 234503 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Dec 31 22:09:08 2018 (r342656) +++ head/sys/cam/scsi/scsi_da.c Mon Dec 31 22:20:30 2018 (r342657) @@ -861,6 +861,14 @@ static struct da_quirk_entry da_quirk_table[] = {T_DIRECT, SIP_MEDIA_REMOVABLE, "I-O DATA", "USB Flash Disk*", "*"}, /*quirks*/ DA_Q_NO_RC16 }, + { + /* + * 16GB SLC CHIPFANCIER + * PR: usb/234503 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "16G SLC", "CHIPFANCIER", + "1.00"}, /*quirks*/ DA_Q_NO_RC16 + }, /* ATA/SATA devices over SAS/USB/... */ { /* Hitachi Advanced Format (4k) drives */ From owner-svn-src-all@freebsd.org Mon Dec 31 22:46:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0F96141EABB; Mon, 31 Dec 2018 22:46:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BF0988998; Mon, 31 Dec 2018 22:46:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19A6219248; Mon, 31 Dec 2018 22:46:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVMkhpV053048; Mon, 31 Dec 2018 22:46:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVMkhCm053047; Mon, 31 Dec 2018 22:46:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201812312246.wBVMkhCm053047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 31 Dec 2018 22:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342658 - in head/sys/x86: x86 xen X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/x86: x86 xen X-SVN-Commit-Revision: 342658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BF0988998 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)[-0.998,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, 31 Dec 2018 22:46:45 -0000 Author: jhb Date: Mon Dec 31 22:46:43 2018 New Revision: 342658 URL: https://svnweb.freebsd.org/changeset/base/342658 Log: Correct variable name in two panic messages: num_msi_irq -> num_msi_irqs. MFC after: 1 week Modified: head/sys/x86/x86/msi.c head/sys/x86/xen/xen_msi.c Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Mon Dec 31 22:20:30 2018 (r342657) +++ head/sys/x86/x86/msi.c Mon Dec 31 22:46:43 2018 (r342658) @@ -343,7 +343,7 @@ msi_init(void) first_msi_irq = num_io_irqs; if (num_msi_irqs > UINT_MAX - first_msi_irq) - panic("num_msi_irq too high"); + panic("num_msi_irqs too high"); num_io_irqs = first_msi_irq + num_msi_irqs; msi_enabled = 1; Modified: head/sys/x86/xen/xen_msi.c ============================================================================== --- head/sys/x86/xen/xen_msi.c Mon Dec 31 22:20:30 2018 (r342657) +++ head/sys/x86/xen/xen_msi.c Mon Dec 31 22:46:43 2018 (r342658) @@ -59,7 +59,7 @@ xen_msi_init(void) MPASS(num_io_irqs > 0); first_msi_irq = num_io_irqs; if (num_msi_irqs > UINT_MAX - first_msi_irq) - panic("num_msi_irq too high"); + panic("num_msi_irqs too high"); num_io_irqs = first_msi_irq + num_msi_irqs; mtx_init(&msi_lock, "msi", NULL, MTX_DEF); From owner-svn-src-all@freebsd.org Mon Dec 31 23:27:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B41141F3E5; Mon, 31 Dec 2018 23:27:57 +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 A306D89E43; Mon, 31 Dec 2018 23:27:56 +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 84E1D198F0; Mon, 31 Dec 2018 23:27:56 +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 wBVNRuAl074287; Mon, 31 Dec 2018 23:27:56 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVNRuTl074286; Mon, 31 Dec 2018 23:27:56 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201812312327.wBVNRuTl074286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 31 Dec 2018 23:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342659 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 342659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A306D89E43 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)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2018 23:27:57 -0000 Author: scottl Date: Mon Dec 31 23:27:56 2018 New Revision: 342659 URL: https://svnweb.freebsd.org/changeset/base/342659 Log: Fix whitespace from r342528 Modified: head/sys/dev/mpr/mpr_user.c Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Mon Dec 31 22:46:43 2018 (r342658) +++ head/sys/dev/mpr/mpr_user.c Mon Dec 31 23:27:56 2018 (r342659) @@ -1107,9 +1107,8 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru SenseCount)), sizeof(struct scsi_sense_data)); mpr_unlock(sc); - copyout(cm->cm_sense, - (PTRIN(data->PtrReply + sizeof(MPI2_SCSI_IO_REPLY))), - sense_len); + copyout(cm->cm_sense, (PTRIN(data->PtrReply + + sizeof(MPI2_SCSI_IO_REPLY))), sense_len); mpr_lock(sc); } } From owner-svn-src-all@freebsd.org Mon Dec 31 23:30:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D366141F47A; Mon, 31 Dec 2018 23:30:32 +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 D604A89FB5; Mon, 31 Dec 2018 23:30:31 +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 BE670198F6; Mon, 31 Dec 2018 23:30:31 +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 wBVNUVf0074487; Mon, 31 Dec 2018 23:30:31 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVNUVx5074486; Mon, 31 Dec 2018 23:30:31 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201812312330.wBVNUVx5074486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 31 Dec 2018 23:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342660 - head/sys/dev/mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/mps X-SVN-Commit-Revision: 342660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D604A89FB5 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)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2018 23:30:32 -0000 Author: scottl Date: Mon Dec 31 23:30:31 2018 New Revision: 342660 URL: https://svnweb.freebsd.org/changeset/base/342660 Log: Port over the SCSI sense handling fix from mpr(4) in r342528, and fix whitespace to match. Modified: head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Mon Dec 31 23:27:56 2018 (r342659) +++ head/sys/dev/mps/mps_user.c Mon Dec 31 23:30:31 2018 (r342660) @@ -1043,10 +1043,12 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru if (((MPI2_SCSI_IO_REPLY *)rpl)->SCSIState & MPI2_SCSI_STATE_AUTOSENSE_VALID) { sense_len = - MIN((le32toh(((MPI2_SCSI_IO_REPLY *)rpl)->SenseCount)), - sizeof(struct scsi_sense_data)); + MIN((le32toh(((MPI2_SCSI_IO_REPLY *)rpl)-> + SenseCount)), sizeof(struct + scsi_sense_data)); mps_unlock(sc); - copyout(cm->cm_sense, cm->cm_req + 64, sense_len); + copyout(cm->cm_sense, (PTRIN(data->PtrReply + + sizeof(MPI2_SCSI_IO_REPLY))), sense_len); mps_lock(sc); } } From owner-svn-src-all@freebsd.org Tue Jan 1 00:25:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F47414206D1; Tue, 1 Jan 2019 00:25:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8F138BA6C; Tue, 1 Jan 2019 00:25:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC1F41A2EC; Tue, 1 Jan 2019 00:25:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x010PQg6007177; Tue, 1 Jan 2019 00:25:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x010PQjI007175; Tue, 1 Jan 2019 00:25:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201901010025.x010PQjI007175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 1 Jan 2019 00:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342661 - in head: . sys/sys X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: . sys/sys X-SVN-Commit-Revision: 342661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E8F138BA6C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 01 Jan 2019 00:25:27 -0000 Author: delphij Date: Tue Jan 1 00:25:25 2019 New Revision: 342661 URL: https://svnweb.freebsd.org/changeset/base/342661 Log: Happy New Year 2019! Modified: head/COPYRIGHT head/sys/sys/copyright.h Modified: head/COPYRIGHT ============================================================================== --- head/COPYRIGHT Mon Dec 31 23:30:31 2018 (r342660) +++ head/COPYRIGHT Tue Jan 1 00:25:25 2019 (r342661) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2018 The FreeBSD Project. +Copyright (c) 1992-2019 The FreeBSD Project. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: head/sys/sys/copyright.h ============================================================================== --- head/sys/sys/copyright.h Mon Dec 31 23:30:31 2018 (r342660) +++ head/sys/sys/copyright.h Tue Jan 1 00:25:25 2019 (r342661) @@ -36,7 +36,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2018 The FreeBSD Project.\n" + "Copyright (c) 1992-2019 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-all@freebsd.org Tue Jan 1 00:28:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4B6A1420967; Tue, 1 Jan 2019 00:28:00 +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 8A77E8BC9D; Tue, 1 Jan 2019 00:28:00 +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 76E2F1A2ED; Tue, 1 Jan 2019 00:28:00 +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 x010S086007379; Tue, 1 Jan 2019 00:28:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x010S0dk007378; Tue, 1 Jan 2019 00:28:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901010028.x010S0dk007378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 1 Jan 2019 00:28: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: r342662 - stable/12/sys/i386/i386 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/i386/i386 X-SVN-Commit-Revision: 342662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A77E8BC9D 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)[-0.998,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, 01 Jan 2019 00:28:01 -0000 Author: kib Date: Tue Jan 1 00:28:00 2019 New Revision: 342662 URL: https://svnweb.freebsd.org/changeset/base/342662 Log: MFC r342594: i386: Fix allocation of the KVA frame for pmap_quick_enter_page(). Modified: stable/12/sys/i386/i386/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/i386/i386/pmap.c ============================================================================== --- stable/12/sys/i386/i386/pmap.c Tue Jan 1 00:25:25 2019 (r342661) +++ stable/12/sys/i386/i386/pmap.c Tue Jan 1 00:28:00 2019 (r342662) @@ -735,7 +735,7 @@ pmap_init_reserved_pages(void) pc->pc_cmap_pte2 = vtopte(pages + PAGE_SIZE); pc->pc_cmap_addr1 = (caddr_t)pages; pc->pc_cmap_addr2 = (caddr_t)(pages + PAGE_SIZE); - pc->pc_qmap_addr = pages + atop(2); + pc->pc_qmap_addr = pages + ptoa(2); } } From owner-svn-src-all@freebsd.org Tue Jan 1 00:35:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2D301420D2A; Tue, 1 Jan 2019 00:35:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EEF68C12A; Tue, 1 Jan 2019 00:35:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 431031A48E; Tue, 1 Jan 2019 00:35:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x010ZRwg012328; Tue, 1 Jan 2019 00:35:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x010ZQfg012326; Tue, 1 Jan 2019 00:35:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201901010035.x010ZQfg012326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 1 Jan 2019 00:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342663 - in stable/12: . sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/12: . sys/sys X-SVN-Commit-Revision: 342663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5EEF68C12A 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)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Jan 2019 00:35:27 -0000 Author: delphij Date: Tue Jan 1 00:35:26 2019 New Revision: 342663 URL: https://svnweb.freebsd.org/changeset/base/342663 Log: MFC r342661: Happy New Year 2019! Modified: stable/12/COPYRIGHT stable/12/sys/sys/copyright.h Directory Properties: stable/12/ (props changed) Modified: stable/12/COPYRIGHT ============================================================================== --- stable/12/COPYRIGHT Tue Jan 1 00:28:00 2019 (r342662) +++ stable/12/COPYRIGHT Tue Jan 1 00:35:26 2019 (r342663) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2018 The FreeBSD Project. +Copyright (c) 1992-2019 The FreeBSD Project. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/12/sys/sys/copyright.h ============================================================================== --- stable/12/sys/sys/copyright.h Tue Jan 1 00:28:00 2019 (r342662) +++ stable/12/sys/sys/copyright.h Tue Jan 1 00:35:26 2019 (r342663) @@ -36,7 +36,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2018 The FreeBSD Project.\n" + "Copyright (c) 1992-2019 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-all@freebsd.org Tue Jan 1 00:42:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C8111421122; Tue, 1 Jan 2019 00:42:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3FF38C764; Tue, 1 Jan 2019 00:42:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2D0E1A647; Tue, 1 Jan 2019 00:42:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x010grpI017435; Tue, 1 Jan 2019 00:42:53 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x010gpMj017427; Tue, 1 Jan 2019 00:42:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201901010042.x010gpMj017427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 1 Jan 2019 00:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342664 - in stable/11: . share/examples/drivers share/examples/etc share/examples/mdoc X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: . share/examples/drivers share/examples/etc share/examples/mdoc X-SVN-Commit-Revision: 342664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3FF38C764 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.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 01 Jan 2019 00:42:54 -0000 Author: delphij Date: Tue Jan 1 00:42:51 2019 New Revision: 342664 URL: https://svnweb.freebsd.org/changeset/base/342664 Log: MFC r333391 (imp): Remove 'All Rights Reserved' from the collection copyright and templates. Modified: stable/11/COPYRIGHT stable/11/share/examples/drivers/make_device_driver.sh stable/11/share/examples/drivers/make_pseudo_driver.sh stable/11/share/examples/etc/bsd-style-copyright stable/11/share/examples/mdoc/POSIX-copyright stable/11/share/examples/mdoc/example.1 stable/11/share/examples/mdoc/example.3 stable/11/share/examples/mdoc/example.4 stable/11/share/examples/mdoc/example.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/COPYRIGHT ============================================================================== --- stable/11/COPYRIGHT Tue Jan 1 00:35:26 2019 (r342663) +++ stable/11/COPYRIGHT Tue Jan 1 00:42:51 2019 (r342664) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2018 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2018 The FreeBSD Project. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/11/share/examples/drivers/make_device_driver.sh ============================================================================== --- stable/11/share/examples/drivers/make_device_driver.sh Tue Jan 1 00:35:26 2019 (r342663) +++ stable/11/share/examples/drivers/make_device_driver.sh Tue Jan 1 00:42:51 2019 (r342664) @@ -115,7 +115,6 @@ fi cat >${TOP}/dev/${1}/${1}.c <${TOP}/dev/${1}/${1}.c < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1593142122D; Tue, 1 Jan 2019 00:48:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 977238C9A5; Tue, 1 Jan 2019 00:48:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 847221A649; Tue, 1 Jan 2019 00:48:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x010mQQD017868; Tue, 1 Jan 2019 00:48:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x010mQtx017866; Tue, 1 Jan 2019 00:48:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201901010048.x010mQtx017866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 1 Jan 2019 00:48:26 +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: r342665 - in stable/11: . sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: . sys/sys X-SVN-Commit-Revision: 342665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 977238C9A5 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)[-0.998,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, 01 Jan 2019 00:48:27 -0000 Author: delphij Date: Tue Jan 1 00:48:25 2019 New Revision: 342665 URL: https://svnweb.freebsd.org/changeset/base/342665 Log: MFC r342661: Happy New Year 2019! Modified: stable/11/COPYRIGHT stable/11/sys/sys/copyright.h Directory Properties: stable/11/ (props changed) Modified: stable/11/COPYRIGHT ============================================================================== --- stable/11/COPYRIGHT Tue Jan 1 00:42:51 2019 (r342664) +++ stable/11/COPYRIGHT Tue Jan 1 00:48:25 2019 (r342665) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2018 The FreeBSD Project. +Copyright (c) 1992-2019 The FreeBSD Project. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/11/sys/sys/copyright.h ============================================================================== --- stable/11/sys/sys/copyright.h Tue Jan 1 00:42:51 2019 (r342664) +++ stable/11/sys/sys/copyright.h Tue Jan 1 00:48:25 2019 (r342665) @@ -34,7 +34,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2018 The FreeBSD Project.\n" + "Copyright (c) 1992-2019 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-all@freebsd.org Tue Jan 1 01:15:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F1A51421A02; Tue, 1 Jan 2019 01:15:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F39328D788; Tue, 1 Jan 2019 01:15:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 0874510B707; Mon, 31 Dec 2018 20:15:24 -0500 (EST) Subject: Re: svn commit: r342599 - head/sys/kern To: Kristof Provost , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812292136.wBTLa25i072560@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 31 Dec 2018 17:15:23 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201812292136.wBTLa25i072560@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 31 Dec 2018 20:15:25 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Jan 2019 01:15:28 -0000 On 12/29/18 1:36 PM, Kristof Provost wrote: > Author: kp > Date: Sat Dec 29 21:36:02 2018 > New Revision: 342599 > URL: https://svnweb.freebsd.org/changeset/base/342599 > > Log: > Simplify jail ID printing on process exit > > As suggested by kib@, we don't need to check p_ucred, because that's only NULL > during process creation, and cr_prison is never NULL. > > Modified: > head/sys/kern/kern_sig.c > > Modified: head/sys/kern/kern_sig.c > ============================================================================== > --- head/sys/kern/kern_sig.c Sat Dec 29 21:18:01 2018 (r342598) > +++ head/sys/kern/kern_sig.c Sat Dec 29 21:36:02 2018 (r342599) > @@ -3094,16 +3094,12 @@ proc_wkilled(struct proc *p) > void > killproc(struct proc *p, char *why) > { > - int jid = -1; > > - if (p->p_ucred && p->p_ucred->cr_prison) > - jid = p->p_ucred->cr_prison->pr_id; > - > PROC_LOCK_ASSERT(p, MA_OWNED); > CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", p, p->p_pid, > p->p_comm); > log(LOG_ERR, "pid %d (%s), jid %d, uid %d, was killed: %s\n", > - p->p_pid, p->p_comm, jid, > + p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id, > p->p_ucred ? p->p_ucred->cr_uid : -1, why); Could you fix the cr_uid cases to remove the ?: as a follow up? -- John Baldwin                                                                              From owner-svn-src-all@freebsd.org Tue Jan 1 04:57:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36C2D1429C3F; Tue, 1 Jan 2019 04:57:47 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D284F6E15C; Tue, 1 Jan 2019 04:57:46 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C54981D176; Tue, 1 Jan 2019 04:57:46 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x014vkiR049315; Tue, 1 Jan 2019 04:57:46 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x014vkYR049314; Tue, 1 Jan 2019 04:57:46 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201901010457.x014vkYR049314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Tue, 1 Jan 2019 04:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342666 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 342666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D284F6E15C 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)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Jan 2019 04:57:47 -0000 Author: bcran Date: Tue Jan 1 04:57:46 2019 New Revision: 342666 URL: https://svnweb.freebsd.org/changeset/base/342666 Log: Update the efibootmgr(8) man page to document changes to options. Modified: head/usr.sbin/efibootmgr/efibootmgr.8 Modified: head/usr.sbin/efibootmgr/efibootmgr.8 ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.8 Tue Jan 1 00:48:25 2019 (r342665) +++ head/usr.sbin/efibootmgr/efibootmgr.8 Tue Jan 1 04:57:46 2019 (r342666) @@ -31,12 +31,13 @@ .Nm efibootmgr .Nd manipulate the EFI Boot Manager .Sh SYNOPSIS -.Op Fl aAnNB Ar bootnum +.Op Fl aAnNB +.Op Fl b Ar bootnum .Op Fl t Ar timeout .Op Fl T .Op Fl o Ar bootorder .Op Fl v -.Op Fl c l Ar loader [ Fl k Ar kernel ] [ Fl L Ar label ] [ Fl -dry-run ] [ Fl b Ar bootnum ] +.Op Fl c l Ar loader [ Fl k Ar kernel ] [ Fl L Ar label ] [ Fl -dry-run ] .Sh "DESCRIPTION" .Nm manipulates how UEFI Boot Managers boot the system. @@ -71,19 +72,19 @@ The path to and name of the loader. .It Fl k -kernel Ar kernel The path to and name of the kernel. .It Fl b -bootnum Ar bootnum -When creating a new entry, use bootnum as the index. -Fail if it already exists. +When creating or modifying an entry, use bootnum as the index. +When creating a new entry, fail if it already exists. .It Fl L -label Ar label An optional description for the entry. .It Fl D -dry-run Process but do not change any variables. -.It Fl B -delete Ar bootnum +.It Fl B -delete Delete the given bootnum boot entry. -.It Fl a -activate Ar bootnum -Activate the given bootnum boot entry. -.It Fl A -deactivate Ar bootnum +.It Fl a -activate +Activate the given bootnum boot entry, or the new entry when used with -c. +.It Fl A -deactivate Deactivate the given bootnum boot entry. -.It Fl n -bootnext Ar bootnum +.It Fl n -bootnext Set bootnum boot entry as the BootNext variable. .It Fl N -delete-bootnext Delete the BootNext optional variable. @@ -100,7 +101,7 @@ Display the device path of boot entries in the output. .Pp .Sh Examples .Pp -To Display the current Boot related variables in the system: +To display the current Boot related variables in the system: .Pp .Dl efibootmgr [-v] .Pp @@ -130,18 +131,18 @@ into the first position of current BootOrder variable must first be set to active before being considered available to attempt booting from, else they are ignored. .Pp -.Dl efibootmgr -B 0009 +.Dl efibootmgr -B -b 0009 .Pp Will delete the given boot entry Boot0009 .Pp To set a given newly created boot entry active use: .Pp -.Dl efibootmgr -a 0009 +.Dl efibootmgr -a -b 0009 .Pp To set a given boot entry to be used as the BootNext variable, irrespective of its active state, use: .Pp -.Dl efibootmgr -n 0009 +.Dl efibootmgr -n -b 0009 .Pp To set the BootOrder for the next reboot use: .Pp From owner-svn-src-all@freebsd.org Tue Jan 1 08:27:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81A971425E8A; Tue, 1 Jan 2019 08:27:28 +0000 (UTC) (envelope-from kp@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 213668A850; Tue, 1 Jan 2019 08:27:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id C7194517; Tue, 1 Jan 2019 08:27:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [10.0.2.193] (ptr-8rh08jyvagy17tghbsd.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:240e:402:34da:bb47:a884:a9ed]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 15A05348AC; Tue, 1 Jan 2019 09:27:26 +0100 (CET) From: "Kristof Provost" To: "John Baldwin" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342599 - head/sys/kern Date: Tue, 01 Jan 2019 09:27:24 +0100 X-Mailer: MailMate (2.0BETAr6133) Message-ID: <99BBC967-981C-41CD-8928-98FEC7532F27@FreeBSD.org> In-Reply-To: References: <201812292136.wBTLa25i072560@repo.freebsd.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 213668A850 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.939,0] Content-Type: text/plain; charset=utf-8; format=flowed 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, 01 Jan 2019 08:27:28 -0000 On 1 Jan 2019, at 2:15, John Baldwin wrote: > On 12/29/18 1:36 PM, Kristof Provost wrote: >> Author: kp >> Date: Sat Dec 29 21:36:02 2018 >> New Revision: 342599 >> URL: https://svnweb.freebsd.org/changeset/base/342599 >> >> Log: >> Simplify jail ID printing on process exit >> >> As suggested by kib@, we don't need to check p_ucred, because = >> that's only NULL >> during process creation, and cr_prison is never NULL. >> >> Modified: >> head/sys/kern/kern_sig.c >> >> Modified: head/sys/kern/kern_sig.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/kern_sig.c Sat Dec 29 21:18:01 2018 (r342598) >> +++ head/sys/kern/kern_sig.c Sat Dec 29 21:36:02 2018 (r342599) >> @@ -3094,16 +3094,12 @@ proc_wkilled(struct proc *p) >> void >> killproc(struct proc *p, char *why) >> { >> - int jid =3D -1; >> >> - if (p->p_ucred && p->p_ucred->cr_prison) >> - jid =3D p->p_ucred->cr_prison->pr_id; >> - >> PROC_LOCK_ASSERT(p, MA_OWNED); >> CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", p, p->p_pid, >> p->p_comm); >> log(LOG_ERR, "pid %d (%s), jid %d, uid %d, was killed: %s\n", >> - p->p_pid, p->p_comm, jid, >> + p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id, >> p->p_ucred ? p->p_ucred->cr_uid : -1, why); > > Could you fix the cr_uid cases to remove the ?: as a follow up? > Yes, although it=E2=80=99ll be a couple of days. Regards, Kristof=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 From owner-svn-src-all@freebsd.org Tue Jan 1 10:05:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CEC81432A79; Tue, 1 Jan 2019 10:05:38 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F04B18D83E; Tue, 1 Jan 2019 10:05:37 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E14F220807; Tue, 1 Jan 2019 10:05:37 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x01A5baV011063; Tue, 1 Jan 2019 10:05:37 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x01A5aYW011057; Tue, 1 Jan 2019 10:05:36 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201901011005.x01A5aYW011057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Tue, 1 Jan 2019 10:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342669 - stable/10/contrib/tzdata X-SVN-Group: stable-10 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/10/contrib/tzdata X-SVN-Commit-Revision: 342669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F04B18D83E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 01 Jan 2019 10:05:38 -0000 Author: philip Date: Tue Jan 1 10:05:36 2019 New Revision: 342669 URL: https://svnweb.freebsd.org/changeset/base/342669 Log: MFC r342613: Import tzdata 2018h MFC r342644: Import tzdata 2018i Modified: stable/10/contrib/tzdata/Makefile stable/10/contrib/tzdata/NEWS stable/10/contrib/tzdata/africa stable/10/contrib/tzdata/asia stable/10/contrib/tzdata/australasia stable/10/contrib/tzdata/leapseconds stable/10/contrib/tzdata/leapseconds.awk stable/10/contrib/tzdata/northamerica stable/10/contrib/tzdata/theory.html stable/10/contrib/tzdata/version stable/10/contrib/tzdata/ziguard.awk stable/10/contrib/tzdata/zone.tab stable/10/contrib/tzdata/zone1970.tab Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzdata/Makefile ============================================================================== --- stable/10/contrib/tzdata/Makefile Tue Jan 1 10:05:12 2019 (r342668) +++ stable/10/contrib/tzdata/Makefile Tue Jan 1 10:05:36 2019 (r342669) @@ -380,15 +380,18 @@ AWK= awk # is typically nicer if it works. KSHELL= /bin/bash +# Name of curl , used for HTML validation. +CURL= curl + # The path where SGML DTDs are kept and the catalog file(s) to use when -# validating. The default should work on both Debian and Red Hat. +# validating HTML 4.01. The default should work on both Debian and Red Hat. SGML_TOPDIR= /usr SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224 SGML_CATALOG_FILES= \ $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat -# The name, arguments and environment of a program to validate your web pages. +# The name, arguments and environment of a program to validate HTML 4.01. # See for a validator, and # for a validation library. # Set VALIDATE=':' if you do not have such a program. @@ -488,6 +491,7 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.t COMMON= calendars CONTRIBUTING LICENSE Makefile \ NEWS README theory.html version WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +CHECK_WEB_PAGES=check_tz-art.html check_tz-how-to.html check_tz-link.html DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) PRIMARY_YDATA= africa antarctica asia australasia \ europe northamerica southamerica @@ -799,9 +803,15 @@ check_tzs: $(TZS) $(TZS_NEW) fi touch $@ -# This checks only the HTML 4.01 strict page. -# To check the the other pages, use . -check_web: tz-how-to.html +check_web: $(CHECK_WEB_PAGES) +check_tz-art.html: tz-art.html +check_tz-link.html: tz-link.html +check_tz-art.html check_tz-link.html: + $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ + -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \ + test ! -s $@.out || { cat $@.out; exit 1; } + mv $@.out $@ +check_tz-how-to.html: tz-how-to.html $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html touch $@ @@ -1068,7 +1078,7 @@ zic.o: private.h tzfile.h version.h .PHONY: ALL INSTALL all .PHONY: check check_time_t_alternatives -.PHONY: check_zishrink +.PHONY: check_web check_zishrink .PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names .PHONY: posix_only posix_packrat posix_right public Modified: stable/10/contrib/tzdata/NEWS ============================================================================== --- stable/10/contrib/tzdata/NEWS Tue Jan 1 10:05:12 2019 (r342668) +++ stable/10/contrib/tzdata/NEWS Tue Jan 1 10:05:36 2019 (r342669) @@ -1,14 +1,103 @@ News for the tz database +Release 2018i - 2018-12-30 11:05:43 -0800 + + Briefly: + São Tomé and Príncipe switches from +01 to +00 on 2019-01-01. + + Changes to future timestamps + + Due to a change in government, São Tomé and Príncipe switches back + from +01 to +00 on 2019-01-01 at 02:00. (Thanks to Vadim + Nasardinov and Michael Deckers.) + + +Release 2018h - 2018-12-23 17:59:32 -0800 + + Briefly: + Qyzylorda, Kazakhstan moved from +06 to +05 on 2018-12-21. + New zone Asia/Qostanay because Qostanay, Kazakhstan didn't move. + Metlakatla, Alaska observes PST this winter only. + Guess Morocco will continue to adjust clocks around Ramadan. + Add predictions for Iran from 2038 through 2090. + + Changes to future timestamps + + Guess that Morocco will continue to fall back just before and + spring forward just after Ramadan, the practice since 2012. + (Thanks to Maamar Abdelkader.) This means Morocco will observe + negative DST during Ramadan in main and vanguard formats, and in + rearguard format it stays in the +00 timezone and observes + ordinary DST in all months other than Ramadan. As before, extend + this guesswork to the year 2037. As a consequence, Morocco is + scheduled to observe three DST transitions in some Gregorian years + (e.g., 2033) due to the mismatch between the Gregorian and Islamic + calendars. + + The table of exact transitions for Iranian DST has been extended. + It formerly cut off before the year 2038 in a nod to 32-bit time_t. + It now cuts off before 2091 as there is doubt about how the Persian + calendar will treat 2091. This change predicts DST transitions in + 2038-9, 2042-3, and 2046-7 to occur one day later than previously + predicted. As before, post-cutoff transitions are approximated. + + Changes to past and future timestamps + + Qyzylorda (aka Kyzylorda) oblast in Kazakhstan moved from +06 to + +05 on 2018-12-21. This is a zone split as Qostanay (aka + Kostanay) did not switch, so create a zone Asia/Qostanay. + + Metlakatla moved from Alaska to Pacific standard time on 2018-11-04. + It did not change clocks that day and remains on -08 this winter. + (Thanks to Ryan Stanley.) It will revert to the usual Alaska + rules next spring, so this change affects only timestamps + from 2018-11-04 through 2019-03-10. + + Change to past timestamps + + Kwajalein's 1993-08-20 transition from -12 to +12 was at 24:00, + not 00:00. I transcribed the time incorrectly from Shanks. + (Thanks to Phake Nick.) + + Nauru's 1979 transition was on 02-10 at 02:00, not 05-01 at 00:00. + (Thanks to Phake Nick.) + + Guam observed DST irregularly from 1959 through 1977. + (Thanks to Phake Nick.) + + Hong Kong observed DST in 1941 starting 06-15 (not 04-01), then on + 10-01 changed standard time to +08:30 (not +08). Its transition + back to +08 after WWII was on 1945-09-15, not the previous day. + Its 1904-10-30 change took effect at 01:00 +08 (not 00:00 LMT). + (Thanks to Phake Nick, Steve Allen, and Joseph Myers.) Also, + its 1952 fallback was on 11-02 (not 10-25). + + This release contains many changes to timestamps before 1946 due + to Japanese possession or occupation of Pacific/Chuuk, + Pacific/Guam, Pacific/Kosrae, Pacific/Kwajalein, Pacific/Majuro, + Pacific/Nauru, Pacific/Palau, and Pacific/Pohnpei. + (Thanks to Phake Nick.) + + Assume that the Spanish East Indies was like the Philippines and + observed American time until the end of 1844. This affects + Pacific/Chuuk, Pacific/Kosrae, Pacific/Palau, and Pacific/Pohnpei. + + Changes to past tm_isdst flags + + For the recent Morocco change, the tm_isdst flag should be 1 from + 2018-10-27 00:00 to 2018-10-28 03:00. (Thanks to Michael Deckers.) + Give a URL to the official decree. (Thanks to Matt Johnson.) + + Release 2018g - 2018-10-26 22:22:45 -0700 Briefly: - Morocco switches to permanent +01 on 2018-10-27. + Morocco switches to permanent +01 on 2018-10-28. Changes to future timestamps - Morocco switches from +00/+01 to permanent +01 effective 2018-10-27, - so its clocks will not fall back on 2018-10-28 as previously scheduled. + Morocco switches from +00/+01 to permanent +01 effective 2018-10-28, + so its clocks will not fall back as previously scheduled. (Thanks to Mohamed Essedik Najd and Brian Inglis.) Changes to code @@ -119,7 +208,7 @@ Release 2018f - 2018-10-18 00:14:18 -0700 localtime.c no longer ignores TZif POSIX-style TZ strings that specify only standard time. Instead, these TZ strings now override the default time type for timestamps after the last - transition (or for all time stamps if there are no transitions), + transition (or for all timestamps if there are no transitions), just as DST strings specifying DST have always done. leapseconds.awk now outputs "#updated" and "#expires" comments, Modified: stable/10/contrib/tzdata/africa ============================================================================== --- stable/10/contrib/tzdata/africa Tue Jan 1 10:05:12 2019 (r342668) +++ stable/10/contrib/tzdata/africa Tue Jan 1 10:05:36 2019 (r342669) @@ -847,8 +847,41 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # From Mohamed Essedik Najd (2018-10-26): # Today, a Moroccan government council approved the perpetual addition # of 60 minutes to the regular Moroccan timezone. -# From Brian Inglis (2018-10-26): -# http://www.maroc.ma/fr/actualites/le-conseil-de-gouvernement-adopte-un-projet-de-decret-relatif-lheure-legale-stipulant-le +# From Matt Johnson (2018-10-28): +# http://www.sgg.gov.ma/Portals/1/BO/2018/BO_6720-bis_Ar.pdf +# +# From Maamar Abdelkader (2018-11-01): +# We usually move clocks back the previous week end and come back to the +1 +# the week end after.... The government does not announce yet the decision +# about this temporary change. But it s 99% sure that it will be the case, +# as in previous years. An unofficial survey was done these days, showing +# that 64% of asked peopke are ok for moving from +1 to +0 during Ramadan. +# https://leconomiste.com/article/1035870-enquete-l-economiste-sunergia-64-des-marocains-plebiscitent-le-gmt-pendant-ramadan +# +# From Paul Eggert (2018-11-01): +# For now, guess that Morocco will fall back at 03:00 the last Sunday +# before Ramadan, and spring forward at 02:00 the first Sunday after +# Ramadan, as this has been the practice since 2012. To implement this, +# transition dates for 2019 through 2037 were determined by running the +# following program under GNU Emacs 26.1. +# (let ((islamic-year 1440)) +# (require 'cal-islam) +# (while (< islamic-year 1460) +# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) +# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (sunday 0)) +# (while (/= sunday (mod (setq a (1- a)) 7))) +# (while (/= sunday (mod b 7)) +# (setq b (1+ b))) +# (setq a (calendar-gregorian-from-absolute a)) +# (setq b (calendar-gregorian-from-absolute b)) +# (insert +# (format +# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t-1:00\t-\n" +# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t0\t-\n") +# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) +# (setq islamic-year (+ 1 islamic-year)))) # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Morocco 1939 only - Sep 12 0:00 1:00 - @@ -892,13 +925,53 @@ Rule Morocco 2017 only - May 21 3:00 0 - Rule Morocco 2017 only - Jul 2 2:00 1:00 - Rule Morocco 2018 only - May 13 3:00 0 - Rule Morocco 2018 only - Jun 17 2:00 1:00 - +Rule Morocco 2019 only - May 5 3:00 -1:00 - +Rule Morocco 2019 only - Jun 9 2:00 0 - +Rule Morocco 2020 only - Apr 19 3:00 -1:00 - +Rule Morocco 2020 only - May 24 2:00 0 - +Rule Morocco 2021 only - Apr 11 3:00 -1:00 - +Rule Morocco 2021 only - May 16 2:00 0 - +Rule Morocco 2022 only - Mar 27 3:00 -1:00 - +Rule Morocco 2022 only - May 8 2:00 0 - +Rule Morocco 2023 only - Mar 19 3:00 -1:00 - +Rule Morocco 2023 only - Apr 23 2:00 0 - +Rule Morocco 2024 only - Mar 10 3:00 -1:00 - +Rule Morocco 2024 only - Apr 14 2:00 0 - +Rule Morocco 2025 only - Feb 23 3:00 -1:00 - +Rule Morocco 2025 only - Apr 6 2:00 0 - +Rule Morocco 2026 only - Feb 15 3:00 -1:00 - +Rule Morocco 2026 only - Mar 22 2:00 0 - +Rule Morocco 2027 only - Feb 7 3:00 -1:00 - +Rule Morocco 2027 only - Mar 14 2:00 0 - +Rule Morocco 2028 only - Jan 23 3:00 -1:00 - +Rule Morocco 2028 only - Feb 27 2:00 0 - +Rule Morocco 2029 only - Jan 14 3:00 -1:00 - +Rule Morocco 2029 only - Feb 18 2:00 0 - +Rule Morocco 2029 only - Dec 30 3:00 -1:00 - +Rule Morocco 2030 only - Feb 10 2:00 0 - +Rule Morocco 2030 only - Dec 22 3:00 -1:00 - +Rule Morocco 2031 only - Jan 26 2:00 0 - +Rule Morocco 2031 only - Dec 14 3:00 -1:00 - +Rule Morocco 2032 only - Jan 18 2:00 0 - +Rule Morocco 2032 only - Nov 28 3:00 -1:00 - +Rule Morocco 2033 only - Jan 9 2:00 0 - +Rule Morocco 2033 only - Nov 20 3:00 -1:00 - +Rule Morocco 2033 only - Dec 25 2:00 0 - +Rule Morocco 2034 only - Nov 5 3:00 -1:00 - +Rule Morocco 2034 only - Dec 17 2:00 0 - +Rule Morocco 2035 only - Oct 28 3:00 -1:00 - +Rule Morocco 2035 only - Dec 2 2:00 0 - +Rule Morocco 2036 only - Oct 19 3:00 -1:00 - +Rule Morocco 2036 only - Nov 23 2:00 0 - +Rule Morocco 2037 only - Oct 4 3:00 -1:00 - +Rule Morocco 2037 only - Nov 15 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 0:00 Morocco +00/+01 1984 Mar 16 1:00 - +01 1986 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Western Sahara # @@ -913,8 +986,8 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún -1:00 - -01 1976 Apr 14 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Mozambique # @@ -1071,10 +1144,20 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Den # the switch is from 01:00 to 02:00 ... [Decree No. 25/2017] # http://www.mnec.gov.st/index.php/publicacoes/documentos/file/90-decreto-lei-n-25-2017 +# From Vadim Nasardinov (2018-12-29): +# São Tomé and Príncipe is about to do the following on Jan 1, 2019: +# https://www.stp-press.st/2018/12/05/governo-jesus-ja-decidiu-repor-hora-legal-sao-tomense/ +# +# From Michael Deckers (2018-12-30): +# https://www.legis-palop.org/download.jsp?idFile=102818 +# ... [The legal time of the country, which coincides with universal +# coordinated time, will be restituted at 2 o'clock on day 1 of January, 2019.] + Zone Africa/Sao_Tome 0:26:56 - LMT 1884 -0:36:45 - LMT 1912 Jan 1 00:00u # Lisbon MT 0:00 - GMT 2018 Jan 1 01:00 - 1:00 - WAT + 1:00 - WAT 2019 Jan 1 02:00 + 0:00 - GMT # Senegal # See Africa/Abidjan. Modified: stable/10/contrib/tzdata/asia ============================================================================== --- stable/10/contrib/tzdata/asia Tue Jan 1 10:05:12 2019 (r342668) +++ stable/10/contrib/tzdata/asia Tue Jan 1 10:05:36 2019 (r342669) @@ -586,12 +586,82 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # obtained from # http://www.hko.gov.hk/gts/time/Summertime.htm -# From Arthur David Olson (2009-10-28): +# From Phake Nick (2018-10-27): +# According to Singaporean newspaper +# http://eresources.nlb.gov.sg/newspapers/Digitised/Article/singfreepresswk19041102-1.2.37 +# the day that Hong Kong start using GMT+8 should be Oct 30, 1904. +# +# From Paul Eggert (2018-11-17): +# Hong Kong had a time ball near the Marine Police Station, Tsim Sha Tsui. +# "The ball was raised manually each day and dropped at exactly 1pm +# (except on Sundays and Government holidays)." +# Dyson AD. From Time Ball to Atomic Clock. Hong Kong Government. 1983. +# +# "From 1904 October 30 the time-ball at Hong Kong has been dropped by order +# of the Governor of the Colony at 17h 0m 0s G.M.T., which is 23m 18s.14 in +# advance of 1h 0m 0s of Hong Kong mean time." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 +# +# From Joseph Myers (2018-11-18): +# An astronomer before 1925 referring to GMT would have been using the old +# astronomical convention where the day started at noon, not midnight. +# +# From Steve Allen (2018-11-17): +# Meteorological Observations made at the Hongkong Observatory in the year 1904 +# page 4 +# ... the log of drop times in Table II shows that on Sunday 1904-10-30 the +# ball was dropped. So that looks like a special case drop for the sake +# of broadcasting the new local time. +# +# From Phake Nick (2018-11-18): +# According to The Hong Kong Weekly Press, 1904-10-29, p.324, the +# governor of Hong Kong at the time stated that "We are further desired to +# make it known that the change will be effected by firing the gun and by the +# dropping of the Ball at 23min. 18sec. before one." +# From Paul Eggert (2018-11-18): +# See for this; unfortunately Flash is required. + +# From Phake Nick (2018-10-26): +# I went to check microfilm records stored at Hong Kong Public Library.... +# on September 30 1941, according to Ta Kung Pao (Hong Kong edition), it was +# stated that fallback would occur on the next day (the 1st)'s "03:00 am (Hong +# Kong Time 04:00 am)" and the clock will fall back for a half hour. (03:00 +# probably refer to the time commonly used in mainland China at the time given +# the paper's background) ... the sunrise/sunset time given by South China +# Morning Post for October 1st was indeed moved by half an hour compares to +# before. After that, in December, the battle to capture Hong Kong started and +# the library doesn't seems to have any record stored about press during that +# period of time. Some media resumed publication soon after that within the +# same month, but there were not much information about time there. Later they +# started including a radio program guide when they restored radio service, +# explicitly mentioning it use Tokyo standard time, and later added a note +# saying it's half an hour ahead of the old Hong Kong standard time, and it +# also seems to indicate that Hong Kong was not using GMT+8 when it was +# captured by Japan. +# +# Image of related sections on newspaper: +# * 1941-09-30, Ta Kung Pao (Hong Kong), "Winter Time start tomorrow". +# https://i.imgur.com/6waY51Z.jpg (Chinese) +# * 1941-09-29, South China Morning Post, Information on sunrise/sunset +# time and other things for September 30 and October 1. +# https://i.imgur.com/kCiUR78.jpg +# * 1942-02-05. The Hong Kong News, Radio Program Guide. +# https://i.imgur.com/eVvDMzS.jpg +# * 1941-06-14. Hong Kong Daily Press, Daylight Saving from 3am Tomorrow. +# https://i.imgur.com/05KkvtC.png +# * 1941-09-30, Hong Kong Daily Press, Winter Time Warning. +# https://i.imgur.com/dge4kFJ.png +# Also, the Liberation day of Hong Kong after WWII which British rule +# over the territory resumed was August 30, 1945, which I think should +# be the termination date for the use of JST in the territory.... + +# From Paul Eggert (2018-11-17): # Here are the dates given at -# http://www.hko.gov.hk/gts/time/Summertime.htm -# as of 2009-10-28: +# https://www.hko.gov.hk/gts/time/Summertime.htm +# as of 2014-06-19: # Year Period -# 1941 1 Apr to 30 Sep +# 1941 15 Jun to 30 Sep # 1942 Whole year # 1943 Whole year # 1944 Whole year @@ -602,7 +672,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1949 3 Apr to 30 Oct # 1950 2 Apr to 29 Oct # 1951 1 Apr to 28 Oct -# 1952 6 Apr to 25 Oct +# 1952 6 Apr to 2 Nov # 1953 5 Apr to 1 Nov # 1954 21 Mar to 31 Oct # 1955 20 Mar to 6 Nov @@ -631,25 +701,25 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1978 Nil # 1979 13 May to 21 Oct # 1980 to Now Nil -# The page does not give start or end times of day. -# The page does not give a start date for 1942. -# The page does not givw an end date for 1945. -# The Japanese occupation of Hong Kong began on 1941-12-25. -# The Japanese surrender of Hong Kong was signed 1945-09-15. -# For lack of anything better, use start of those days as the transition times. +# The page does not give times of day for transitions, +# or dates for the 1942 and 1945 transitions. +# The Japanese occupation of Hong Kong began 1941-12-25. +# The Japanese surrender of Hong Kong was signed 1945-09-16; see: +# Heaver S. The days after the Pacific war ended: unsettling times +# in Hong Kong. Post Magazine. 2016-06-13. +# https://www.scmp.com/magazines/post-magazine/article/1852990/days-after-pacific-war-ended-unsettling-times-hong-kong +# For lack of anything better, use start of those days as the +# transition times. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule HK 1941 only - Apr 1 3:30 1:00 S -Rule HK 1941 only - Sep 30 3:30 0 - Rule HK 1946 only - Apr 20 3:30 1:00 S Rule HK 1946 only - Dec 1 3:30 0 - Rule HK 1947 only - Apr 13 3:30 1:00 S Rule HK 1947 only - Dec 30 3:30 0 - Rule HK 1948 only - May 2 3:30 1:00 S Rule HK 1948 1951 - Oct lastSun 3:30 0 - -Rule HK 1952 only - Oct 25 3:30 0 - +Rule HK 1952 1953 - Nov Sun>=1 3:30 0 - Rule HK 1949 1953 - Apr Sun>=1 3:30 1:00 S -Rule HK 1953 only - Nov 1 3:30 0 - Rule HK 1954 1964 - Mar Sun>=18 3:30 1:00 S Rule HK 1954 only - Oct 31 3:30 0 - Rule HK 1955 1964 - Nov Sun>=1 3:30 0 - @@ -659,9 +729,11 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S Rule HK 1979 only - May Sun>=8 3:30 1:00 S Rule HK 1979 only - Oct Sun>=16 3:30 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 - 8:00 HK HK%sT 1941 Dec 25 - 9:00 - JST 1945 Sep 15 +Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42 + 8:00 - HKT 1941 Jun 15 3:30 + 8:00 1:00 HKST 1941 Oct 1 4:00 + 8:30 - HKT 1941 Dec 25 + 9:00 - JST 1945 Sep 16 8:00 HK HK%sT ############################################################################### @@ -1057,6 +1129,16 @@ Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 # India +# British astronomer Henry Park Hollis disliked India Standard Time's offset: +# "A new time system has been proposed for India, Further India, and Burmah. +# The scheme suggested is that the times of the meridians 5½ and 6½ hours +# east of Greenwich should be adopted in these territories. No reason is +# given why hourly meridians five hours and six hours east should not be +# chosen; a plan which would bring the time of India into harmony with +# that of almost the whole of the civilised world." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 + # From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic # https://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/ # (2015-12-22): @@ -1227,12 +1309,65 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # leap year calculation involved. There has never been any serious # plan to change that law.... # -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2018-11-30): # Go with Shanks & Pottenger before Sept. 1991, and with Pournader thereafter. -# I used Ed Reingold's cal-persia in GNU Emacs 21.2 to check Persian dates, -# stopping after 2037 when 32-bit time_t's overflow. -# That cal-persia used Birashk's approximation, which disagrees with the solar -# calendar predictions for the year 2025, so I corrected those dates by hand. +# I used the following code in GNU Emacs 26.1 to generate the "Rule Iran" +# lines from 2008 through 2087. Emacs 26.1 uses Ed Reingold's +# cal-persia implementation of Birashk's approximation, which in the +# 2008-2087 range disagrees with the the astronomical Persian calendar +# for Persian years 1404 (Gregorian 2025) and 1437 (Gregorian 2058), +# so the following code special-case those years. See Table 15.1, page 264, of: +# Edward M. Reingold and Nachum Dershowitz, Calendrical Calculations: +# The Ultimate Edition, Cambridge University Press (2018). +# https://www.cambridge.org/fr/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition +# Page 258, footnote 2, of this book says there is some dispute over what will +# happen in 2091 (and some other years after that), so this code +# stops in 2087, as 2088 and 2089 agree with the "max" rule below. +# (cl-loop +# initially (require 'cal-persia) +# with first-persian-year = 1387 +# with last-persian-year = 1466 +# ;; Exceptional years in the above range, +# ;; from Reingold & Dershowitz Table 15.1, page 264: +# with exceptional-persian-years = '(1404 1437) +# with range-start = nil +# for persian-year from first-persian-year to last-persian-year +# do +# (let* +# ((exceptional-year-offset +# (if (member persian-year exceptional-persian-years) 1 0)) +# (beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 persian-year)) +# exceptional-year-offset)) +# (end-dst-absolute +# (+ (calendar-persian-to-absolute (list 6 30 persian-year)) +# exceptional-year-offset)) +# (next-year-beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 (1+ persian-year))) +# (if (member (1+ persian-year) exceptional-persian-years) 1 0))) +# (beg-dst (calendar-gregorian-from-absolute beg-dst-absolute)) +# (end-dst (calendar-gregorian-from-absolute end-dst-absolute)) +# (next-year-beg-dst (calendar-gregorian-from-absolute +# next-year-beg-dst-absolute)) +# (year (calendar-extract-year beg-dst)) +# (range-end (if range-start year "only"))) +# (setq range-start (or range-start year)) +# (when (or (/= (calendar-extract-day beg-dst) +# (calendar-extract-day next-year-beg-dst)) +# (= persian-year last-persian-year)) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t1:00\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month beg-dst) t) +# (calendar-extract-day beg-dst))) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t0\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month end-dst) t) +# (calendar-extract-day end-dst))) +# (setq range-start nil)))) # # From Oscar van Vlijmen (2005-03-30), writing about future # discrepancies between cal-persia and the Iranian calendar: @@ -1267,61 +1402,113 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # thirtieth day of Shahrivar. # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iran 1978 1980 - Mar 21 0:00 1:00 - -Rule Iran 1978 only - Oct 21 0:00 0 - -Rule Iran 1979 only - Sep 19 0:00 0 - -Rule Iran 1980 only - Sep 23 0:00 0 - -Rule Iran 1991 only - May 3 0:00 1:00 - -Rule Iran 1992 1995 - Mar 22 0:00 1:00 - -Rule Iran 1991 1995 - Sep 22 0:00 0 - -Rule Iran 1996 only - Mar 21 0:00 1:00 - -Rule Iran 1996 only - Sep 21 0:00 0 - -Rule Iran 1997 1999 - Mar 22 0:00 1:00 - -Rule Iran 1997 1999 - Sep 22 0:00 0 - -Rule Iran 2000 only - Mar 21 0:00 1:00 - -Rule Iran 2000 only - Sep 21 0:00 0 - -Rule Iran 2001 2003 - Mar 22 0:00 1:00 - -Rule Iran 2001 2003 - Sep 22 0:00 0 - -Rule Iran 2004 only - Mar 21 0:00 1:00 - -Rule Iran 2004 only - Sep 21 0:00 0 - -Rule Iran 2005 only - Mar 22 0:00 1:00 - -Rule Iran 2005 only - Sep 22 0:00 0 - -Rule Iran 2008 only - Mar 21 0:00 1:00 - -Rule Iran 2008 only - Sep 21 0:00 0 - -Rule Iran 2009 2011 - Mar 22 0:00 1:00 - -Rule Iran 2009 2011 - Sep 22 0:00 0 - -Rule Iran 2012 only - Mar 21 0:00 1:00 - -Rule Iran 2012 only - Sep 21 0:00 0 - -Rule Iran 2013 2015 - Mar 22 0:00 1:00 - -Rule Iran 2013 2015 - Sep 22 0:00 0 - -Rule Iran 2016 only - Mar 21 0:00 1:00 - -Rule Iran 2016 only - Sep 21 0:00 0 - -Rule Iran 2017 2019 - Mar 22 0:00 1:00 - -Rule Iran 2017 2019 - Sep 22 0:00 0 - -Rule Iran 2020 only - Mar 21 0:00 1:00 - -Rule Iran 2020 only - Sep 21 0:00 0 - -Rule Iran 2021 2023 - Mar 22 0:00 1:00 - -Rule Iran 2021 2023 - Sep 22 0:00 0 - -Rule Iran 2024 only - Mar 21 0:00 1:00 - -Rule Iran 2024 only - Sep 21 0:00 0 - -Rule Iran 2025 2027 - Mar 22 0:00 1:00 - -Rule Iran 2025 2027 - Sep 22 0:00 0 - -Rule Iran 2028 2029 - Mar 21 0:00 1:00 - -Rule Iran 2028 2029 - Sep 21 0:00 0 - -Rule Iran 2030 2031 - Mar 22 0:00 1:00 - -Rule Iran 2030 2031 - Sep 22 0:00 0 - -Rule Iran 2032 2033 - Mar 21 0:00 1:00 - -Rule Iran 2032 2033 - Sep 21 0:00 0 - -Rule Iran 2034 2035 - Mar 22 0:00 1:00 - -Rule Iran 2034 2035 - Sep 22 0:00 0 - +Rule Iran 1978 1980 - Mar 20 24:00 1:00 - +Rule Iran 1978 only - Oct 20 24:00 0 - +Rule Iran 1979 only - Sep 18 24:00 0 - +Rule Iran 1980 only - Sep 22 24:00 0 - +Rule Iran 1991 only - May 2 24:00 1:00 - +Rule Iran 1992 1995 - Mar 21 24:00 1:00 - +Rule Iran 1991 1995 - Sep 21 24:00 0 - +Rule Iran 1996 only - Mar 20 24:00 1:00 - +Rule Iran 1996 only - Sep 20 24:00 0 - +Rule Iran 1997 1999 - Mar 21 24:00 1:00 - +Rule Iran 1997 1999 - Sep 21 24:00 0 - +Rule Iran 2000 only - Mar 20 24:00 1:00 - +Rule Iran 2000 only - Sep 20 24:00 0 - +Rule Iran 2001 2003 - Mar 21 24:00 1:00 - +Rule Iran 2001 2003 - Sep 21 24:00 0 - +Rule Iran 2004 only - Mar 20 24:00 1:00 - +Rule Iran 2004 only - Sep 20 24:00 0 - +Rule Iran 2005 only - Mar 21 24:00 1:00 - +Rule Iran 2005 only - Sep 21 24:00 0 - +Rule Iran 2008 only - Mar 20 24:00 1:00 - +Rule Iran 2008 only - Sep 20 24:00 0 - +Rule Iran 2009 2011 - Mar 21 24:00 1:00 - +Rule Iran 2009 2011 - Sep 21 24:00 0 - +Rule Iran 2012 only - Mar 20 24:00 1:00 - +Rule Iran 2012 only - Sep 20 24:00 0 - +Rule Iran 2013 2015 - Mar 21 24:00 1:00 - +Rule Iran 2013 2015 - Sep 21 24:00 0 - +Rule Iran 2016 only - Mar 20 24:00 1:00 - +Rule Iran 2016 only - Sep 20 24:00 0 - +Rule Iran 2017 2019 - Mar 21 24:00 1:00 - +Rule Iran 2017 2019 - Sep 21 24:00 0 - +Rule Iran 2020 only - Mar 20 24:00 1:00 - +Rule Iran 2020 only - Sep 20 24:00 0 - +Rule Iran 2021 2023 - Mar 21 24:00 1:00 - +Rule Iran 2021 2023 - Sep 21 24:00 0 - +Rule Iran 2024 only - Mar 20 24:00 1:00 - +Rule Iran 2024 only - Sep 20 24:00 0 - +Rule Iran 2025 2027 - Mar 21 24:00 1:00 - +Rule Iran 2025 2027 - Sep 21 24:00 0 - +Rule Iran 2028 2029 - Mar 20 24:00 1:00 - +Rule Iran 2028 2029 - Sep 20 24:00 0 - +Rule Iran 2030 2031 - Mar 21 24:00 1:00 - +Rule Iran 2030 2031 - Sep 21 24:00 0 - +Rule Iran 2032 2033 - Mar 20 24:00 1:00 - +Rule Iran 2032 2033 - Sep 20 24:00 0 - +Rule Iran 2034 2035 - Mar 21 24:00 1:00 - +Rule Iran 2034 2035 - Sep 21 24:00 0 - +Rule Iran 2036 2037 - Mar 20 24:00 1:00 - +Rule Iran 2036 2037 - Sep 20 24:00 0 - +Rule Iran 2038 2039 - Mar 21 24:00 1:00 - +Rule Iran 2038 2039 - Sep 21 24:00 0 - +Rule Iran 2040 2041 - Mar 20 24:00 1:00 - +Rule Iran 2040 2041 - Sep 20 24:00 0 - +Rule Iran 2042 2043 - Mar 21 24:00 1:00 - +Rule Iran 2042 2043 - Sep 21 24:00 0 - +Rule Iran 2044 2045 - Mar 20 24:00 1:00 - +Rule Iran 2044 2045 - Sep 20 24:00 0 - +Rule Iran 2046 2047 - Mar 21 24:00 1:00 - +Rule Iran 2046 2047 - Sep 21 24:00 0 - +Rule Iran 2048 2049 - Mar 20 24:00 1:00 - +Rule Iran 2048 2049 - Sep 20 24:00 0 - +Rule Iran 2050 2051 - Mar 21 24:00 1:00 - +Rule Iran 2050 2051 - Sep 21 24:00 0 - +Rule Iran 2052 2053 - Mar 20 24:00 1:00 - +Rule Iran 2052 2053 - Sep 20 24:00 0 - +Rule Iran 2054 2055 - Mar 21 24:00 1:00 - +Rule Iran 2054 2055 - Sep 21 24:00 0 - +Rule Iran 2056 2057 - Mar 20 24:00 1:00 - +Rule Iran 2056 2057 - Sep 20 24:00 0 - +Rule Iran 2058 2059 - Mar 21 24:00 1:00 - +Rule Iran 2058 2059 - Sep 21 24:00 0 - +Rule Iran 2060 2062 - Mar 20 24:00 1:00 - +Rule Iran 2060 2062 - Sep 20 24:00 0 - +Rule Iran 2063 only - Mar 21 24:00 1:00 - +Rule Iran 2063 only - Sep 21 24:00 0 - +Rule Iran 2064 2066 - Mar 20 24:00 1:00 - +Rule Iran 2064 2066 - Sep 20 24:00 0 - +Rule Iran 2067 only - Mar 21 24:00 1:00 - +Rule Iran 2067 only - Sep 21 24:00 0 - +Rule Iran 2068 2070 - Mar 20 24:00 1:00 - +Rule Iran 2068 2070 - Sep 20 24:00 0 - +Rule Iran 2071 only - Mar 21 24:00 1:00 - +Rule Iran 2071 only - Sep 21 24:00 0 - +Rule Iran 2072 2074 - Mar 20 24:00 1:00 - +Rule Iran 2072 2074 - Sep 20 24:00 0 - +Rule Iran 2075 only - Mar 21 24:00 1:00 - +Rule Iran 2075 only - Sep 21 24:00 0 - +Rule Iran 2076 2078 - Mar 20 24:00 1:00 - +Rule Iran 2076 2078 - Sep 20 24:00 0 - +Rule Iran 2079 only - Mar 21 24:00 1:00 - +Rule Iran 2079 only - Sep 21 24:00 0 - +Rule Iran 2080 2082 - Mar 20 24:00 1:00 - +Rule Iran 2080 2082 - Sep 20 24:00 0 - +Rule Iran 2083 only - Mar 21 24:00 1:00 - +Rule Iran 2083 only - Sep 21 24:00 0 - +Rule Iran 2084 2086 - Mar 20 24:00 1:00 - +Rule Iran 2084 2086 - Sep 20 24:00 0 - +Rule Iran 2087 only - Mar 21 24:00 1:00 - +Rule Iran 2087 only - Sep 21 24:00 0 - # -# The following rules are approximations starting in the year 2038. -# These are the best post-2037 approximations available, given the -# restrictions of a single rule using a Gregorian-based data format. +# The following rules are approximations starting in the year 2088. +# These are the best post-2088 approximations available, given the +# restrictions of a single rule using ordinary Gregorian dates. # At some point this table will need to be extended, though quite # possibly Iran will change the rules first. -Rule Iran 2036 max - Mar 21 0:00 1:00 - -Rule Iran 2036 max - Sep 21 0:00 0 - +Rule Iran 2088 max - Mar 20 24:00 1:00 - +Rule Iran 2088 max - Sep 20 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 @@ -1691,7 +1878,9 @@ Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u 9:00 Japan J%sT -# Since 1938, all Japanese possessions have been like Asia/Tokyo. +# Since 1938, all Japanese possessions have been like Asia/Tokyo, +# except that Truk (Chuuk), Ponape (Pohnpei), and Jaluit (Kosrae) did not +# switch from +10 to +09 until 1941-04-01; see the 'australasia' file. # Jordan # @@ -1981,8 +2170,10 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # and in Byalokoz) lists Ural river (plus 10 versts on its left bank) in # the third time belt (before 1930 this means +03). -# From Paul Eggert (2016-12-06): -# The tables below reflect Golosunov's remarks, with exceptions as noted. +# From Alexander Konzurovski (2018-12-20): +# Qyzyolrda Region (Asia/Qyzylorda) is changing its time zone from +# UTC+6 to UTC+5 effective December 21st, 2018. The legal document is +# located here: http://adilet.zan.kz/rus/docs/P1800000817 (russian language). # Zone NAME GMTOFF RULES FORMAT [UNTIL] # @@ -1996,8 +2187,6 @@ Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-A 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s 6:00 - +06 # Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY) -# This currently includes Qostanay (aka Kostanay, Kustanay) (KZ-KUS); -# see comments below. Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -2008,21 +2197,22 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s 6:00 RussiaAsia +06/+07 1992 Mar 29 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s - 6:00 - +06 -# The following zone is like Asia/Qyzylorda except for being one -# hour earlier from 1991-09-29 to 1992-03-29. The 1991/2 rules for -# Qostanay are unclear partly because of the 1997 Turgai -# reorganization, so this zone is commented out for now. -#Zone Asia/Qostanay 4:14:20 - LMT 1924 May 2 -# 4:00 - +04 1930 Jun 21 -# 5:00 - +05 1981 Apr 1 -# 5:00 1:00 +06 1981 Oct 1 -# 6:00 - +06 1982 Apr 1 -# 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s -# 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s -# 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s -# 6:00 - +06 + 6:00 - +06 2018 Dec 21 0:00 + 5:00 - +05 # +# Qostanay (aka Kostanay, Kustanay) (KZ-KUS) +# The 1991/2 rules are unclear partly because of the 1997 Turgai +# reorganization. +Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2 + 4:00 - +04 1930 Jun 21 + 5:00 - +05 1981 Apr 1 + 5:00 1:00 +06 1981 Oct 1 + 6:00 - +06 1982 Apr 1 + 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s + 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s + 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s + 6:00 - +06 + # Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 @@ -2116,21 +2306,43 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 # started at June 1 in that year. For another example, the article in # 1988 said that DST started at 2:00 AM in that year. +# From Phake Nick (2018-10-27): +# 1. According to official announcement from Korean government, the DST end +# date in South Korea should be +# 1955-09-08 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027977557 +# 1956-09-29 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027978341 +# 1957-09-21 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027979690#3 +# 1958-09-20 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027981189 +# 1959-09-19 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027982974#2 +# 1960-09-17 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0028044104 +# ... +# 2.... https://namu.wiki/w/대한민국%20표준시 ... [says] +# when Korea was using GMT+8:30 as standard time, the international +# aviation/marine/meteorological industry in the country refused to +# follow and continued to use GMT+9:00 for interoperability. + + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule ROK 1948 only - Jun 1 0:00 1:00 D -Rule ROK 1948 only - Sep 13 0:00 0 S -Rule ROK 1949 only - Apr 3 0:00 1:00 D -Rule ROK 1949 1951 - Sep Sun>=8 0:00 0 S -Rule ROK 1950 only - Apr 1 0:00 1:00 D -Rule ROK 1951 only - May 6 0:00 1:00 D -Rule ROK 1955 only - May 5 0:00 1:00 D -Rule ROK 1955 only - Sep 9 0:00 0 S -Rule ROK 1956 only - May 20 0:00 1:00 D -Rule ROK 1956 only - Sep 30 0:00 0 S -Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D -Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S -Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D -Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S +Rule ROK 1948 only - Jun 1 0:00 1:00 D +Rule ROK 1948 only - Sep 12 24:00 0 S +Rule ROK 1949 only - Apr 3 0:00 1:00 D +Rule ROK 1949 1951 - Sep Sat>=7 24:00 0 S +Rule ROK 1950 only - Apr 1 0:00 1:00 D +Rule ROK 1951 only - May 6 0:00 1:00 D +Rule ROK 1955 only - May 5 0:00 1:00 D +Rule ROK 1955 only - Sep 8 24:00 0 S +Rule ROK 1956 only - May 20 0:00 1:00 D +Rule ROK 1956 only - Sep 29 24:00 0 S +Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D +Rule ROK 1957 1960 - Sep Sat>=17 24:00 0 S +Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D +Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # From Paul Eggert (2016-08-23): # The Korean Wikipedia entry gives the following sources for UT offsets: @@ -2920,6 +3132,11 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # no information # Philippines + +# From Paul Eggert (2018-11-18): +# The Spanish initially used American (west-of-Greenwich) time. +# It is unknown what time Manila kept when the British occupied it from +# 1762-10-06 through 1764-04; for now assume it kept American time. # On 1844-08-16, Narciso Clavería, governor-general of the # Philippines, issued a proclamation announcing that 1844-12-30 was to # be immediately followed by 1845-01-01; see R.H. van Gent's @@ -3005,8 +3222,8 @@ Link Asia/Qatar Asia/Bahrain # going to run on Higgins Time.' And so, until last year, it did." See: # Antar E. Dinner at When? Saudi Aramco World, 1969 March/April. 2-3. # http://archive.aramcoworld.com/issue/196902/dinner.at.when.htm -# newspapers.com says a similar story about Higgins was published in the Port -# Angeles (WA) Evening News, 1965-03-10, page 5, but I lack access to the text. +# Also see: Antar EN. Arabian flying is confusing. +# Port Angeles (WA) Evening News. 1965-03-10. page 3. # # The TZ database cannot represent quasi-solar time; airline time is the best # we can do. The 1946 foreign air news digest of the U.S. Civil Aeronautics Modified: stable/10/contrib/tzdata/australasia ============================================================================== --- stable/10/contrib/tzdata/australasia Tue Jan 1 10:05:12 2019 (r342668) +++ stable/10/contrib/tzdata/australasia Tue Jan 1 10:05:36 2019 (r342669) @@ -402,10 +402,44 @@ Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete # it is uninhabited. # Guam + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# http://guamlegislature.com/Public_Laws_5th/PL05-025.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-59-7-Guam-Daylight-Savings-Time-May-6-1959.pdf +Rule Guam 1959 only - Jun 27 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-61-5-Revocation-of-Daylight-Saving-Time-and-Restoratio.pdf +Rule Guam 1961 only - Jan 29 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-67-13-Guam-Daylight-Savings-Time.pdf +Rule Guam 1967 only - Sep 1 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-69-2-Repeal-of-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jan 26 0:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-69-10-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jun 22 2:00 1:00 D +Rule Guam 1969 only - Aug 31 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-70-10-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-70-30-End-of-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-71-5-Guam-Daylight-Savings-Time.pdf +Rule Guam 1970 1971 - Apr lastSun 2:00 1:00 D +Rule Guam 1970 1971 - Sep Sun>=1 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-73-28.-Guam-Day-light-Saving-Time.pdf +Rule Guam 1973 only - Dec 16 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-74-7-Guam-Daylight-Savings-Time-Rescinded.pdf +Rule Guam 1974 only - Feb 24 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-76-13-Daylight-Savings-Time.pdf +Rule Guam 1976 only - May 26 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-76-25-Revocation-of-E.O.-76-13.pdf +Rule Guam 1976 only - Aug 22 2:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-77-4-Daylight-Savings-Time.pdf +Rule Guam 1977 only - Apr 24 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-77-18-Guam-Standard-Time.pdf +Rule Guam 1977 only - Aug 28 2:00 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Guam -14:21:00 - LMT 1844 Dec 31 9:39:00 - LMT 1901 # Agana - 10:00 - GST 2000 Dec 23 # Guam + 10:00 - GST 1941 Dec 10 # Guam + 9:00 - +09 1944 Jul 31 + 10:00 Guam G%sT 2000 Dec 23 10:00 - ChST # Chamorro Standard Time Link Pacific/Guam Pacific/Saipan # N Mariana Is @@ -427,31 +461,56 @@ Zone Pacific/Kiritimati -10:29:20 - LMT 1901 # Marshall Is # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Majuro 11:24:48 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 -Zone Pacific/Kwajalein 11:09:20 - LMT 1901 - 11:00 - +11 1969 Oct - -12:00 - -12 1993 Aug 20 - 12:00 - +12 +Zone Pacific/Majuro 11:24:48 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Jan 30 + 11:00 - +11 1969 Oct + 12:00 - +12 +Zone Pacific/Kwajalein 11:09:20 - LMT 1901 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Feb 6 + 11:00 - +11 1969 Oct + -12:00 - -12 1993 Aug 20 24:00 + 12:00 - +12 # Micronesia # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Chuuk 10:07:08 - LMT 1901 - 10:00 - +10 -Zone Pacific/Pohnpei 10:32:52 - LMT 1901 # Kolonia - 11:00 - +11 -Zone Pacific/Kosrae 10:51:56 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 1999 - 11:00 - +11 +Zone Pacific/Chuuk -13:52:52 - LMT 1844 Dec 31 + 10:07:08 - LMT 1901 + 10:00 - +10 1914 Oct + 9:00 - +09 1919 Feb 1 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 10:00 - +10 +Zone Pacific/Pohnpei -13:27:08 - LMT 1844 Dec 31 # Kolonia + 10:32:52 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 +Zone Pacific/Kosrae -13:08:04 - LMT 1844 Dec 31 + 10:51:56 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 1969 Oct + 12:00 - +12 1999 + 11:00 - +11 # Nauru # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe - 11:30 - +1130 1942 Mar 15 - 9:00 - +09 1944 Aug 15 - 11:30 - +1130 1979 May + 11:30 - +1130 1942 Aug 29 + 9:00 - +09 1945 Sep 8 + 11:30 - +1130 1979 Feb 10 2:00 12:00 - +12 # New Caledonia @@ -552,8 +611,9 @@ Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Palau 8:57:56 - LMT 1901 # Koror - 9:00 - +09 +Zone Pacific/Palau -15:02:04 - LMT 1844 Dec 31 # Koror + 8:57:56 - LMT 1901 + 9:00 - +09 # Papua New Guinea *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 1 10:04:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AB9E143292E; Tue, 1 Jan 2019 10:04:51 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F352D8D66A; Tue, 1 Jan 2019 10:04:50 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E151C20805; Tue, 1 Jan 2019 10:04:50 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x01A4oe1010917; Tue, 1 Jan 2019 10:04:50 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x01A4oJT010911; Tue, 1 Jan 2019 10:04:50 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201901011004.x01A4oJT010911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Tue, 1 Jan 2019 10:04: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: r342667 - stable/12/contrib/tzdata X-SVN-Group: stable-12 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/12/contrib/tzdata X-SVN-Commit-Revision: 342667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F352D8D66A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Jan 2019 10:04:51 -0000 Author: philip Date: Tue Jan 1 10:04:49 2019 New Revision: 342667 URL: https://svnweb.freebsd.org/changeset/base/342667 Log: MFC r342613: Import tzdata 2018h MFC r342644: Import tzdata 2018i Modified: stable/12/contrib/tzdata/Makefile stable/12/contrib/tzdata/NEWS stable/12/contrib/tzdata/africa stable/12/contrib/tzdata/asia stable/12/contrib/tzdata/australasia stable/12/contrib/tzdata/leapseconds stable/12/contrib/tzdata/leapseconds.awk stable/12/contrib/tzdata/northamerica stable/12/contrib/tzdata/theory.html stable/12/contrib/tzdata/version stable/12/contrib/tzdata/ziguard.awk stable/12/contrib/tzdata/zone.tab stable/12/contrib/tzdata/zone1970.tab Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/tzdata/Makefile ============================================================================== --- stable/12/contrib/tzdata/Makefile Tue Jan 1 04:57:46 2019 (r342666) +++ stable/12/contrib/tzdata/Makefile Tue Jan 1 10:04:49 2019 (r342667) @@ -380,15 +380,18 @@ AWK= awk # is typically nicer if it works. KSHELL= /bin/bash +# Name of curl , used for HTML validation. +CURL= curl + # The path where SGML DTDs are kept and the catalog file(s) to use when -# validating. The default should work on both Debian and Red Hat. +# validating HTML 4.01. The default should work on both Debian and Red Hat. SGML_TOPDIR= /usr SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224 SGML_CATALOG_FILES= \ $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat -# The name, arguments and environment of a program to validate your web pages. +# The name, arguments and environment of a program to validate HTML 4.01. # See for a validator, and # for a validation library. # Set VALIDATE=':' if you do not have such a program. @@ -488,6 +491,7 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.t COMMON= calendars CONTRIBUTING LICENSE Makefile \ NEWS README theory.html version WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +CHECK_WEB_PAGES=check_tz-art.html check_tz-how-to.html check_tz-link.html DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) PRIMARY_YDATA= africa antarctica asia australasia \ europe northamerica southamerica @@ -799,9 +803,15 @@ check_tzs: $(TZS) $(TZS_NEW) fi touch $@ -# This checks only the HTML 4.01 strict page. -# To check the the other pages, use . -check_web: tz-how-to.html +check_web: $(CHECK_WEB_PAGES) +check_tz-art.html: tz-art.html +check_tz-link.html: tz-link.html +check_tz-art.html check_tz-link.html: + $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ + -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \ + test ! -s $@.out || { cat $@.out; exit 1; } + mv $@.out $@ +check_tz-how-to.html: tz-how-to.html $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html touch $@ @@ -1068,7 +1078,7 @@ zic.o: private.h tzfile.h version.h .PHONY: ALL INSTALL all .PHONY: check check_time_t_alternatives -.PHONY: check_zishrink +.PHONY: check_web check_zishrink .PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names .PHONY: posix_only posix_packrat posix_right public Modified: stable/12/contrib/tzdata/NEWS ============================================================================== --- stable/12/contrib/tzdata/NEWS Tue Jan 1 04:57:46 2019 (r342666) +++ stable/12/contrib/tzdata/NEWS Tue Jan 1 10:04:49 2019 (r342667) @@ -1,14 +1,103 @@ News for the tz database +Release 2018i - 2018-12-30 11:05:43 -0800 + + Briefly: + São Tomé and Príncipe switches from +01 to +00 on 2019-01-01. + + Changes to future timestamps + + Due to a change in government, São Tomé and Príncipe switches back + from +01 to +00 on 2019-01-01 at 02:00. (Thanks to Vadim + Nasardinov and Michael Deckers.) + + +Release 2018h - 2018-12-23 17:59:32 -0800 + + Briefly: + Qyzylorda, Kazakhstan moved from +06 to +05 on 2018-12-21. + New zone Asia/Qostanay because Qostanay, Kazakhstan didn't move. + Metlakatla, Alaska observes PST this winter only. + Guess Morocco will continue to adjust clocks around Ramadan. + Add predictions for Iran from 2038 through 2090. + + Changes to future timestamps + + Guess that Morocco will continue to fall back just before and + spring forward just after Ramadan, the practice since 2012. + (Thanks to Maamar Abdelkader.) This means Morocco will observe + negative DST during Ramadan in main and vanguard formats, and in + rearguard format it stays in the +00 timezone and observes + ordinary DST in all months other than Ramadan. As before, extend + this guesswork to the year 2037. As a consequence, Morocco is + scheduled to observe three DST transitions in some Gregorian years + (e.g., 2033) due to the mismatch between the Gregorian and Islamic + calendars. + + The table of exact transitions for Iranian DST has been extended. + It formerly cut off before the year 2038 in a nod to 32-bit time_t. + It now cuts off before 2091 as there is doubt about how the Persian + calendar will treat 2091. This change predicts DST transitions in + 2038-9, 2042-3, and 2046-7 to occur one day later than previously + predicted. As before, post-cutoff transitions are approximated. + + Changes to past and future timestamps + + Qyzylorda (aka Kyzylorda) oblast in Kazakhstan moved from +06 to + +05 on 2018-12-21. This is a zone split as Qostanay (aka + Kostanay) did not switch, so create a zone Asia/Qostanay. + + Metlakatla moved from Alaska to Pacific standard time on 2018-11-04. + It did not change clocks that day and remains on -08 this winter. + (Thanks to Ryan Stanley.) It will revert to the usual Alaska + rules next spring, so this change affects only timestamps + from 2018-11-04 through 2019-03-10. + + Change to past timestamps + + Kwajalein's 1993-08-20 transition from -12 to +12 was at 24:00, + not 00:00. I transcribed the time incorrectly from Shanks. + (Thanks to Phake Nick.) + + Nauru's 1979 transition was on 02-10 at 02:00, not 05-01 at 00:00. + (Thanks to Phake Nick.) + + Guam observed DST irregularly from 1959 through 1977. + (Thanks to Phake Nick.) + + Hong Kong observed DST in 1941 starting 06-15 (not 04-01), then on + 10-01 changed standard time to +08:30 (not +08). Its transition + back to +08 after WWII was on 1945-09-15, not the previous day. + Its 1904-10-30 change took effect at 01:00 +08 (not 00:00 LMT). + (Thanks to Phake Nick, Steve Allen, and Joseph Myers.) Also, + its 1952 fallback was on 11-02 (not 10-25). + + This release contains many changes to timestamps before 1946 due + to Japanese possession or occupation of Pacific/Chuuk, + Pacific/Guam, Pacific/Kosrae, Pacific/Kwajalein, Pacific/Majuro, + Pacific/Nauru, Pacific/Palau, and Pacific/Pohnpei. + (Thanks to Phake Nick.) + + Assume that the Spanish East Indies was like the Philippines and + observed American time until the end of 1844. This affects + Pacific/Chuuk, Pacific/Kosrae, Pacific/Palau, and Pacific/Pohnpei. + + Changes to past tm_isdst flags + + For the recent Morocco change, the tm_isdst flag should be 1 from + 2018-10-27 00:00 to 2018-10-28 03:00. (Thanks to Michael Deckers.) + Give a URL to the official decree. (Thanks to Matt Johnson.) + + Release 2018g - 2018-10-26 22:22:45 -0700 Briefly: - Morocco switches to permanent +01 on 2018-10-27. + Morocco switches to permanent +01 on 2018-10-28. Changes to future timestamps - Morocco switches from +00/+01 to permanent +01 effective 2018-10-27, - so its clocks will not fall back on 2018-10-28 as previously scheduled. + Morocco switches from +00/+01 to permanent +01 effective 2018-10-28, + so its clocks will not fall back as previously scheduled. (Thanks to Mohamed Essedik Najd and Brian Inglis.) Changes to code @@ -119,7 +208,7 @@ Release 2018f - 2018-10-18 00:14:18 -0700 localtime.c no longer ignores TZif POSIX-style TZ strings that specify only standard time. Instead, these TZ strings now override the default time type for timestamps after the last - transition (or for all time stamps if there are no transitions), + transition (or for all timestamps if there are no transitions), just as DST strings specifying DST have always done. leapseconds.awk now outputs "#updated" and "#expires" comments, Modified: stable/12/contrib/tzdata/africa ============================================================================== --- stable/12/contrib/tzdata/africa Tue Jan 1 04:57:46 2019 (r342666) +++ stable/12/contrib/tzdata/africa Tue Jan 1 10:04:49 2019 (r342667) @@ -847,8 +847,41 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # From Mohamed Essedik Najd (2018-10-26): # Today, a Moroccan government council approved the perpetual addition # of 60 minutes to the regular Moroccan timezone. -# From Brian Inglis (2018-10-26): -# http://www.maroc.ma/fr/actualites/le-conseil-de-gouvernement-adopte-un-projet-de-decret-relatif-lheure-legale-stipulant-le +# From Matt Johnson (2018-10-28): +# http://www.sgg.gov.ma/Portals/1/BO/2018/BO_6720-bis_Ar.pdf +# +# From Maamar Abdelkader (2018-11-01): +# We usually move clocks back the previous week end and come back to the +1 +# the week end after.... The government does not announce yet the decision +# about this temporary change. But it s 99% sure that it will be the case, +# as in previous years. An unofficial survey was done these days, showing +# that 64% of asked peopke are ok for moving from +1 to +0 during Ramadan. +# https://leconomiste.com/article/1035870-enquete-l-economiste-sunergia-64-des-marocains-plebiscitent-le-gmt-pendant-ramadan +# +# From Paul Eggert (2018-11-01): +# For now, guess that Morocco will fall back at 03:00 the last Sunday +# before Ramadan, and spring forward at 02:00 the first Sunday after +# Ramadan, as this has been the practice since 2012. To implement this, +# transition dates for 2019 through 2037 were determined by running the +# following program under GNU Emacs 26.1. +# (let ((islamic-year 1440)) +# (require 'cal-islam) +# (while (< islamic-year 1460) +# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) +# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (sunday 0)) +# (while (/= sunday (mod (setq a (1- a)) 7))) +# (while (/= sunday (mod b 7)) +# (setq b (1+ b))) +# (setq a (calendar-gregorian-from-absolute a)) +# (setq b (calendar-gregorian-from-absolute b)) +# (insert +# (format +# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t-1:00\t-\n" +# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t0\t-\n") +# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) +# (setq islamic-year (+ 1 islamic-year)))) # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Morocco 1939 only - Sep 12 0:00 1:00 - @@ -892,13 +925,53 @@ Rule Morocco 2017 only - May 21 3:00 0 - Rule Morocco 2017 only - Jul 2 2:00 1:00 - Rule Morocco 2018 only - May 13 3:00 0 - Rule Morocco 2018 only - Jun 17 2:00 1:00 - +Rule Morocco 2019 only - May 5 3:00 -1:00 - +Rule Morocco 2019 only - Jun 9 2:00 0 - +Rule Morocco 2020 only - Apr 19 3:00 -1:00 - +Rule Morocco 2020 only - May 24 2:00 0 - +Rule Morocco 2021 only - Apr 11 3:00 -1:00 - +Rule Morocco 2021 only - May 16 2:00 0 - +Rule Morocco 2022 only - Mar 27 3:00 -1:00 - +Rule Morocco 2022 only - May 8 2:00 0 - +Rule Morocco 2023 only - Mar 19 3:00 -1:00 - +Rule Morocco 2023 only - Apr 23 2:00 0 - +Rule Morocco 2024 only - Mar 10 3:00 -1:00 - +Rule Morocco 2024 only - Apr 14 2:00 0 - +Rule Morocco 2025 only - Feb 23 3:00 -1:00 - +Rule Morocco 2025 only - Apr 6 2:00 0 - +Rule Morocco 2026 only - Feb 15 3:00 -1:00 - +Rule Morocco 2026 only - Mar 22 2:00 0 - +Rule Morocco 2027 only - Feb 7 3:00 -1:00 - +Rule Morocco 2027 only - Mar 14 2:00 0 - +Rule Morocco 2028 only - Jan 23 3:00 -1:00 - +Rule Morocco 2028 only - Feb 27 2:00 0 - +Rule Morocco 2029 only - Jan 14 3:00 -1:00 - +Rule Morocco 2029 only - Feb 18 2:00 0 - +Rule Morocco 2029 only - Dec 30 3:00 -1:00 - +Rule Morocco 2030 only - Feb 10 2:00 0 - +Rule Morocco 2030 only - Dec 22 3:00 -1:00 - +Rule Morocco 2031 only - Jan 26 2:00 0 - +Rule Morocco 2031 only - Dec 14 3:00 -1:00 - +Rule Morocco 2032 only - Jan 18 2:00 0 - +Rule Morocco 2032 only - Nov 28 3:00 -1:00 - +Rule Morocco 2033 only - Jan 9 2:00 0 - +Rule Morocco 2033 only - Nov 20 3:00 -1:00 - +Rule Morocco 2033 only - Dec 25 2:00 0 - +Rule Morocco 2034 only - Nov 5 3:00 -1:00 - +Rule Morocco 2034 only - Dec 17 2:00 0 - +Rule Morocco 2035 only - Oct 28 3:00 -1:00 - +Rule Morocco 2035 only - Dec 2 2:00 0 - +Rule Morocco 2036 only - Oct 19 3:00 -1:00 - +Rule Morocco 2036 only - Nov 23 2:00 0 - +Rule Morocco 2037 only - Oct 4 3:00 -1:00 - +Rule Morocco 2037 only - Nov 15 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 0:00 Morocco +00/+01 1984 Mar 16 1:00 - +01 1986 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Western Sahara # @@ -913,8 +986,8 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún -1:00 - -01 1976 Apr 14 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Mozambique # @@ -1071,10 +1144,20 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Den # the switch is from 01:00 to 02:00 ... [Decree No. 25/2017] # http://www.mnec.gov.st/index.php/publicacoes/documentos/file/90-decreto-lei-n-25-2017 +# From Vadim Nasardinov (2018-12-29): +# São Tomé and Príncipe is about to do the following on Jan 1, 2019: +# https://www.stp-press.st/2018/12/05/governo-jesus-ja-decidiu-repor-hora-legal-sao-tomense/ +# +# From Michael Deckers (2018-12-30): +# https://www.legis-palop.org/download.jsp?idFile=102818 +# ... [The legal time of the country, which coincides with universal +# coordinated time, will be restituted at 2 o'clock on day 1 of January, 2019.] + Zone Africa/Sao_Tome 0:26:56 - LMT 1884 -0:36:45 - LMT 1912 Jan 1 00:00u # Lisbon MT 0:00 - GMT 2018 Jan 1 01:00 - 1:00 - WAT + 1:00 - WAT 2019 Jan 1 02:00 + 0:00 - GMT # Senegal # See Africa/Abidjan. Modified: stable/12/contrib/tzdata/asia ============================================================================== --- stable/12/contrib/tzdata/asia Tue Jan 1 04:57:46 2019 (r342666) +++ stable/12/contrib/tzdata/asia Tue Jan 1 10:04:49 2019 (r342667) @@ -586,12 +586,82 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # obtained from # http://www.hko.gov.hk/gts/time/Summertime.htm -# From Arthur David Olson (2009-10-28): +# From Phake Nick (2018-10-27): +# According to Singaporean newspaper +# http://eresources.nlb.gov.sg/newspapers/Digitised/Article/singfreepresswk19041102-1.2.37 +# the day that Hong Kong start using GMT+8 should be Oct 30, 1904. +# +# From Paul Eggert (2018-11-17): +# Hong Kong had a time ball near the Marine Police Station, Tsim Sha Tsui. +# "The ball was raised manually each day and dropped at exactly 1pm +# (except on Sundays and Government holidays)." +# Dyson AD. From Time Ball to Atomic Clock. Hong Kong Government. 1983. +# +# "From 1904 October 30 the time-ball at Hong Kong has been dropped by order +# of the Governor of the Colony at 17h 0m 0s G.M.T., which is 23m 18s.14 in +# advance of 1h 0m 0s of Hong Kong mean time." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 +# +# From Joseph Myers (2018-11-18): +# An astronomer before 1925 referring to GMT would have been using the old +# astronomical convention where the day started at noon, not midnight. +# +# From Steve Allen (2018-11-17): +# Meteorological Observations made at the Hongkong Observatory in the year 1904 +# page 4 +# ... the log of drop times in Table II shows that on Sunday 1904-10-30 the +# ball was dropped. So that looks like a special case drop for the sake +# of broadcasting the new local time. +# +# From Phake Nick (2018-11-18): +# According to The Hong Kong Weekly Press, 1904-10-29, p.324, the +# governor of Hong Kong at the time stated that "We are further desired to +# make it known that the change will be effected by firing the gun and by the +# dropping of the Ball at 23min. 18sec. before one." +# From Paul Eggert (2018-11-18): +# See for this; unfortunately Flash is required. + +# From Phake Nick (2018-10-26): +# I went to check microfilm records stored at Hong Kong Public Library.... +# on September 30 1941, according to Ta Kung Pao (Hong Kong edition), it was +# stated that fallback would occur on the next day (the 1st)'s "03:00 am (Hong +# Kong Time 04:00 am)" and the clock will fall back for a half hour. (03:00 +# probably refer to the time commonly used in mainland China at the time given +# the paper's background) ... the sunrise/sunset time given by South China +# Morning Post for October 1st was indeed moved by half an hour compares to +# before. After that, in December, the battle to capture Hong Kong started and +# the library doesn't seems to have any record stored about press during that +# period of time. Some media resumed publication soon after that within the +# same month, but there were not much information about time there. Later they +# started including a radio program guide when they restored radio service, +# explicitly mentioning it use Tokyo standard time, and later added a note +# saying it's half an hour ahead of the old Hong Kong standard time, and it +# also seems to indicate that Hong Kong was not using GMT+8 when it was +# captured by Japan. +# +# Image of related sections on newspaper: +# * 1941-09-30, Ta Kung Pao (Hong Kong), "Winter Time start tomorrow". +# https://i.imgur.com/6waY51Z.jpg (Chinese) +# * 1941-09-29, South China Morning Post, Information on sunrise/sunset +# time and other things for September 30 and October 1. +# https://i.imgur.com/kCiUR78.jpg +# * 1942-02-05. The Hong Kong News, Radio Program Guide. +# https://i.imgur.com/eVvDMzS.jpg +# * 1941-06-14. Hong Kong Daily Press, Daylight Saving from 3am Tomorrow. +# https://i.imgur.com/05KkvtC.png +# * 1941-09-30, Hong Kong Daily Press, Winter Time Warning. +# https://i.imgur.com/dge4kFJ.png +# Also, the Liberation day of Hong Kong after WWII which British rule +# over the territory resumed was August 30, 1945, which I think should +# be the termination date for the use of JST in the territory.... + +# From Paul Eggert (2018-11-17): # Here are the dates given at -# http://www.hko.gov.hk/gts/time/Summertime.htm -# as of 2009-10-28: +# https://www.hko.gov.hk/gts/time/Summertime.htm +# as of 2014-06-19: # Year Period -# 1941 1 Apr to 30 Sep +# 1941 15 Jun to 30 Sep # 1942 Whole year # 1943 Whole year # 1944 Whole year @@ -602,7 +672,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1949 3 Apr to 30 Oct # 1950 2 Apr to 29 Oct # 1951 1 Apr to 28 Oct -# 1952 6 Apr to 25 Oct +# 1952 6 Apr to 2 Nov # 1953 5 Apr to 1 Nov # 1954 21 Mar to 31 Oct # 1955 20 Mar to 6 Nov @@ -631,25 +701,25 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1978 Nil # 1979 13 May to 21 Oct # 1980 to Now Nil -# The page does not give start or end times of day. -# The page does not give a start date for 1942. -# The page does not givw an end date for 1945. -# The Japanese occupation of Hong Kong began on 1941-12-25. -# The Japanese surrender of Hong Kong was signed 1945-09-15. -# For lack of anything better, use start of those days as the transition times. +# The page does not give times of day for transitions, +# or dates for the 1942 and 1945 transitions. +# The Japanese occupation of Hong Kong began 1941-12-25. +# The Japanese surrender of Hong Kong was signed 1945-09-16; see: +# Heaver S. The days after the Pacific war ended: unsettling times +# in Hong Kong. Post Magazine. 2016-06-13. +# https://www.scmp.com/magazines/post-magazine/article/1852990/days-after-pacific-war-ended-unsettling-times-hong-kong +# For lack of anything better, use start of those days as the +# transition times. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule HK 1941 only - Apr 1 3:30 1:00 S -Rule HK 1941 only - Sep 30 3:30 0 - Rule HK 1946 only - Apr 20 3:30 1:00 S Rule HK 1946 only - Dec 1 3:30 0 - Rule HK 1947 only - Apr 13 3:30 1:00 S Rule HK 1947 only - Dec 30 3:30 0 - Rule HK 1948 only - May 2 3:30 1:00 S Rule HK 1948 1951 - Oct lastSun 3:30 0 - -Rule HK 1952 only - Oct 25 3:30 0 - +Rule HK 1952 1953 - Nov Sun>=1 3:30 0 - Rule HK 1949 1953 - Apr Sun>=1 3:30 1:00 S -Rule HK 1953 only - Nov 1 3:30 0 - Rule HK 1954 1964 - Mar Sun>=18 3:30 1:00 S Rule HK 1954 only - Oct 31 3:30 0 - Rule HK 1955 1964 - Nov Sun>=1 3:30 0 - @@ -659,9 +729,11 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S Rule HK 1979 only - May Sun>=8 3:30 1:00 S Rule HK 1979 only - Oct Sun>=16 3:30 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 - 8:00 HK HK%sT 1941 Dec 25 - 9:00 - JST 1945 Sep 15 +Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42 + 8:00 - HKT 1941 Jun 15 3:30 + 8:00 1:00 HKST 1941 Oct 1 4:00 + 8:30 - HKT 1941 Dec 25 + 9:00 - JST 1945 Sep 16 8:00 HK HK%sT ############################################################################### @@ -1057,6 +1129,16 @@ Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 # India +# British astronomer Henry Park Hollis disliked India Standard Time's offset: +# "A new time system has been proposed for India, Further India, and Burmah. +# The scheme suggested is that the times of the meridians 5½ and 6½ hours +# east of Greenwich should be adopted in these territories. No reason is +# given why hourly meridians five hours and six hours east should not be +# chosen; a plan which would bring the time of India into harmony with +# that of almost the whole of the civilised world." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 + # From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic # https://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/ # (2015-12-22): @@ -1227,12 +1309,65 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # leap year calculation involved. There has never been any serious # plan to change that law.... # -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2018-11-30): # Go with Shanks & Pottenger before Sept. 1991, and with Pournader thereafter. -# I used Ed Reingold's cal-persia in GNU Emacs 21.2 to check Persian dates, -# stopping after 2037 when 32-bit time_t's overflow. -# That cal-persia used Birashk's approximation, which disagrees with the solar -# calendar predictions for the year 2025, so I corrected those dates by hand. +# I used the following code in GNU Emacs 26.1 to generate the "Rule Iran" +# lines from 2008 through 2087. Emacs 26.1 uses Ed Reingold's +# cal-persia implementation of Birashk's approximation, which in the +# 2008-2087 range disagrees with the the astronomical Persian calendar +# for Persian years 1404 (Gregorian 2025) and 1437 (Gregorian 2058), +# so the following code special-case those years. See Table 15.1, page 264, of: +# Edward M. Reingold and Nachum Dershowitz, Calendrical Calculations: +# The Ultimate Edition, Cambridge University Press (2018). +# https://www.cambridge.org/fr/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition +# Page 258, footnote 2, of this book says there is some dispute over what will +# happen in 2091 (and some other years after that), so this code +# stops in 2087, as 2088 and 2089 agree with the "max" rule below. +# (cl-loop +# initially (require 'cal-persia) +# with first-persian-year = 1387 +# with last-persian-year = 1466 +# ;; Exceptional years in the above range, +# ;; from Reingold & Dershowitz Table 15.1, page 264: +# with exceptional-persian-years = '(1404 1437) +# with range-start = nil +# for persian-year from first-persian-year to last-persian-year +# do +# (let* +# ((exceptional-year-offset +# (if (member persian-year exceptional-persian-years) 1 0)) +# (beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 persian-year)) +# exceptional-year-offset)) +# (end-dst-absolute +# (+ (calendar-persian-to-absolute (list 6 30 persian-year)) +# exceptional-year-offset)) +# (next-year-beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 (1+ persian-year))) +# (if (member (1+ persian-year) exceptional-persian-years) 1 0))) +# (beg-dst (calendar-gregorian-from-absolute beg-dst-absolute)) +# (end-dst (calendar-gregorian-from-absolute end-dst-absolute)) +# (next-year-beg-dst (calendar-gregorian-from-absolute +# next-year-beg-dst-absolute)) +# (year (calendar-extract-year beg-dst)) +# (range-end (if range-start year "only"))) +# (setq range-start (or range-start year)) +# (when (or (/= (calendar-extract-day beg-dst) +# (calendar-extract-day next-year-beg-dst)) +# (= persian-year last-persian-year)) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t1:00\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month beg-dst) t) +# (calendar-extract-day beg-dst))) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t0\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month end-dst) t) +# (calendar-extract-day end-dst))) +# (setq range-start nil)))) # # From Oscar van Vlijmen (2005-03-30), writing about future # discrepancies between cal-persia and the Iranian calendar: @@ -1267,61 +1402,113 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # thirtieth day of Shahrivar. # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iran 1978 1980 - Mar 21 0:00 1:00 - -Rule Iran 1978 only - Oct 21 0:00 0 - -Rule Iran 1979 only - Sep 19 0:00 0 - -Rule Iran 1980 only - Sep 23 0:00 0 - -Rule Iran 1991 only - May 3 0:00 1:00 - -Rule Iran 1992 1995 - Mar 22 0:00 1:00 - -Rule Iran 1991 1995 - Sep 22 0:00 0 - -Rule Iran 1996 only - Mar 21 0:00 1:00 - -Rule Iran 1996 only - Sep 21 0:00 0 - -Rule Iran 1997 1999 - Mar 22 0:00 1:00 - -Rule Iran 1997 1999 - Sep 22 0:00 0 - -Rule Iran 2000 only - Mar 21 0:00 1:00 - -Rule Iran 2000 only - Sep 21 0:00 0 - -Rule Iran 2001 2003 - Mar 22 0:00 1:00 - -Rule Iran 2001 2003 - Sep 22 0:00 0 - -Rule Iran 2004 only - Mar 21 0:00 1:00 - -Rule Iran 2004 only - Sep 21 0:00 0 - -Rule Iran 2005 only - Mar 22 0:00 1:00 - -Rule Iran 2005 only - Sep 22 0:00 0 - -Rule Iran 2008 only - Mar 21 0:00 1:00 - -Rule Iran 2008 only - Sep 21 0:00 0 - -Rule Iran 2009 2011 - Mar 22 0:00 1:00 - -Rule Iran 2009 2011 - Sep 22 0:00 0 - -Rule Iran 2012 only - Mar 21 0:00 1:00 - -Rule Iran 2012 only - Sep 21 0:00 0 - -Rule Iran 2013 2015 - Mar 22 0:00 1:00 - -Rule Iran 2013 2015 - Sep 22 0:00 0 - -Rule Iran 2016 only - Mar 21 0:00 1:00 - -Rule Iran 2016 only - Sep 21 0:00 0 - -Rule Iran 2017 2019 - Mar 22 0:00 1:00 - -Rule Iran 2017 2019 - Sep 22 0:00 0 - -Rule Iran 2020 only - Mar 21 0:00 1:00 - -Rule Iran 2020 only - Sep 21 0:00 0 - -Rule Iran 2021 2023 - Mar 22 0:00 1:00 - -Rule Iran 2021 2023 - Sep 22 0:00 0 - -Rule Iran 2024 only - Mar 21 0:00 1:00 - -Rule Iran 2024 only - Sep 21 0:00 0 - -Rule Iran 2025 2027 - Mar 22 0:00 1:00 - -Rule Iran 2025 2027 - Sep 22 0:00 0 - -Rule Iran 2028 2029 - Mar 21 0:00 1:00 - -Rule Iran 2028 2029 - Sep 21 0:00 0 - -Rule Iran 2030 2031 - Mar 22 0:00 1:00 - -Rule Iran 2030 2031 - Sep 22 0:00 0 - -Rule Iran 2032 2033 - Mar 21 0:00 1:00 - -Rule Iran 2032 2033 - Sep 21 0:00 0 - -Rule Iran 2034 2035 - Mar 22 0:00 1:00 - -Rule Iran 2034 2035 - Sep 22 0:00 0 - +Rule Iran 1978 1980 - Mar 20 24:00 1:00 - +Rule Iran 1978 only - Oct 20 24:00 0 - +Rule Iran 1979 only - Sep 18 24:00 0 - +Rule Iran 1980 only - Sep 22 24:00 0 - +Rule Iran 1991 only - May 2 24:00 1:00 - +Rule Iran 1992 1995 - Mar 21 24:00 1:00 - +Rule Iran 1991 1995 - Sep 21 24:00 0 - +Rule Iran 1996 only - Mar 20 24:00 1:00 - +Rule Iran 1996 only - Sep 20 24:00 0 - +Rule Iran 1997 1999 - Mar 21 24:00 1:00 - +Rule Iran 1997 1999 - Sep 21 24:00 0 - +Rule Iran 2000 only - Mar 20 24:00 1:00 - +Rule Iran 2000 only - Sep 20 24:00 0 - +Rule Iran 2001 2003 - Mar 21 24:00 1:00 - +Rule Iran 2001 2003 - Sep 21 24:00 0 - +Rule Iran 2004 only - Mar 20 24:00 1:00 - +Rule Iran 2004 only - Sep 20 24:00 0 - +Rule Iran 2005 only - Mar 21 24:00 1:00 - +Rule Iran 2005 only - Sep 21 24:00 0 - +Rule Iran 2008 only - Mar 20 24:00 1:00 - +Rule Iran 2008 only - Sep 20 24:00 0 - +Rule Iran 2009 2011 - Mar 21 24:00 1:00 - +Rule Iran 2009 2011 - Sep 21 24:00 0 - +Rule Iran 2012 only - Mar 20 24:00 1:00 - +Rule Iran 2012 only - Sep 20 24:00 0 - +Rule Iran 2013 2015 - Mar 21 24:00 1:00 - +Rule Iran 2013 2015 - Sep 21 24:00 0 - +Rule Iran 2016 only - Mar 20 24:00 1:00 - +Rule Iran 2016 only - Sep 20 24:00 0 - +Rule Iran 2017 2019 - Mar 21 24:00 1:00 - +Rule Iran 2017 2019 - Sep 21 24:00 0 - +Rule Iran 2020 only - Mar 20 24:00 1:00 - +Rule Iran 2020 only - Sep 20 24:00 0 - +Rule Iran 2021 2023 - Mar 21 24:00 1:00 - +Rule Iran 2021 2023 - Sep 21 24:00 0 - +Rule Iran 2024 only - Mar 20 24:00 1:00 - +Rule Iran 2024 only - Sep 20 24:00 0 - +Rule Iran 2025 2027 - Mar 21 24:00 1:00 - +Rule Iran 2025 2027 - Sep 21 24:00 0 - +Rule Iran 2028 2029 - Mar 20 24:00 1:00 - +Rule Iran 2028 2029 - Sep 20 24:00 0 - +Rule Iran 2030 2031 - Mar 21 24:00 1:00 - +Rule Iran 2030 2031 - Sep 21 24:00 0 - +Rule Iran 2032 2033 - Mar 20 24:00 1:00 - +Rule Iran 2032 2033 - Sep 20 24:00 0 - +Rule Iran 2034 2035 - Mar 21 24:00 1:00 - +Rule Iran 2034 2035 - Sep 21 24:00 0 - +Rule Iran 2036 2037 - Mar 20 24:00 1:00 - +Rule Iran 2036 2037 - Sep 20 24:00 0 - +Rule Iran 2038 2039 - Mar 21 24:00 1:00 - +Rule Iran 2038 2039 - Sep 21 24:00 0 - +Rule Iran 2040 2041 - Mar 20 24:00 1:00 - +Rule Iran 2040 2041 - Sep 20 24:00 0 - +Rule Iran 2042 2043 - Mar 21 24:00 1:00 - +Rule Iran 2042 2043 - Sep 21 24:00 0 - +Rule Iran 2044 2045 - Mar 20 24:00 1:00 - +Rule Iran 2044 2045 - Sep 20 24:00 0 - +Rule Iran 2046 2047 - Mar 21 24:00 1:00 - +Rule Iran 2046 2047 - Sep 21 24:00 0 - +Rule Iran 2048 2049 - Mar 20 24:00 1:00 - +Rule Iran 2048 2049 - Sep 20 24:00 0 - +Rule Iran 2050 2051 - Mar 21 24:00 1:00 - +Rule Iran 2050 2051 - Sep 21 24:00 0 - +Rule Iran 2052 2053 - Mar 20 24:00 1:00 - +Rule Iran 2052 2053 - Sep 20 24:00 0 - +Rule Iran 2054 2055 - Mar 21 24:00 1:00 - +Rule Iran 2054 2055 - Sep 21 24:00 0 - +Rule Iran 2056 2057 - Mar 20 24:00 1:00 - +Rule Iran 2056 2057 - Sep 20 24:00 0 - +Rule Iran 2058 2059 - Mar 21 24:00 1:00 - +Rule Iran 2058 2059 - Sep 21 24:00 0 - +Rule Iran 2060 2062 - Mar 20 24:00 1:00 - +Rule Iran 2060 2062 - Sep 20 24:00 0 - +Rule Iran 2063 only - Mar 21 24:00 1:00 - +Rule Iran 2063 only - Sep 21 24:00 0 - +Rule Iran 2064 2066 - Mar 20 24:00 1:00 - +Rule Iran 2064 2066 - Sep 20 24:00 0 - +Rule Iran 2067 only - Mar 21 24:00 1:00 - +Rule Iran 2067 only - Sep 21 24:00 0 - +Rule Iran 2068 2070 - Mar 20 24:00 1:00 - +Rule Iran 2068 2070 - Sep 20 24:00 0 - +Rule Iran 2071 only - Mar 21 24:00 1:00 - +Rule Iran 2071 only - Sep 21 24:00 0 - +Rule Iran 2072 2074 - Mar 20 24:00 1:00 - +Rule Iran 2072 2074 - Sep 20 24:00 0 - +Rule Iran 2075 only - Mar 21 24:00 1:00 - +Rule Iran 2075 only - Sep 21 24:00 0 - +Rule Iran 2076 2078 - Mar 20 24:00 1:00 - +Rule Iran 2076 2078 - Sep 20 24:00 0 - +Rule Iran 2079 only - Mar 21 24:00 1:00 - +Rule Iran 2079 only - Sep 21 24:00 0 - +Rule Iran 2080 2082 - Mar 20 24:00 1:00 - +Rule Iran 2080 2082 - Sep 20 24:00 0 - +Rule Iran 2083 only - Mar 21 24:00 1:00 - +Rule Iran 2083 only - Sep 21 24:00 0 - +Rule Iran 2084 2086 - Mar 20 24:00 1:00 - +Rule Iran 2084 2086 - Sep 20 24:00 0 - +Rule Iran 2087 only - Mar 21 24:00 1:00 - +Rule Iran 2087 only - Sep 21 24:00 0 - # -# The following rules are approximations starting in the year 2038. -# These are the best post-2037 approximations available, given the -# restrictions of a single rule using a Gregorian-based data format. +# The following rules are approximations starting in the year 2088. +# These are the best post-2088 approximations available, given the +# restrictions of a single rule using ordinary Gregorian dates. # At some point this table will need to be extended, though quite # possibly Iran will change the rules first. -Rule Iran 2036 max - Mar 21 0:00 1:00 - -Rule Iran 2036 max - Sep 21 0:00 0 - +Rule Iran 2088 max - Mar 20 24:00 1:00 - +Rule Iran 2088 max - Sep 20 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 @@ -1691,7 +1878,9 @@ Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u 9:00 Japan J%sT -# Since 1938, all Japanese possessions have been like Asia/Tokyo. +# Since 1938, all Japanese possessions have been like Asia/Tokyo, +# except that Truk (Chuuk), Ponape (Pohnpei), and Jaluit (Kosrae) did not +# switch from +10 to +09 until 1941-04-01; see the 'australasia' file. # Jordan # @@ -1981,8 +2170,10 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # and in Byalokoz) lists Ural river (plus 10 versts on its left bank) in # the third time belt (before 1930 this means +03). -# From Paul Eggert (2016-12-06): -# The tables below reflect Golosunov's remarks, with exceptions as noted. +# From Alexander Konzurovski (2018-12-20): +# Qyzyolrda Region (Asia/Qyzylorda) is changing its time zone from +# UTC+6 to UTC+5 effective December 21st, 2018. The legal document is +# located here: http://adilet.zan.kz/rus/docs/P1800000817 (russian language). # Zone NAME GMTOFF RULES FORMAT [UNTIL] # @@ -1996,8 +2187,6 @@ Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-A 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s 6:00 - +06 # Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY) -# This currently includes Qostanay (aka Kostanay, Kustanay) (KZ-KUS); -# see comments below. Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -2008,21 +2197,22 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s 6:00 RussiaAsia +06/+07 1992 Mar 29 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s - 6:00 - +06 -# The following zone is like Asia/Qyzylorda except for being one -# hour earlier from 1991-09-29 to 1992-03-29. The 1991/2 rules for -# Qostanay are unclear partly because of the 1997 Turgai -# reorganization, so this zone is commented out for now. -#Zone Asia/Qostanay 4:14:20 - LMT 1924 May 2 -# 4:00 - +04 1930 Jun 21 -# 5:00 - +05 1981 Apr 1 -# 5:00 1:00 +06 1981 Oct 1 -# 6:00 - +06 1982 Apr 1 -# 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s -# 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s -# 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s -# 6:00 - +06 + 6:00 - +06 2018 Dec 21 0:00 + 5:00 - +05 # +# Qostanay (aka Kostanay, Kustanay) (KZ-KUS) +# The 1991/2 rules are unclear partly because of the 1997 Turgai +# reorganization. +Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2 + 4:00 - +04 1930 Jun 21 + 5:00 - +05 1981 Apr 1 + 5:00 1:00 +06 1981 Oct 1 + 6:00 - +06 1982 Apr 1 + 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s + 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s + 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s + 6:00 - +06 + # Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 @@ -2116,21 +2306,43 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 # started at June 1 in that year. For another example, the article in # 1988 said that DST started at 2:00 AM in that year. +# From Phake Nick (2018-10-27): +# 1. According to official announcement from Korean government, the DST end +# date in South Korea should be +# 1955-09-08 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027977557 +# 1956-09-29 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027978341 +# 1957-09-21 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027979690#3 +# 1958-09-20 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027981189 +# 1959-09-19 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027982974#2 +# 1960-09-17 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0028044104 +# ... +# 2.... https://namu.wiki/w/대한민국%20표준시 ... [says] +# when Korea was using GMT+8:30 as standard time, the international +# aviation/marine/meteorological industry in the country refused to +# follow and continued to use GMT+9:00 for interoperability. + + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule ROK 1948 only - Jun 1 0:00 1:00 D -Rule ROK 1948 only - Sep 13 0:00 0 S -Rule ROK 1949 only - Apr 3 0:00 1:00 D -Rule ROK 1949 1951 - Sep Sun>=8 0:00 0 S -Rule ROK 1950 only - Apr 1 0:00 1:00 D -Rule ROK 1951 only - May 6 0:00 1:00 D -Rule ROK 1955 only - May 5 0:00 1:00 D -Rule ROK 1955 only - Sep 9 0:00 0 S -Rule ROK 1956 only - May 20 0:00 1:00 D -Rule ROK 1956 only - Sep 30 0:00 0 S -Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D -Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S -Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D -Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S +Rule ROK 1948 only - Jun 1 0:00 1:00 D +Rule ROK 1948 only - Sep 12 24:00 0 S +Rule ROK 1949 only - Apr 3 0:00 1:00 D +Rule ROK 1949 1951 - Sep Sat>=7 24:00 0 S +Rule ROK 1950 only - Apr 1 0:00 1:00 D +Rule ROK 1951 only - May 6 0:00 1:00 D +Rule ROK 1955 only - May 5 0:00 1:00 D +Rule ROK 1955 only - Sep 8 24:00 0 S +Rule ROK 1956 only - May 20 0:00 1:00 D +Rule ROK 1956 only - Sep 29 24:00 0 S +Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D +Rule ROK 1957 1960 - Sep Sat>=17 24:00 0 S +Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D +Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # From Paul Eggert (2016-08-23): # The Korean Wikipedia entry gives the following sources for UT offsets: @@ -2920,6 +3132,11 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # no information # Philippines + +# From Paul Eggert (2018-11-18): +# The Spanish initially used American (west-of-Greenwich) time. +# It is unknown what time Manila kept when the British occupied it from +# 1762-10-06 through 1764-04; for now assume it kept American time. # On 1844-08-16, Narciso Clavería, governor-general of the # Philippines, issued a proclamation announcing that 1844-12-30 was to # be immediately followed by 1845-01-01; see R.H. van Gent's @@ -3005,8 +3222,8 @@ Link Asia/Qatar Asia/Bahrain # going to run on Higgins Time.' And so, until last year, it did." See: # Antar E. Dinner at When? Saudi Aramco World, 1969 March/April. 2-3. # http://archive.aramcoworld.com/issue/196902/dinner.at.when.htm -# newspapers.com says a similar story about Higgins was published in the Port -# Angeles (WA) Evening News, 1965-03-10, page 5, but I lack access to the text. +# Also see: Antar EN. Arabian flying is confusing. +# Port Angeles (WA) Evening News. 1965-03-10. page 3. # # The TZ database cannot represent quasi-solar time; airline time is the best # we can do. The 1946 foreign air news digest of the U.S. Civil Aeronautics Modified: stable/12/contrib/tzdata/australasia ============================================================================== --- stable/12/contrib/tzdata/australasia Tue Jan 1 04:57:46 2019 (r342666) +++ stable/12/contrib/tzdata/australasia Tue Jan 1 10:04:49 2019 (r342667) @@ -402,10 +402,44 @@ Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete # it is uninhabited. # Guam + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# http://guamlegislature.com/Public_Laws_5th/PL05-025.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-59-7-Guam-Daylight-Savings-Time-May-6-1959.pdf +Rule Guam 1959 only - Jun 27 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-61-5-Revocation-of-Daylight-Saving-Time-and-Restoratio.pdf +Rule Guam 1961 only - Jan 29 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-67-13-Guam-Daylight-Savings-Time.pdf +Rule Guam 1967 only - Sep 1 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-69-2-Repeal-of-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jan 26 0:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-69-10-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jun 22 2:00 1:00 D +Rule Guam 1969 only - Aug 31 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-70-10-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-70-30-End-of-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-71-5-Guam-Daylight-Savings-Time.pdf +Rule Guam 1970 1971 - Apr lastSun 2:00 1:00 D +Rule Guam 1970 1971 - Sep Sun>=1 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-73-28.-Guam-Day-light-Saving-Time.pdf +Rule Guam 1973 only - Dec 16 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-74-7-Guam-Daylight-Savings-Time-Rescinded.pdf +Rule Guam 1974 only - Feb 24 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-76-13-Daylight-Savings-Time.pdf +Rule Guam 1976 only - May 26 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-76-25-Revocation-of-E.O.-76-13.pdf +Rule Guam 1976 only - Aug 22 2:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-77-4-Daylight-Savings-Time.pdf +Rule Guam 1977 only - Apr 24 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-77-18-Guam-Standard-Time.pdf +Rule Guam 1977 only - Aug 28 2:00 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Guam -14:21:00 - LMT 1844 Dec 31 9:39:00 - LMT 1901 # Agana - 10:00 - GST 2000 Dec 23 # Guam + 10:00 - GST 1941 Dec 10 # Guam + 9:00 - +09 1944 Jul 31 + 10:00 Guam G%sT 2000 Dec 23 10:00 - ChST # Chamorro Standard Time Link Pacific/Guam Pacific/Saipan # N Mariana Is @@ -427,31 +461,56 @@ Zone Pacific/Kiritimati -10:29:20 - LMT 1901 # Marshall Is # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Majuro 11:24:48 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 -Zone Pacific/Kwajalein 11:09:20 - LMT 1901 - 11:00 - +11 1969 Oct - -12:00 - -12 1993 Aug 20 - 12:00 - +12 +Zone Pacific/Majuro 11:24:48 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Jan 30 + 11:00 - +11 1969 Oct + 12:00 - +12 +Zone Pacific/Kwajalein 11:09:20 - LMT 1901 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Feb 6 + 11:00 - +11 1969 Oct + -12:00 - -12 1993 Aug 20 24:00 + 12:00 - +12 # Micronesia # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Chuuk 10:07:08 - LMT 1901 - 10:00 - +10 -Zone Pacific/Pohnpei 10:32:52 - LMT 1901 # Kolonia - 11:00 - +11 -Zone Pacific/Kosrae 10:51:56 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 1999 - 11:00 - +11 +Zone Pacific/Chuuk -13:52:52 - LMT 1844 Dec 31 + 10:07:08 - LMT 1901 + 10:00 - +10 1914 Oct + 9:00 - +09 1919 Feb 1 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 10:00 - +10 +Zone Pacific/Pohnpei -13:27:08 - LMT 1844 Dec 31 # Kolonia + 10:32:52 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 +Zone Pacific/Kosrae -13:08:04 - LMT 1844 Dec 31 + 10:51:56 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 1969 Oct + 12:00 - +12 1999 + 11:00 - +11 # Nauru # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe - 11:30 - +1130 1942 Mar 15 - 9:00 - +09 1944 Aug 15 - 11:30 - +1130 1979 May + 11:30 - +1130 1942 Aug 29 + 9:00 - +09 1945 Sep 8 + 11:30 - +1130 1979 Feb 10 2:00 12:00 - +12 # New Caledonia @@ -552,8 +611,9 @@ Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Palau 8:57:56 - LMT 1901 # Koror - 9:00 - +09 +Zone Pacific/Palau -15:02:04 - LMT 1844 Dec 31 # Koror + 8:57:56 - LMT 1901 + 9:00 - +09 # Papua New Guinea *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 1 10:05:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19BE014329CD; Tue, 1 Jan 2019 10:05:14 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA8EB8D754; Tue, 1 Jan 2019 10:05:13 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABAF520806; Tue, 1 Jan 2019 10:05:13 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x01A5D4H010993; Tue, 1 Jan 2019 10:05:13 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x01A5Cah010987; Tue, 1 Jan 2019 10:05:12 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201901011005.x01A5Cah010987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Tue, 1 Jan 2019 10:05:12 +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: r342668 - stable/11/contrib/tzdata X-SVN-Group: stable-11 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/11/contrib/tzdata X-SVN-Commit-Revision: 342668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA8EB8D754 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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: Tue, 01 Jan 2019 10:05:14 -0000 Author: philip Date: Tue Jan 1 10:05:12 2019 New Revision: 342668 URL: https://svnweb.freebsd.org/changeset/base/342668 Log: MFC r342613: Import tzdata 2018h MFC r342644: Import tzdata 2018i Modified: stable/11/contrib/tzdata/Makefile stable/11/contrib/tzdata/NEWS stable/11/contrib/tzdata/africa stable/11/contrib/tzdata/asia stable/11/contrib/tzdata/australasia stable/11/contrib/tzdata/leapseconds stable/11/contrib/tzdata/leapseconds.awk stable/11/contrib/tzdata/northamerica stable/11/contrib/tzdata/theory.html stable/11/contrib/tzdata/version stable/11/contrib/tzdata/ziguard.awk stable/11/contrib/tzdata/zone.tab stable/11/contrib/tzdata/zone1970.tab Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tzdata/Makefile ============================================================================== --- stable/11/contrib/tzdata/Makefile Tue Jan 1 10:04:49 2019 (r342667) +++ stable/11/contrib/tzdata/Makefile Tue Jan 1 10:05:12 2019 (r342668) @@ -380,15 +380,18 @@ AWK= awk # is typically nicer if it works. KSHELL= /bin/bash +# Name of curl , used for HTML validation. +CURL= curl + # The path where SGML DTDs are kept and the catalog file(s) to use when -# validating. The default should work on both Debian and Red Hat. +# validating HTML 4.01. The default should work on both Debian and Red Hat. SGML_TOPDIR= /usr SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224 SGML_CATALOG_FILES= \ $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat -# The name, arguments and environment of a program to validate your web pages. +# The name, arguments and environment of a program to validate HTML 4.01. # See for a validator, and # for a validation library. # Set VALIDATE=':' if you do not have such a program. @@ -488,6 +491,7 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.t COMMON= calendars CONTRIBUTING LICENSE Makefile \ NEWS README theory.html version WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +CHECK_WEB_PAGES=check_tz-art.html check_tz-how-to.html check_tz-link.html DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) PRIMARY_YDATA= africa antarctica asia australasia \ europe northamerica southamerica @@ -799,9 +803,15 @@ check_tzs: $(TZS) $(TZS_NEW) fi touch $@ -# This checks only the HTML 4.01 strict page. -# To check the the other pages, use . -check_web: tz-how-to.html +check_web: $(CHECK_WEB_PAGES) +check_tz-art.html: tz-art.html +check_tz-link.html: tz-link.html +check_tz-art.html check_tz-link.html: + $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ + -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \ + test ! -s $@.out || { cat $@.out; exit 1; } + mv $@.out $@ +check_tz-how-to.html: tz-how-to.html $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html touch $@ @@ -1068,7 +1078,7 @@ zic.o: private.h tzfile.h version.h .PHONY: ALL INSTALL all .PHONY: check check_time_t_alternatives -.PHONY: check_zishrink +.PHONY: check_web check_zishrink .PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names .PHONY: posix_only posix_packrat posix_right public Modified: stable/11/contrib/tzdata/NEWS ============================================================================== --- stable/11/contrib/tzdata/NEWS Tue Jan 1 10:04:49 2019 (r342667) +++ stable/11/contrib/tzdata/NEWS Tue Jan 1 10:05:12 2019 (r342668) @@ -1,14 +1,103 @@ News for the tz database +Release 2018i - 2018-12-30 11:05:43 -0800 + + Briefly: + São Tomé and Príncipe switches from +01 to +00 on 2019-01-01. + + Changes to future timestamps + + Due to a change in government, São Tomé and Príncipe switches back + from +01 to +00 on 2019-01-01 at 02:00. (Thanks to Vadim + Nasardinov and Michael Deckers.) + + +Release 2018h - 2018-12-23 17:59:32 -0800 + + Briefly: + Qyzylorda, Kazakhstan moved from +06 to +05 on 2018-12-21. + New zone Asia/Qostanay because Qostanay, Kazakhstan didn't move. + Metlakatla, Alaska observes PST this winter only. + Guess Morocco will continue to adjust clocks around Ramadan. + Add predictions for Iran from 2038 through 2090. + + Changes to future timestamps + + Guess that Morocco will continue to fall back just before and + spring forward just after Ramadan, the practice since 2012. + (Thanks to Maamar Abdelkader.) This means Morocco will observe + negative DST during Ramadan in main and vanguard formats, and in + rearguard format it stays in the +00 timezone and observes + ordinary DST in all months other than Ramadan. As before, extend + this guesswork to the year 2037. As a consequence, Morocco is + scheduled to observe three DST transitions in some Gregorian years + (e.g., 2033) due to the mismatch between the Gregorian and Islamic + calendars. + + The table of exact transitions for Iranian DST has been extended. + It formerly cut off before the year 2038 in a nod to 32-bit time_t. + It now cuts off before 2091 as there is doubt about how the Persian + calendar will treat 2091. This change predicts DST transitions in + 2038-9, 2042-3, and 2046-7 to occur one day later than previously + predicted. As before, post-cutoff transitions are approximated. + + Changes to past and future timestamps + + Qyzylorda (aka Kyzylorda) oblast in Kazakhstan moved from +06 to + +05 on 2018-12-21. This is a zone split as Qostanay (aka + Kostanay) did not switch, so create a zone Asia/Qostanay. + + Metlakatla moved from Alaska to Pacific standard time on 2018-11-04. + It did not change clocks that day and remains on -08 this winter. + (Thanks to Ryan Stanley.) It will revert to the usual Alaska + rules next spring, so this change affects only timestamps + from 2018-11-04 through 2019-03-10. + + Change to past timestamps + + Kwajalein's 1993-08-20 transition from -12 to +12 was at 24:00, + not 00:00. I transcribed the time incorrectly from Shanks. + (Thanks to Phake Nick.) + + Nauru's 1979 transition was on 02-10 at 02:00, not 05-01 at 00:00. + (Thanks to Phake Nick.) + + Guam observed DST irregularly from 1959 through 1977. + (Thanks to Phake Nick.) + + Hong Kong observed DST in 1941 starting 06-15 (not 04-01), then on + 10-01 changed standard time to +08:30 (not +08). Its transition + back to +08 after WWII was on 1945-09-15, not the previous day. + Its 1904-10-30 change took effect at 01:00 +08 (not 00:00 LMT). + (Thanks to Phake Nick, Steve Allen, and Joseph Myers.) Also, + its 1952 fallback was on 11-02 (not 10-25). + + This release contains many changes to timestamps before 1946 due + to Japanese possession or occupation of Pacific/Chuuk, + Pacific/Guam, Pacific/Kosrae, Pacific/Kwajalein, Pacific/Majuro, + Pacific/Nauru, Pacific/Palau, and Pacific/Pohnpei. + (Thanks to Phake Nick.) + + Assume that the Spanish East Indies was like the Philippines and + observed American time until the end of 1844. This affects + Pacific/Chuuk, Pacific/Kosrae, Pacific/Palau, and Pacific/Pohnpei. + + Changes to past tm_isdst flags + + For the recent Morocco change, the tm_isdst flag should be 1 from + 2018-10-27 00:00 to 2018-10-28 03:00. (Thanks to Michael Deckers.) + Give a URL to the official decree. (Thanks to Matt Johnson.) + + Release 2018g - 2018-10-26 22:22:45 -0700 Briefly: - Morocco switches to permanent +01 on 2018-10-27. + Morocco switches to permanent +01 on 2018-10-28. Changes to future timestamps - Morocco switches from +00/+01 to permanent +01 effective 2018-10-27, - so its clocks will not fall back on 2018-10-28 as previously scheduled. + Morocco switches from +00/+01 to permanent +01 effective 2018-10-28, + so its clocks will not fall back as previously scheduled. (Thanks to Mohamed Essedik Najd and Brian Inglis.) Changes to code @@ -119,7 +208,7 @@ Release 2018f - 2018-10-18 00:14:18 -0700 localtime.c no longer ignores TZif POSIX-style TZ strings that specify only standard time. Instead, these TZ strings now override the default time type for timestamps after the last - transition (or for all time stamps if there are no transitions), + transition (or for all timestamps if there are no transitions), just as DST strings specifying DST have always done. leapseconds.awk now outputs "#updated" and "#expires" comments, Modified: stable/11/contrib/tzdata/africa ============================================================================== --- stable/11/contrib/tzdata/africa Tue Jan 1 10:04:49 2019 (r342667) +++ stable/11/contrib/tzdata/africa Tue Jan 1 10:05:12 2019 (r342668) @@ -847,8 +847,41 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # From Mohamed Essedik Najd (2018-10-26): # Today, a Moroccan government council approved the perpetual addition # of 60 minutes to the regular Moroccan timezone. -# From Brian Inglis (2018-10-26): -# http://www.maroc.ma/fr/actualites/le-conseil-de-gouvernement-adopte-un-projet-de-decret-relatif-lheure-legale-stipulant-le +# From Matt Johnson (2018-10-28): +# http://www.sgg.gov.ma/Portals/1/BO/2018/BO_6720-bis_Ar.pdf +# +# From Maamar Abdelkader (2018-11-01): +# We usually move clocks back the previous week end and come back to the +1 +# the week end after.... The government does not announce yet the decision +# about this temporary change. But it s 99% sure that it will be the case, +# as in previous years. An unofficial survey was done these days, showing +# that 64% of asked peopke are ok for moving from +1 to +0 during Ramadan. +# https://leconomiste.com/article/1035870-enquete-l-economiste-sunergia-64-des-marocains-plebiscitent-le-gmt-pendant-ramadan +# +# From Paul Eggert (2018-11-01): +# For now, guess that Morocco will fall back at 03:00 the last Sunday +# before Ramadan, and spring forward at 02:00 the first Sunday after +# Ramadan, as this has been the practice since 2012. To implement this, +# transition dates for 2019 through 2037 were determined by running the +# following program under GNU Emacs 26.1. +# (let ((islamic-year 1440)) +# (require 'cal-islam) +# (while (< islamic-year 1460) +# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) +# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (sunday 0)) +# (while (/= sunday (mod (setq a (1- a)) 7))) +# (while (/= sunday (mod b 7)) +# (setq b (1+ b))) +# (setq a (calendar-gregorian-from-absolute a)) +# (setq b (calendar-gregorian-from-absolute b)) +# (insert +# (format +# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t-1:00\t-\n" +# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t0\t-\n") +# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) +# (setq islamic-year (+ 1 islamic-year)))) # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Morocco 1939 only - Sep 12 0:00 1:00 - @@ -892,13 +925,53 @@ Rule Morocco 2017 only - May 21 3:00 0 - Rule Morocco 2017 only - Jul 2 2:00 1:00 - Rule Morocco 2018 only - May 13 3:00 0 - Rule Morocco 2018 only - Jun 17 2:00 1:00 - +Rule Morocco 2019 only - May 5 3:00 -1:00 - +Rule Morocco 2019 only - Jun 9 2:00 0 - +Rule Morocco 2020 only - Apr 19 3:00 -1:00 - +Rule Morocco 2020 only - May 24 2:00 0 - +Rule Morocco 2021 only - Apr 11 3:00 -1:00 - +Rule Morocco 2021 only - May 16 2:00 0 - +Rule Morocco 2022 only - Mar 27 3:00 -1:00 - +Rule Morocco 2022 only - May 8 2:00 0 - +Rule Morocco 2023 only - Mar 19 3:00 -1:00 - +Rule Morocco 2023 only - Apr 23 2:00 0 - +Rule Morocco 2024 only - Mar 10 3:00 -1:00 - +Rule Morocco 2024 only - Apr 14 2:00 0 - +Rule Morocco 2025 only - Feb 23 3:00 -1:00 - +Rule Morocco 2025 only - Apr 6 2:00 0 - +Rule Morocco 2026 only - Feb 15 3:00 -1:00 - +Rule Morocco 2026 only - Mar 22 2:00 0 - +Rule Morocco 2027 only - Feb 7 3:00 -1:00 - +Rule Morocco 2027 only - Mar 14 2:00 0 - +Rule Morocco 2028 only - Jan 23 3:00 -1:00 - +Rule Morocco 2028 only - Feb 27 2:00 0 - +Rule Morocco 2029 only - Jan 14 3:00 -1:00 - +Rule Morocco 2029 only - Feb 18 2:00 0 - +Rule Morocco 2029 only - Dec 30 3:00 -1:00 - +Rule Morocco 2030 only - Feb 10 2:00 0 - +Rule Morocco 2030 only - Dec 22 3:00 -1:00 - +Rule Morocco 2031 only - Jan 26 2:00 0 - +Rule Morocco 2031 only - Dec 14 3:00 -1:00 - +Rule Morocco 2032 only - Jan 18 2:00 0 - +Rule Morocco 2032 only - Nov 28 3:00 -1:00 - +Rule Morocco 2033 only - Jan 9 2:00 0 - +Rule Morocco 2033 only - Nov 20 3:00 -1:00 - +Rule Morocco 2033 only - Dec 25 2:00 0 - +Rule Morocco 2034 only - Nov 5 3:00 -1:00 - +Rule Morocco 2034 only - Dec 17 2:00 0 - +Rule Morocco 2035 only - Oct 28 3:00 -1:00 - +Rule Morocco 2035 only - Dec 2 2:00 0 - +Rule Morocco 2036 only - Oct 19 3:00 -1:00 - +Rule Morocco 2036 only - Nov 23 2:00 0 - +Rule Morocco 2037 only - Oct 4 3:00 -1:00 - +Rule Morocco 2037 only - Nov 15 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 0:00 Morocco +00/+01 1984 Mar 16 1:00 - +01 1986 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Western Sahara # @@ -913,8 +986,8 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún -1:00 - -01 1976 Apr 14 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Mozambique # @@ -1071,10 +1144,20 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Den # the switch is from 01:00 to 02:00 ... [Decree No. 25/2017] # http://www.mnec.gov.st/index.php/publicacoes/documentos/file/90-decreto-lei-n-25-2017 +# From Vadim Nasardinov (2018-12-29): +# São Tomé and Príncipe is about to do the following on Jan 1, 2019: +# https://www.stp-press.st/2018/12/05/governo-jesus-ja-decidiu-repor-hora-legal-sao-tomense/ +# +# From Michael Deckers (2018-12-30): +# https://www.legis-palop.org/download.jsp?idFile=102818 +# ... [The legal time of the country, which coincides with universal +# coordinated time, will be restituted at 2 o'clock on day 1 of January, 2019.] + Zone Africa/Sao_Tome 0:26:56 - LMT 1884 -0:36:45 - LMT 1912 Jan 1 00:00u # Lisbon MT 0:00 - GMT 2018 Jan 1 01:00 - 1:00 - WAT + 1:00 - WAT 2019 Jan 1 02:00 + 0:00 - GMT # Senegal # See Africa/Abidjan. Modified: stable/11/contrib/tzdata/asia ============================================================================== --- stable/11/contrib/tzdata/asia Tue Jan 1 10:04:49 2019 (r342667) +++ stable/11/contrib/tzdata/asia Tue Jan 1 10:05:12 2019 (r342668) @@ -586,12 +586,82 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # obtained from # http://www.hko.gov.hk/gts/time/Summertime.htm -# From Arthur David Olson (2009-10-28): +# From Phake Nick (2018-10-27): +# According to Singaporean newspaper +# http://eresources.nlb.gov.sg/newspapers/Digitised/Article/singfreepresswk19041102-1.2.37 +# the day that Hong Kong start using GMT+8 should be Oct 30, 1904. +# +# From Paul Eggert (2018-11-17): +# Hong Kong had a time ball near the Marine Police Station, Tsim Sha Tsui. +# "The ball was raised manually each day and dropped at exactly 1pm +# (except on Sundays and Government holidays)." +# Dyson AD. From Time Ball to Atomic Clock. Hong Kong Government. 1983. +# +# "From 1904 October 30 the time-ball at Hong Kong has been dropped by order +# of the Governor of the Colony at 17h 0m 0s G.M.T., which is 23m 18s.14 in +# advance of 1h 0m 0s of Hong Kong mean time." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 +# +# From Joseph Myers (2018-11-18): +# An astronomer before 1925 referring to GMT would have been using the old +# astronomical convention where the day started at noon, not midnight. +# +# From Steve Allen (2018-11-17): +# Meteorological Observations made at the Hongkong Observatory in the year 1904 +# page 4 +# ... the log of drop times in Table II shows that on Sunday 1904-10-30 the +# ball was dropped. So that looks like a special case drop for the sake +# of broadcasting the new local time. +# +# From Phake Nick (2018-11-18): +# According to The Hong Kong Weekly Press, 1904-10-29, p.324, the +# governor of Hong Kong at the time stated that "We are further desired to +# make it known that the change will be effected by firing the gun and by the +# dropping of the Ball at 23min. 18sec. before one." +# From Paul Eggert (2018-11-18): +# See for this; unfortunately Flash is required. + +# From Phake Nick (2018-10-26): +# I went to check microfilm records stored at Hong Kong Public Library.... +# on September 30 1941, according to Ta Kung Pao (Hong Kong edition), it was +# stated that fallback would occur on the next day (the 1st)'s "03:00 am (Hong +# Kong Time 04:00 am)" and the clock will fall back for a half hour. (03:00 +# probably refer to the time commonly used in mainland China at the time given +# the paper's background) ... the sunrise/sunset time given by South China +# Morning Post for October 1st was indeed moved by half an hour compares to +# before. After that, in December, the battle to capture Hong Kong started and +# the library doesn't seems to have any record stored about press during that +# period of time. Some media resumed publication soon after that within the +# same month, but there were not much information about time there. Later they +# started including a radio program guide when they restored radio service, +# explicitly mentioning it use Tokyo standard time, and later added a note +# saying it's half an hour ahead of the old Hong Kong standard time, and it +# also seems to indicate that Hong Kong was not using GMT+8 when it was +# captured by Japan. +# +# Image of related sections on newspaper: +# * 1941-09-30, Ta Kung Pao (Hong Kong), "Winter Time start tomorrow". +# https://i.imgur.com/6waY51Z.jpg (Chinese) +# * 1941-09-29, South China Morning Post, Information on sunrise/sunset +# time and other things for September 30 and October 1. +# https://i.imgur.com/kCiUR78.jpg +# * 1942-02-05. The Hong Kong News, Radio Program Guide. +# https://i.imgur.com/eVvDMzS.jpg +# * 1941-06-14. Hong Kong Daily Press, Daylight Saving from 3am Tomorrow. +# https://i.imgur.com/05KkvtC.png +# * 1941-09-30, Hong Kong Daily Press, Winter Time Warning. +# https://i.imgur.com/dge4kFJ.png +# Also, the Liberation day of Hong Kong after WWII which British rule +# over the territory resumed was August 30, 1945, which I think should +# be the termination date for the use of JST in the territory.... + +# From Paul Eggert (2018-11-17): # Here are the dates given at -# http://www.hko.gov.hk/gts/time/Summertime.htm -# as of 2009-10-28: +# https://www.hko.gov.hk/gts/time/Summertime.htm +# as of 2014-06-19: # Year Period -# 1941 1 Apr to 30 Sep +# 1941 15 Jun to 30 Sep # 1942 Whole year # 1943 Whole year # 1944 Whole year @@ -602,7 +672,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1949 3 Apr to 30 Oct # 1950 2 Apr to 29 Oct # 1951 1 Apr to 28 Oct -# 1952 6 Apr to 25 Oct +# 1952 6 Apr to 2 Nov # 1953 5 Apr to 1 Nov # 1954 21 Mar to 31 Oct # 1955 20 Mar to 6 Nov @@ -631,25 +701,25 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1978 Nil # 1979 13 May to 21 Oct # 1980 to Now Nil -# The page does not give start or end times of day. -# The page does not give a start date for 1942. -# The page does not givw an end date for 1945. -# The Japanese occupation of Hong Kong began on 1941-12-25. -# The Japanese surrender of Hong Kong was signed 1945-09-15. -# For lack of anything better, use start of those days as the transition times. +# The page does not give times of day for transitions, +# or dates for the 1942 and 1945 transitions. +# The Japanese occupation of Hong Kong began 1941-12-25. +# The Japanese surrender of Hong Kong was signed 1945-09-16; see: +# Heaver S. The days after the Pacific war ended: unsettling times +# in Hong Kong. Post Magazine. 2016-06-13. +# https://www.scmp.com/magazines/post-magazine/article/1852990/days-after-pacific-war-ended-unsettling-times-hong-kong +# For lack of anything better, use start of those days as the +# transition times. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule HK 1941 only - Apr 1 3:30 1:00 S -Rule HK 1941 only - Sep 30 3:30 0 - Rule HK 1946 only - Apr 20 3:30 1:00 S Rule HK 1946 only - Dec 1 3:30 0 - Rule HK 1947 only - Apr 13 3:30 1:00 S Rule HK 1947 only - Dec 30 3:30 0 - Rule HK 1948 only - May 2 3:30 1:00 S Rule HK 1948 1951 - Oct lastSun 3:30 0 - -Rule HK 1952 only - Oct 25 3:30 0 - +Rule HK 1952 1953 - Nov Sun>=1 3:30 0 - Rule HK 1949 1953 - Apr Sun>=1 3:30 1:00 S -Rule HK 1953 only - Nov 1 3:30 0 - Rule HK 1954 1964 - Mar Sun>=18 3:30 1:00 S Rule HK 1954 only - Oct 31 3:30 0 - Rule HK 1955 1964 - Nov Sun>=1 3:30 0 - @@ -659,9 +729,11 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S Rule HK 1979 only - May Sun>=8 3:30 1:00 S Rule HK 1979 only - Oct Sun>=16 3:30 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 - 8:00 HK HK%sT 1941 Dec 25 - 9:00 - JST 1945 Sep 15 +Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42 + 8:00 - HKT 1941 Jun 15 3:30 + 8:00 1:00 HKST 1941 Oct 1 4:00 + 8:30 - HKT 1941 Dec 25 + 9:00 - JST 1945 Sep 16 8:00 HK HK%sT ############################################################################### @@ -1057,6 +1129,16 @@ Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 # India +# British astronomer Henry Park Hollis disliked India Standard Time's offset: +# "A new time system has been proposed for India, Further India, and Burmah. +# The scheme suggested is that the times of the meridians 5½ and 6½ hours +# east of Greenwich should be adopted in these territories. No reason is +# given why hourly meridians five hours and six hours east should not be +# chosen; a plan which would bring the time of India into harmony with +# that of almost the whole of the civilised world." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 + # From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic # https://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/ # (2015-12-22): @@ -1227,12 +1309,65 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # leap year calculation involved. There has never been any serious # plan to change that law.... # -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2018-11-30): # Go with Shanks & Pottenger before Sept. 1991, and with Pournader thereafter. -# I used Ed Reingold's cal-persia in GNU Emacs 21.2 to check Persian dates, -# stopping after 2037 when 32-bit time_t's overflow. -# That cal-persia used Birashk's approximation, which disagrees with the solar -# calendar predictions for the year 2025, so I corrected those dates by hand. +# I used the following code in GNU Emacs 26.1 to generate the "Rule Iran" +# lines from 2008 through 2087. Emacs 26.1 uses Ed Reingold's +# cal-persia implementation of Birashk's approximation, which in the +# 2008-2087 range disagrees with the the astronomical Persian calendar +# for Persian years 1404 (Gregorian 2025) and 1437 (Gregorian 2058), +# so the following code special-case those years. See Table 15.1, page 264, of: +# Edward M. Reingold and Nachum Dershowitz, Calendrical Calculations: +# The Ultimate Edition, Cambridge University Press (2018). +# https://www.cambridge.org/fr/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition +# Page 258, footnote 2, of this book says there is some dispute over what will +# happen in 2091 (and some other years after that), so this code +# stops in 2087, as 2088 and 2089 agree with the "max" rule below. +# (cl-loop +# initially (require 'cal-persia) +# with first-persian-year = 1387 +# with last-persian-year = 1466 +# ;; Exceptional years in the above range, +# ;; from Reingold & Dershowitz Table 15.1, page 264: +# with exceptional-persian-years = '(1404 1437) +# with range-start = nil +# for persian-year from first-persian-year to last-persian-year +# do +# (let* +# ((exceptional-year-offset +# (if (member persian-year exceptional-persian-years) 1 0)) +# (beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 persian-year)) +# exceptional-year-offset)) +# (end-dst-absolute +# (+ (calendar-persian-to-absolute (list 6 30 persian-year)) +# exceptional-year-offset)) +# (next-year-beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 (1+ persian-year))) +# (if (member (1+ persian-year) exceptional-persian-years) 1 0))) +# (beg-dst (calendar-gregorian-from-absolute beg-dst-absolute)) +# (end-dst (calendar-gregorian-from-absolute end-dst-absolute)) +# (next-year-beg-dst (calendar-gregorian-from-absolute +# next-year-beg-dst-absolute)) +# (year (calendar-extract-year beg-dst)) +# (range-end (if range-start year "only"))) +# (setq range-start (or range-start year)) +# (when (or (/= (calendar-extract-day beg-dst) +# (calendar-extract-day next-year-beg-dst)) +# (= persian-year last-persian-year)) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t1:00\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month beg-dst) t) +# (calendar-extract-day beg-dst))) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t0\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month end-dst) t) +# (calendar-extract-day end-dst))) +# (setq range-start nil)))) # # From Oscar van Vlijmen (2005-03-30), writing about future # discrepancies between cal-persia and the Iranian calendar: @@ -1267,61 +1402,113 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # thirtieth day of Shahrivar. # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iran 1978 1980 - Mar 21 0:00 1:00 - -Rule Iran 1978 only - Oct 21 0:00 0 - -Rule Iran 1979 only - Sep 19 0:00 0 - -Rule Iran 1980 only - Sep 23 0:00 0 - -Rule Iran 1991 only - May 3 0:00 1:00 - -Rule Iran 1992 1995 - Mar 22 0:00 1:00 - -Rule Iran 1991 1995 - Sep 22 0:00 0 - -Rule Iran 1996 only - Mar 21 0:00 1:00 - -Rule Iran 1996 only - Sep 21 0:00 0 - -Rule Iran 1997 1999 - Mar 22 0:00 1:00 - -Rule Iran 1997 1999 - Sep 22 0:00 0 - -Rule Iran 2000 only - Mar 21 0:00 1:00 - -Rule Iran 2000 only - Sep 21 0:00 0 - -Rule Iran 2001 2003 - Mar 22 0:00 1:00 - -Rule Iran 2001 2003 - Sep 22 0:00 0 - -Rule Iran 2004 only - Mar 21 0:00 1:00 - -Rule Iran 2004 only - Sep 21 0:00 0 - -Rule Iran 2005 only - Mar 22 0:00 1:00 - -Rule Iran 2005 only - Sep 22 0:00 0 - -Rule Iran 2008 only - Mar 21 0:00 1:00 - -Rule Iran 2008 only - Sep 21 0:00 0 - -Rule Iran 2009 2011 - Mar 22 0:00 1:00 - -Rule Iran 2009 2011 - Sep 22 0:00 0 - -Rule Iran 2012 only - Mar 21 0:00 1:00 - -Rule Iran 2012 only - Sep 21 0:00 0 - -Rule Iran 2013 2015 - Mar 22 0:00 1:00 - -Rule Iran 2013 2015 - Sep 22 0:00 0 - -Rule Iran 2016 only - Mar 21 0:00 1:00 - -Rule Iran 2016 only - Sep 21 0:00 0 - -Rule Iran 2017 2019 - Mar 22 0:00 1:00 - -Rule Iran 2017 2019 - Sep 22 0:00 0 - -Rule Iran 2020 only - Mar 21 0:00 1:00 - -Rule Iran 2020 only - Sep 21 0:00 0 - -Rule Iran 2021 2023 - Mar 22 0:00 1:00 - -Rule Iran 2021 2023 - Sep 22 0:00 0 - -Rule Iran 2024 only - Mar 21 0:00 1:00 - -Rule Iran 2024 only - Sep 21 0:00 0 - -Rule Iran 2025 2027 - Mar 22 0:00 1:00 - -Rule Iran 2025 2027 - Sep 22 0:00 0 - -Rule Iran 2028 2029 - Mar 21 0:00 1:00 - -Rule Iran 2028 2029 - Sep 21 0:00 0 - -Rule Iran 2030 2031 - Mar 22 0:00 1:00 - -Rule Iran 2030 2031 - Sep 22 0:00 0 - -Rule Iran 2032 2033 - Mar 21 0:00 1:00 - -Rule Iran 2032 2033 - Sep 21 0:00 0 - -Rule Iran 2034 2035 - Mar 22 0:00 1:00 - -Rule Iran 2034 2035 - Sep 22 0:00 0 - +Rule Iran 1978 1980 - Mar 20 24:00 1:00 - +Rule Iran 1978 only - Oct 20 24:00 0 - +Rule Iran 1979 only - Sep 18 24:00 0 - +Rule Iran 1980 only - Sep 22 24:00 0 - +Rule Iran 1991 only - May 2 24:00 1:00 - +Rule Iran 1992 1995 - Mar 21 24:00 1:00 - +Rule Iran 1991 1995 - Sep 21 24:00 0 - +Rule Iran 1996 only - Mar 20 24:00 1:00 - +Rule Iran 1996 only - Sep 20 24:00 0 - +Rule Iran 1997 1999 - Mar 21 24:00 1:00 - +Rule Iran 1997 1999 - Sep 21 24:00 0 - +Rule Iran 2000 only - Mar 20 24:00 1:00 - +Rule Iran 2000 only - Sep 20 24:00 0 - +Rule Iran 2001 2003 - Mar 21 24:00 1:00 - +Rule Iran 2001 2003 - Sep 21 24:00 0 - +Rule Iran 2004 only - Mar 20 24:00 1:00 - +Rule Iran 2004 only - Sep 20 24:00 0 - +Rule Iran 2005 only - Mar 21 24:00 1:00 - +Rule Iran 2005 only - Sep 21 24:00 0 - +Rule Iran 2008 only - Mar 20 24:00 1:00 - +Rule Iran 2008 only - Sep 20 24:00 0 - +Rule Iran 2009 2011 - Mar 21 24:00 1:00 - +Rule Iran 2009 2011 - Sep 21 24:00 0 - +Rule Iran 2012 only - Mar 20 24:00 1:00 - +Rule Iran 2012 only - Sep 20 24:00 0 - +Rule Iran 2013 2015 - Mar 21 24:00 1:00 - +Rule Iran 2013 2015 - Sep 21 24:00 0 - +Rule Iran 2016 only - Mar 20 24:00 1:00 - +Rule Iran 2016 only - Sep 20 24:00 0 - +Rule Iran 2017 2019 - Mar 21 24:00 1:00 - +Rule Iran 2017 2019 - Sep 21 24:00 0 - +Rule Iran 2020 only - Mar 20 24:00 1:00 - +Rule Iran 2020 only - Sep 20 24:00 0 - +Rule Iran 2021 2023 - Mar 21 24:00 1:00 - +Rule Iran 2021 2023 - Sep 21 24:00 0 - +Rule Iran 2024 only - Mar 20 24:00 1:00 - +Rule Iran 2024 only - Sep 20 24:00 0 - +Rule Iran 2025 2027 - Mar 21 24:00 1:00 - +Rule Iran 2025 2027 - Sep 21 24:00 0 - +Rule Iran 2028 2029 - Mar 20 24:00 1:00 - +Rule Iran 2028 2029 - Sep 20 24:00 0 - +Rule Iran 2030 2031 - Mar 21 24:00 1:00 - +Rule Iran 2030 2031 - Sep 21 24:00 0 - +Rule Iran 2032 2033 - Mar 20 24:00 1:00 - +Rule Iran 2032 2033 - Sep 20 24:00 0 - +Rule Iran 2034 2035 - Mar 21 24:00 1:00 - +Rule Iran 2034 2035 - Sep 21 24:00 0 - +Rule Iran 2036 2037 - Mar 20 24:00 1:00 - +Rule Iran 2036 2037 - Sep 20 24:00 0 - +Rule Iran 2038 2039 - Mar 21 24:00 1:00 - +Rule Iran 2038 2039 - Sep 21 24:00 0 - +Rule Iran 2040 2041 - Mar 20 24:00 1:00 - +Rule Iran 2040 2041 - Sep 20 24:00 0 - +Rule Iran 2042 2043 - Mar 21 24:00 1:00 - +Rule Iran 2042 2043 - Sep 21 24:00 0 - +Rule Iran 2044 2045 - Mar 20 24:00 1:00 - +Rule Iran 2044 2045 - Sep 20 24:00 0 - +Rule Iran 2046 2047 - Mar 21 24:00 1:00 - +Rule Iran 2046 2047 - Sep 21 24:00 0 - +Rule Iran 2048 2049 - Mar 20 24:00 1:00 - +Rule Iran 2048 2049 - Sep 20 24:00 0 - +Rule Iran 2050 2051 - Mar 21 24:00 1:00 - +Rule Iran 2050 2051 - Sep 21 24:00 0 - +Rule Iran 2052 2053 - Mar 20 24:00 1:00 - +Rule Iran 2052 2053 - Sep 20 24:00 0 - +Rule Iran 2054 2055 - Mar 21 24:00 1:00 - +Rule Iran 2054 2055 - Sep 21 24:00 0 - +Rule Iran 2056 2057 - Mar 20 24:00 1:00 - +Rule Iran 2056 2057 - Sep 20 24:00 0 - +Rule Iran 2058 2059 - Mar 21 24:00 1:00 - +Rule Iran 2058 2059 - Sep 21 24:00 0 - +Rule Iran 2060 2062 - Mar 20 24:00 1:00 - +Rule Iran 2060 2062 - Sep 20 24:00 0 - +Rule Iran 2063 only - Mar 21 24:00 1:00 - +Rule Iran 2063 only - Sep 21 24:00 0 - +Rule Iran 2064 2066 - Mar 20 24:00 1:00 - +Rule Iran 2064 2066 - Sep 20 24:00 0 - +Rule Iran 2067 only - Mar 21 24:00 1:00 - +Rule Iran 2067 only - Sep 21 24:00 0 - +Rule Iran 2068 2070 - Mar 20 24:00 1:00 - +Rule Iran 2068 2070 - Sep 20 24:00 0 - +Rule Iran 2071 only - Mar 21 24:00 1:00 - +Rule Iran 2071 only - Sep 21 24:00 0 - +Rule Iran 2072 2074 - Mar 20 24:00 1:00 - +Rule Iran 2072 2074 - Sep 20 24:00 0 - +Rule Iran 2075 only - Mar 21 24:00 1:00 - +Rule Iran 2075 only - Sep 21 24:00 0 - +Rule Iran 2076 2078 - Mar 20 24:00 1:00 - +Rule Iran 2076 2078 - Sep 20 24:00 0 - +Rule Iran 2079 only - Mar 21 24:00 1:00 - +Rule Iran 2079 only - Sep 21 24:00 0 - +Rule Iran 2080 2082 - Mar 20 24:00 1:00 - +Rule Iran 2080 2082 - Sep 20 24:00 0 - +Rule Iran 2083 only - Mar 21 24:00 1:00 - +Rule Iran 2083 only - Sep 21 24:00 0 - +Rule Iran 2084 2086 - Mar 20 24:00 1:00 - +Rule Iran 2084 2086 - Sep 20 24:00 0 - +Rule Iran 2087 only - Mar 21 24:00 1:00 - +Rule Iran 2087 only - Sep 21 24:00 0 - # -# The following rules are approximations starting in the year 2038. -# These are the best post-2037 approximations available, given the -# restrictions of a single rule using a Gregorian-based data format. +# The following rules are approximations starting in the year 2088. +# These are the best post-2088 approximations available, given the +# restrictions of a single rule using ordinary Gregorian dates. # At some point this table will need to be extended, though quite # possibly Iran will change the rules first. -Rule Iran 2036 max - Mar 21 0:00 1:00 - -Rule Iran 2036 max - Sep 21 0:00 0 - +Rule Iran 2088 max - Mar 20 24:00 1:00 - +Rule Iran 2088 max - Sep 20 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 @@ -1691,7 +1878,9 @@ Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u 9:00 Japan J%sT -# Since 1938, all Japanese possessions have been like Asia/Tokyo. +# Since 1938, all Japanese possessions have been like Asia/Tokyo, +# except that Truk (Chuuk), Ponape (Pohnpei), and Jaluit (Kosrae) did not +# switch from +10 to +09 until 1941-04-01; see the 'australasia' file. # Jordan # @@ -1981,8 +2170,10 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # and in Byalokoz) lists Ural river (plus 10 versts on its left bank) in # the third time belt (before 1930 this means +03). -# From Paul Eggert (2016-12-06): -# The tables below reflect Golosunov's remarks, with exceptions as noted. +# From Alexander Konzurovski (2018-12-20): +# Qyzyolrda Region (Asia/Qyzylorda) is changing its time zone from +# UTC+6 to UTC+5 effective December 21st, 2018. The legal document is +# located here: http://adilet.zan.kz/rus/docs/P1800000817 (russian language). # Zone NAME GMTOFF RULES FORMAT [UNTIL] # @@ -1996,8 +2187,6 @@ Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-A 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s 6:00 - +06 # Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY) -# This currently includes Qostanay (aka Kostanay, Kustanay) (KZ-KUS); -# see comments below. Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -2008,21 +2197,22 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s 6:00 RussiaAsia +06/+07 1992 Mar 29 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s - 6:00 - +06 -# The following zone is like Asia/Qyzylorda except for being one -# hour earlier from 1991-09-29 to 1992-03-29. The 1991/2 rules for -# Qostanay are unclear partly because of the 1997 Turgai -# reorganization, so this zone is commented out for now. -#Zone Asia/Qostanay 4:14:20 - LMT 1924 May 2 -# 4:00 - +04 1930 Jun 21 -# 5:00 - +05 1981 Apr 1 -# 5:00 1:00 +06 1981 Oct 1 -# 6:00 - +06 1982 Apr 1 -# 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s -# 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s -# 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s -# 6:00 - +06 + 6:00 - +06 2018 Dec 21 0:00 + 5:00 - +05 # +# Qostanay (aka Kostanay, Kustanay) (KZ-KUS) +# The 1991/2 rules are unclear partly because of the 1997 Turgai +# reorganization. +Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2 + 4:00 - +04 1930 Jun 21 + 5:00 - +05 1981 Apr 1 + 5:00 1:00 +06 1981 Oct 1 + 6:00 - +06 1982 Apr 1 + 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s + 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s + 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s + 6:00 - +06 + # Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 @@ -2116,21 +2306,43 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 # started at June 1 in that year. For another example, the article in # 1988 said that DST started at 2:00 AM in that year. +# From Phake Nick (2018-10-27): +# 1. According to official announcement from Korean government, the DST end +# date in South Korea should be +# 1955-09-08 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027977557 +# 1956-09-29 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027978341 +# 1957-09-21 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027979690#3 +# 1958-09-20 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027981189 +# 1959-09-19 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027982974#2 +# 1960-09-17 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0028044104 +# ... +# 2.... https://namu.wiki/w/대한민국%20표준시 ... [says] +# when Korea was using GMT+8:30 as standard time, the international +# aviation/marine/meteorological industry in the country refused to +# follow and continued to use GMT+9:00 for interoperability. + + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule ROK 1948 only - Jun 1 0:00 1:00 D -Rule ROK 1948 only - Sep 13 0:00 0 S -Rule ROK 1949 only - Apr 3 0:00 1:00 D -Rule ROK 1949 1951 - Sep Sun>=8 0:00 0 S -Rule ROK 1950 only - Apr 1 0:00 1:00 D -Rule ROK 1951 only - May 6 0:00 1:00 D -Rule ROK 1955 only - May 5 0:00 1:00 D -Rule ROK 1955 only - Sep 9 0:00 0 S -Rule ROK 1956 only - May 20 0:00 1:00 D -Rule ROK 1956 only - Sep 30 0:00 0 S -Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D -Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S -Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D -Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S +Rule ROK 1948 only - Jun 1 0:00 1:00 D +Rule ROK 1948 only - Sep 12 24:00 0 S +Rule ROK 1949 only - Apr 3 0:00 1:00 D +Rule ROK 1949 1951 - Sep Sat>=7 24:00 0 S +Rule ROK 1950 only - Apr 1 0:00 1:00 D +Rule ROK 1951 only - May 6 0:00 1:00 D +Rule ROK 1955 only - May 5 0:00 1:00 D +Rule ROK 1955 only - Sep 8 24:00 0 S +Rule ROK 1956 only - May 20 0:00 1:00 D +Rule ROK 1956 only - Sep 29 24:00 0 S +Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D +Rule ROK 1957 1960 - Sep Sat>=17 24:00 0 S +Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D +Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # From Paul Eggert (2016-08-23): # The Korean Wikipedia entry gives the following sources for UT offsets: @@ -2920,6 +3132,11 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # no information # Philippines + +# From Paul Eggert (2018-11-18): +# The Spanish initially used American (west-of-Greenwich) time. +# It is unknown what time Manila kept when the British occupied it from +# 1762-10-06 through 1764-04; for now assume it kept American time. # On 1844-08-16, Narciso Clavería, governor-general of the # Philippines, issued a proclamation announcing that 1844-12-30 was to # be immediately followed by 1845-01-01; see R.H. van Gent's @@ -3005,8 +3222,8 @@ Link Asia/Qatar Asia/Bahrain # going to run on Higgins Time.' And so, until last year, it did." See: # Antar E. Dinner at When? Saudi Aramco World, 1969 March/April. 2-3. # http://archive.aramcoworld.com/issue/196902/dinner.at.when.htm -# newspapers.com says a similar story about Higgins was published in the Port -# Angeles (WA) Evening News, 1965-03-10, page 5, but I lack access to the text. +# Also see: Antar EN. Arabian flying is confusing. +# Port Angeles (WA) Evening News. 1965-03-10. page 3. # # The TZ database cannot represent quasi-solar time; airline time is the best # we can do. The 1946 foreign air news digest of the U.S. Civil Aeronautics Modified: stable/11/contrib/tzdata/australasia ============================================================================== --- stable/11/contrib/tzdata/australasia Tue Jan 1 10:04:49 2019 (r342667) +++ stable/11/contrib/tzdata/australasia Tue Jan 1 10:05:12 2019 (r342668) @@ -402,10 +402,44 @@ Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete # it is uninhabited. # Guam + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# http://guamlegislature.com/Public_Laws_5th/PL05-025.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-59-7-Guam-Daylight-Savings-Time-May-6-1959.pdf +Rule Guam 1959 only - Jun 27 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-61-5-Revocation-of-Daylight-Saving-Time-and-Restoratio.pdf +Rule Guam 1961 only - Jan 29 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-67-13-Guam-Daylight-Savings-Time.pdf +Rule Guam 1967 only - Sep 1 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-69-2-Repeal-of-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jan 26 0:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-69-10-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jun 22 2:00 1:00 D +Rule Guam 1969 only - Aug 31 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-70-10-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-70-30-End-of-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-71-5-Guam-Daylight-Savings-Time.pdf +Rule Guam 1970 1971 - Apr lastSun 2:00 1:00 D +Rule Guam 1970 1971 - Sep Sun>=1 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-73-28.-Guam-Day-light-Saving-Time.pdf +Rule Guam 1973 only - Dec 16 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-74-7-Guam-Daylight-Savings-Time-Rescinded.pdf +Rule Guam 1974 only - Feb 24 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-76-13-Daylight-Savings-Time.pdf +Rule Guam 1976 only - May 26 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-76-25-Revocation-of-E.O.-76-13.pdf +Rule Guam 1976 only - Aug 22 2:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-77-4-Daylight-Savings-Time.pdf +Rule Guam 1977 only - Apr 24 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-77-18-Guam-Standard-Time.pdf +Rule Guam 1977 only - Aug 28 2:00 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Guam -14:21:00 - LMT 1844 Dec 31 9:39:00 - LMT 1901 # Agana - 10:00 - GST 2000 Dec 23 # Guam + 10:00 - GST 1941 Dec 10 # Guam + 9:00 - +09 1944 Jul 31 + 10:00 Guam G%sT 2000 Dec 23 10:00 - ChST # Chamorro Standard Time Link Pacific/Guam Pacific/Saipan # N Mariana Is @@ -427,31 +461,56 @@ Zone Pacific/Kiritimati -10:29:20 - LMT 1901 # Marshall Is # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Majuro 11:24:48 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 -Zone Pacific/Kwajalein 11:09:20 - LMT 1901 - 11:00 - +11 1969 Oct - -12:00 - -12 1993 Aug 20 - 12:00 - +12 +Zone Pacific/Majuro 11:24:48 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Jan 30 + 11:00 - +11 1969 Oct + 12:00 - +12 +Zone Pacific/Kwajalein 11:09:20 - LMT 1901 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Feb 6 + 11:00 - +11 1969 Oct + -12:00 - -12 1993 Aug 20 24:00 + 12:00 - +12 # Micronesia # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Chuuk 10:07:08 - LMT 1901 - 10:00 - +10 -Zone Pacific/Pohnpei 10:32:52 - LMT 1901 # Kolonia - 11:00 - +11 -Zone Pacific/Kosrae 10:51:56 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 1999 - 11:00 - +11 +Zone Pacific/Chuuk -13:52:52 - LMT 1844 Dec 31 + 10:07:08 - LMT 1901 + 10:00 - +10 1914 Oct + 9:00 - +09 1919 Feb 1 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 10:00 - +10 +Zone Pacific/Pohnpei -13:27:08 - LMT 1844 Dec 31 # Kolonia + 10:32:52 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 +Zone Pacific/Kosrae -13:08:04 - LMT 1844 Dec 31 + 10:51:56 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 1969 Oct + 12:00 - +12 1999 + 11:00 - +11 # Nauru # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe - 11:30 - +1130 1942 Mar 15 - 9:00 - +09 1944 Aug 15 - 11:30 - +1130 1979 May + 11:30 - +1130 1942 Aug 29 + 9:00 - +09 1945 Sep 8 + 11:30 - +1130 1979 Feb 10 2:00 12:00 - +12 # New Caledonia @@ -552,8 +611,9 @@ Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Palau 8:57:56 - LMT 1901 # Koror - 9:00 - +09 +Zone Pacific/Palau -15:02:04 - LMT 1844 Dec 31 # Koror + 8:57:56 - LMT 1901 + 9:00 - +09 # Papua New Guinea *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 1 10:13:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B9414339BF; Tue, 1 Jan 2019 10:13:37 +0000 (UTC) (envelope-from philip@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 A4C648DD97; Tue, 1 Jan 2019 10:13:36 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from weatherwax.trouble.is (weatherwax.trouble.is [IPv6:2a00:dd80:3c::62e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "weatherwax.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: philip/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 67B50114E; Tue, 1 Jan 2019 10:13:36 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from rincewind.trouble.is (rincewind.trouble.is [IPv6:2a01:4f9:2a:1715::1:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "rincewind.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) by weatherwax.trouble.is (Postfix) with ESMTPS id 43TVPn3Fqvz4fYY; Tue, 1 Jan 2019 10:13:33 +0000 (UTC) Received: by rincewind.trouble.is (Postfix, from userid 1001) id 43TVPl0xVZztG6; Tue, 1 Jan 2019 10:13:31 +0000 (UTC) Date: Tue, 1 Jan 2019 11:13:31 +0100 From: Philip Paeps To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342644 - head/contrib/tzdata Message-ID: <20190101101330.GC6386@rincewind.trouble.is> Mail-Followup-To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812310757.wBV7vbVw066175@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <201812310757.wBV7vbVw066175@repo.freebsd.org> X-PGP-Fingerprint: 2CD1 92C2 6EE7 B7D1 F552 6619 31AE B9B5 FDBB CB0E X-Date: Today is Sweetmorn, the 1st day of Chaos in the YOLD 3185 X-Phase-of-Moon: The Moon is Waning Crescent (21% of Full) X-Clacks-Overhead: GNU Terry Pratchett Organization: Happily Disorganized User-Agent: Mutt/1.11.1 (2018-12-01) X-Rspamd-Queue-Id: A4C648DD97 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]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 01 Jan 2019 10:13:37 -0000 On 2018-12-31 07:57:37 (+0000), Philip Paeps wrote: >Log: > Import tzdata 2018i > > Changes: https://github.com/eggert/tz/blob/2018i/NEWS > > MFC after: 2 days I merged this (and 2018h) back to stable/{12,11,10} a day early (today) because someone affected asked. I don't think the extra day of waiting in HEAD would have benefited anyone. Philip -- Philip Paeps Senior Reality Engineer Ministry of Information From owner-svn-src-all@freebsd.org Tue Jan 1 19:56:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D6961426B13; Tue, 1 Jan 2019 19:56:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA06283991; Tue, 1 Jan 2019 19:56:49 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCA6426C38; Tue, 1 Jan 2019 19:56:49 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x01JunIB027057; Tue, 1 Jan 2019 19:56:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x01JunAj027056; Tue, 1 Jan 2019 19:56:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201901011956.x01JunAj027056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 1 Jan 2019 19:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342670 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 342670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA06283991 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)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 01 Jan 2019 19:56:50 -0000 Author: cem Date: Tue Jan 1 19:56:49 2019 New Revision: 342670 URL: https://svnweb.freebsd.org/changeset/base/342670 Log: linuxkpi: Remove extraneous NULL check on M_WAITOK allocation The check was not introduced in r342628, but the subsequent unchecked access to refs was added then, prompting a Coverity warning about "Null pointer dereferences (FORWARD_NULL)." The warning is bogus due to M_WAITOK, but so is the NULL check that hints it, so just remove it. CID: 1398588 Reported by: Coverity Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/cdev.h Tue Jan 1 10:05:36 2019 (r342669) +++ head/sys/compat/linuxkpi/common/include/linux/cdev.h Tue Jan 1 19:56:49 2019 (r342670) @@ -71,8 +71,7 @@ cdev_alloc(void) struct linux_cdev *cdev; cdev = kzalloc(sizeof(struct linux_cdev), M_WAITOK); - if (cdev != NULL) - kobject_init(&cdev->kobj, &linux_cdev_ktype); + kobject_init(&cdev->kobj, &linux_cdev_ktype); cdev->refs = 1; return (cdev); } From owner-svn-src-all@freebsd.org Tue Jan 1 20:12:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A10991427246; Tue, 1 Jan 2019 20:12:59 +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 440328440B; Tue, 1 Jan 2019 20:12:59 +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 330CB26F95; Tue, 1 Jan 2019 20:12:59 +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 x01KCxeE037205; Tue, 1 Jan 2019 20:12:59 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x01KCxZJ037204; Tue, 1 Jan 2019 20:12:59 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901012012.x01KCxZJ037204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 1 Jan 2019 20:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342671 - head/libexec/rtld-elf/powerpc64 X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/libexec/rtld-elf/powerpc64 X-SVN-Commit-Revision: 342671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 440328440B 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)[-0.998,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, 01 Jan 2019 20:12:59 -0000 Author: jhibbits Date: Tue Jan 1 20:12:58 2019 New Revision: 342671 URL: https://svnweb.freebsd.org/changeset/base/342671 Log: rtld-elf: Fix powerpc64 TLS handling, matching powerpc's fix We need to subtract the TLS_TCB_SIZE to get to the real data pointer, since r13 points to the end of the TCB structure. Prior to this, devel/protobuf-c port broke with recent update to devel/protobuf, which exposed this issue. Submitted by: andreast Reported by: Piotr Kubaj MFC after: 1 week Modified: head/libexec/rtld-elf/powerpc64/reloc.c Modified: head/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc64/reloc.c Tue Jan 1 19:56:49 2019 (r342670) +++ head/libexec/rtld-elf/powerpc64/reloc.c Tue Jan 1 20:12:58 2019 (r342671) @@ -256,7 +256,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld __unused, Obj_ *(Elf_Addr **)where = *where * sizeof(Elf_Addr) + (Elf_Addr *)(def->st_value + rela->r_addend - + defobj->tlsoffset - TLS_TP_OFFSET); + + defobj->tlsoffset - TLS_TP_OFFSET - TLS_TCB_SIZE); break; From owner-svn-src-all@freebsd.org Tue Jan 1 23:41:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E07B142DF6B; Tue, 1 Jan 2019 23:41:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02FFE68242; Tue, 1 Jan 2019 23:41:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBA98129D; Tue, 1 Jan 2019 23:41:16 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x01NfGEM057006; Tue, 1 Jan 2019 23:41:16 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x01NfGtN057005; Tue, 1 Jan 2019 23:41:16 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901012341.x01NfGtN057005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 1 Jan 2019 23:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342672 - head/sys/dev/rtwn/pci X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/rtwn/pci X-SVN-Commit-Revision: 342672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 02FFE68242 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)[-0.998,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, 01 Jan 2019 23:41:17 -0000 Author: avos Date: Tue Jan 1 23:41:16 2019 New Revision: 342672 URL: https://svnweb.freebsd.org/changeset/base/342672 Log: rtwn_pci: fix excessive packet loss on Tx with RTL8188EE. Use proper flags for bus_dmamap_sync() in Tx path. Tested with: RTL8188EE, STA mode MFC after: 4 days Modified: head/sys/dev/rtwn/pci/rtwn_pci_tx.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_tx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_tx.c Tue Jan 1 20:12:58 2019 (r342671) +++ head/sys/dev/rtwn/pci/rtwn_pci_tx.c Tue Jan 1 23:41:16 2019 (r342672) @@ -174,8 +174,8 @@ rtwn_pci_tx_start_frame(struct rtwn_softc *sc, struct rtwn_dump_tx_desc(sc, txd); bus_dmamap_sync(ring->desc_dmat, ring->desc_map, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_PREWRITE); data->m = m; data->ni = ni; From owner-svn-src-all@freebsd.org Wed Jan 2 04:08:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DF951433B4E; Wed, 2 Jan 2019 04:08:38 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F702709C0; Wed, 2 Jan 2019 04:08:38 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03E69431B; Wed, 2 Jan 2019 04:08:38 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0248bBf096293; Wed, 2 Jan 2019 04:08:37 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0248bw2096291; Wed, 2 Jan 2019 04:08:37 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020408.x0248bw2096291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 04:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342673 - in head/sys/dev/rtwn/rtl8192c: . pci X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn/rtl8192c: . pci X-SVN-Commit-Revision: 342673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F702709C0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 04:08:38 -0000 Author: avos Date: Wed Jan 2 04:08:37 2019 New Revision: 342673 URL: https://svnweb.freebsd.org/changeset/base/342673 Log: rtwn(4): provide register definitions for RTL8188CE calibration routines. No functional change intended. MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c head/sys/dev/rtwn/rtl8192c/r92c_reg.h Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c Tue Jan 1 23:41:16 2019 (r342672) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c Wed Jan 2 04:08:37 2019 (r342673) @@ -75,55 +75,58 @@ r92ce_iq_calib_chain(struct rtwn_softc *sc, int chain, uint16_t rx[2]) { uint32_t status; - int offset = chain * 0x20; if (chain == 0) { /* IQ calibration for chain 0. */ /* IQ calibration settings for chain 0. */ - rtwn_bb_write(sc, 0xe30, 0x10008c1f); - rtwn_bb_write(sc, 0xe34, 0x10008c1f); - rtwn_bb_write(sc, 0xe38, 0x82140102); + rtwn_bb_write(sc, R92C_TX_IQK_TONE(0), 0x10008c1f); + rtwn_bb_write(sc, R92C_RX_IQK_TONE(0), 0x10008c1f); + rtwn_bb_write(sc, R92C_TX_IQK_PI(0), 0x82140102); if (sc->ntxchains > 1) { - rtwn_bb_write(sc, 0xe3c, 0x28160202); /* 2T */ + rtwn_bb_write(sc, R92C_RX_IQK_PI(0), 0x28160202); /* IQ calibration settings for chain 1. */ - rtwn_bb_write(sc, 0xe50, 0x10008c22); - rtwn_bb_write(sc, 0xe54, 0x10008c22); - rtwn_bb_write(sc, 0xe58, 0x82140102); - rtwn_bb_write(sc, 0xe5c, 0x28160202); + rtwn_bb_write(sc, R92C_TX_IQK_TONE(1), 0x10008c22); + rtwn_bb_write(sc, R92C_RX_IQK_TONE(1), 0x10008c22); + rtwn_bb_write(sc, R92C_TX_IQK_PI(1), 0x82140102); + rtwn_bb_write(sc, R92C_RX_IQK_PI(1), 0x28160202); } else - rtwn_bb_write(sc, 0xe3c, 0x28160502); /* 1T */ + rtwn_bb_write(sc, R92C_RX_IQK_PI(0), 0x28160502); /* LO calibration settings. */ - rtwn_bb_write(sc, 0xe4c, 0x001028d1); + rtwn_bb_write(sc, R92C_IQK_AGC_RSP, 0x001028d1); /* We're doing LO and IQ calibration in one shot. */ - rtwn_bb_write(sc, 0xe48, 0xf9000000); - rtwn_bb_write(sc, 0xe48, 0xf8000000); + rtwn_bb_write(sc, R92C_IQK_AGC_PTS, 0xf9000000); + rtwn_bb_write(sc, R92C_IQK_AGC_PTS, 0xf8000000); } else { /* IQ calibration for chain 1. */ /* We're doing LO and IQ calibration in one shot. */ - rtwn_bb_write(sc, 0xe60, 0x00000002); - rtwn_bb_write(sc, 0xe60, 0x00000000); + rtwn_bb_write(sc, R92C_IQK_AGC_CONT, 2); + rtwn_bb_write(sc, R92C_IQK_AGC_CONT, 0); } /* Give LO and IQ calibrations the time to complete. */ rtwn_delay(sc, 1000); /* Read IQ calibration status. */ - status = rtwn_bb_read(sc, 0xeac); + status = rtwn_bb_read(sc, R92C_RX_POWER_IQK_AFTER(0)); if (status & (1 << (28 + chain * 3))) return (0); /* Tx failed. */ /* Read Tx IQ calibration results. */ - tx[0] = (rtwn_bb_read(sc, 0xe94 + offset) >> 16) & 0x3ff; - tx[1] = (rtwn_bb_read(sc, 0xe9c + offset) >> 16) & 0x3ff; + tx[0] = MS(rtwn_bb_read(sc, R92C_TX_POWER_IQK_BEFORE(chain)), + R92C_POWER_IQK_RESULT); + tx[1] = MS(rtwn_bb_read(sc, R92C_TX_POWER_IQK_AFTER(chain)), + R92C_POWER_IQK_RESULT); if (tx[0] == 0x142 || tx[1] == 0x042) return (0); /* Tx failed. */ if (status & (1 << (27 + chain * 3))) return (1); /* Rx failed. */ /* Read Rx IQ calibration results. */ - rx[0] = (rtwn_bb_read(sc, 0xea4 + offset) >> 16) & 0x3ff; - rx[1] = (rtwn_bb_read(sc, 0xeac + offset) >> 16) & 0x3ff; + rx[0] = MS(rtwn_bb_read(sc, R92C_RX_POWER_IQK_BEFORE(chain)), + R92C_POWER_IQK_RESULT); + rx[1] = MS(rtwn_bb_read(sc, R92C_RX_POWER_IQK_AFTER(chain)), + R92C_POWER_IQK_RESULT); if (rx[0] == 0x132 || rx[1] == 0x036) return (1); /* Rx failed. */ @@ -200,18 +203,18 @@ r92ce_iq_calib_run(struct rtwn_softc *sc, int n, uint1 if (sc->ntxchains > 1) rtwn_bb_write(sc, 0x0b6c, 0x00080000); - rtwn_bb_write(sc, 0x0e28, 0x80800000); - rtwn_bb_write(sc, 0x0e40, 0x01007c00); - rtwn_bb_write(sc, 0x0e44, 0x01004800); + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0x80800000); + rtwn_bb_write(sc, R92C_TX_IQK, 0x01007c00); + rtwn_bb_write(sc, R92C_RX_IQK, 0x01004800); rtwn_bb_write(sc, 0x0b68, 0x00080000); for (chain = 0; chain < sc->ntxchains; chain++) { if (chain > 0) { /* Put chain 0 on standby. */ - rtwn_bb_write(sc, 0x0e28, 0x00); + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0); rtwn_bb_write(sc, R92C_LSSI_PARAM(0), 0x00010000); - rtwn_bb_write(sc, 0x0e28, 0x80800000); + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0x80800000); /* Enable chain 1. */ for (i = 0; i < nitems(reg_adda); i++) @@ -257,7 +260,7 @@ r92ce_iq_calib_run(struct rtwn_softc *sc, int n, uint1 vals->fpga0_rfifacesw1); rtwn_bb_write(sc, R92C_OFDM0_TRMUXPAR, vals->ofdm0_trmuxpar); - rtwn_bb_write(sc, 0x0e28, 0x00); + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0); rtwn_bb_write(sc, R92C_LSSI_PARAM(0), 0x00032ed3); if (sc->ntxchains > 1) rtwn_bb_write(sc, R92C_LSSI_PARAM(1), 0x00032ed3); Modified: head/sys/dev/rtwn/rtl8192c/r92c_reg.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_reg.h Tue Jan 1 23:41:16 2019 (r342672) +++ head/sys/dev/rtwn/rtl8192c/r92c_reg.h Wed Jan 2 04:08:37 2019 (r342673) @@ -691,6 +691,7 @@ #define R92C_FPGA1_TXINFO 0x90c #define R92C_CCK0_SYSTEM 0xa00 #define R92C_CCK0_AFESETTING 0xa04 +#define R92C_CONFIG_ANT(chain) (0xb68 + (chain) * 4) #define R92C_OFDM0_TRXPATHENA 0xc04 #define R92C_OFDM0_TRMUXPAR 0xc08 #define R92C_OFDM0_RXIQIMBALANCE(chain) (0xc14 + (chain) * 8) @@ -703,6 +704,20 @@ #define R92C_OFDM0_RXIQEXTANTA 0xca0 #define R92C_OFDM0_TXPSEUDONOISEWGT 0xce4 #define R92C_OFDM1_LSTF 0xd00 +#define R92C_FPGA0_IQK 0xe28 +#define R92C_TX_IQK_TONE(chain) (0xe30 + (chain) * 32) +#define R92C_RX_IQK_TONE(chain) (0xe34 + (chain) * 32) +#define R92C_TX_IQK_PI(chain) (0xe38 + (chain) * 32) +#define R92C_RX_IQK_PI(chain) (0xe3c + (chain) * 32) +#define R92C_TX_IQK 0xe40 +#define R92C_RX_IQK 0xe44 +#define R92C_IQK_AGC_PTS 0xe48 +#define R92C_IQK_AGC_RSP 0xe4c +#define R92C_IQK_AGC_CONT 0xe60 +#define R92C_TX_POWER_IQK_BEFORE(chain) (0xe94 + (chain) * 32) +#define R92C_TX_POWER_IQK_AFTER(chain) (0xe9c + (chain) * 32) +#define R92C_RX_POWER_IQK_BEFORE(chain) (0xea4 + (chain) * 32) +#define R92C_RX_POWER_IQK_AFTER(chain) (0xeac + (chain) * 32) /* Bits for R92C_FPGA[01]_RFMOD. */ #define R92C_RFMOD_40MHZ 0x00000001 @@ -827,6 +842,10 @@ /* Bits for R92C_OFDM0_AGCCORE1(i). */ #define R92C_OFDM0_AGCCORE1_GAIN_M 0x0000007f #define R92C_OFDM0_AGCCORE1_GAIN_S 0 + +/* Bits for R92C_[RT]X_POWER_IQK*. */ +#define R92C_POWER_IQK_RESULT_S 16 +#define R92C_POWER_IQK_RESULT_M 0x03ff0000 /* From owner-svn-src-all@freebsd.org Wed Jan 2 04:19:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08D0D1433E25; Wed, 2 Jan 2019 04:19:30 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F4E870E27; Wed, 2 Jan 2019 04:19:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52E9A44C1; Wed, 2 Jan 2019 04:19:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x024JT9H001413; Wed, 2 Jan 2019 04:19:29 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x024JSPP001411; Wed, 2 Jan 2019 04:19:28 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020419.x024JSPP001411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 04:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342674 - head/sys/dev/rtwn/rtl8188e X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/rtwn/rtl8188e X-SVN-Commit-Revision: 342674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F4E870E27 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 04:19:30 -0000 Author: avos Date: Wed Jan 2 04:19:28 2019 New Revision: 342674 URL: https://svnweb.freebsd.org/changeset/base/342674 Log: rtwn(4): add IQ calibration support for RTL8188E* Tested with: * RTL8188EE, STA mode. * RTL8188EU, STA mode. MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8188e/r88e_calib.c head/sys/dev/rtwn/rtl8188e/r88e_reg.h Modified: head/sys/dev/rtwn/rtl8188e/r88e_calib.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_calib.c Wed Jan 2 04:08:37 2019 (r342673) +++ head/sys/dev/rtwn/rtl8188e/r88e_calib.c Wed Jan 2 04:19:28 2019 (r342674) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Andriy Voskoboinyk + * Copyright (c) 2016-2019 Andriy Voskoboinyk * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -42,16 +42,343 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +/* Registers to save and restore during IQ calibration. */ +struct r88e_iq_cal_reg_vals { + uint32_t adda[16]; + uint8_t txpause; + uint8_t bcn_ctrl[2]; + uint32_t gpio_muxcfg; + uint32_t cck0_afesetting; + uint32_t ofdm0_trxpathena; + uint32_t ofdm0_trmuxpar; + uint32_t fpga0_rfifacesw0; + uint32_t fpga0_rfifacesw1; + uint32_t fpga0_rfifaceoe0; + uint32_t fpga0_rfifaceoe1; + uint32_t config_ant0; + uint32_t config_ant1; +}; + +static int +r88e_iq_calib_chain(struct rtwn_softc *sc, uint16_t tx[2], uint16_t rx[2]) +{ + uint32_t status; + + /* Set Rx IQ calibration mode table. */ + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0); + rtwn_rf_write(sc, 0, R88E_RF_WE_LUT, 0x800a0); + rtwn_rf_write(sc, 0, R92C_RF_RCK_OS, 0x30000); + rtwn_rf_write(sc, 0, R92C_RF_TXPA_G(0), 0xf); + rtwn_rf_write(sc, 0, R92C_RF_TXPA_G(1), 0xf117b); + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0x80800000); + + /* IQ calibration settings. */ + rtwn_bb_write(sc, R92C_TX_IQK, 0x01007c00); + rtwn_bb_write(sc, R92C_RX_IQK, 0x81004800); + + /* IQ calibration settings for chain 0. */ + rtwn_bb_write(sc, R92C_TX_IQK_TONE(0), 0x10008c1c); + rtwn_bb_write(sc, R92C_RX_IQK_TONE(0), 0x30008c1c); + rtwn_bb_write(sc, R92C_TX_IQK_PI(0), 0x82160804); + rtwn_bb_write(sc, R92C_RX_IQK_PI(0), 0x28160000); + + /* LO calibration settings. */ + rtwn_bb_write(sc, R92C_IQK_AGC_RSP, 0x0046a911); + + /* We're doing LO and IQ calibration in one shot. */ + rtwn_bb_write(sc, R92C_IQK_AGC_PTS, 0xf9000000); + rtwn_bb_write(sc, R92C_IQK_AGC_PTS, 0xf8000000); + + /* Give LO and IQ calibrations the time to complete. */ + rtwn_delay(sc, 10000); + + /* Read IQ calibration status. */ + status = rtwn_bb_read(sc, R92C_RX_POWER_IQK_AFTER(0)); + if (status & (1 << 28)) + return (0); /* Tx failed. */ + + /* Read Tx IQ calibration results. */ + tx[0] = MS(rtwn_bb_read(sc, R92C_TX_POWER_IQK_BEFORE(0)), + R92C_POWER_IQK_RESULT); + tx[1] = MS(rtwn_bb_read(sc, R92C_TX_POWER_IQK_AFTER(0)), + R92C_POWER_IQK_RESULT); + if (tx[0] == 0x142 || tx[1] == 0x042) + return (0); /* Tx failed. */ + + rtwn_bb_write(sc, R92C_TX_IQK, 0x80007c00 | (tx[0] << 16) | tx[1]); + + /* Set Rx IQ calibration mode table. */ + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0); + rtwn_rf_write(sc, 0, R88E_RF_WE_LUT, 0x800a0); + rtwn_rf_write(sc, 0, R92C_RF_RCK_OS, 0x30000); + rtwn_rf_write(sc, 0, R92C_RF_TXPA_G(0), 0xf); + rtwn_rf_write(sc, 0, R92C_RF_TXPA_G(1), 0xf7ffa); + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0x80800000); + + /* IQ calibration settings. */ + rtwn_bb_write(sc, R92C_RX_IQK, 0x01004800); + + /* IQ calibration settings for chain 0. */ + rtwn_bb_write(sc, R92C_TX_IQK_TONE(0), 0x30008c1c); + rtwn_bb_write(sc, R92C_RX_IQK_TONE(0), 0x10008c1c); + rtwn_bb_write(sc, R92C_TX_IQK_PI(0), 0x82160c05); + rtwn_bb_write(sc, R92C_RX_IQK_PI(0), 0x28160c05); + + /* LO calibration settings. */ + rtwn_bb_write(sc, R92C_IQK_AGC_RSP, 0x0046a911); + + /* We're doing LO and IQ calibration in one shot. */ + rtwn_bb_write(sc, R92C_IQK_AGC_PTS, 0xf9000000); + rtwn_bb_write(sc, R92C_IQK_AGC_PTS, 0xf8000000); + + /* Give LO and IQ calibrations the time to complete. */ + rtwn_delay(sc, 10000); + + /* Read IQ calibration status. */ + status = rtwn_bb_read(sc, R92C_RX_POWER_IQK_AFTER(0)); + if (status & (1 << 27)) + return (1); /* Rx failed. */ + + /* Read Rx IQ calibration results. */ + rx[0] = MS(rtwn_bb_read(sc, R92C_RX_POWER_IQK_BEFORE(0)), + R92C_POWER_IQK_RESULT); + rx[1] = MS(status, R92C_POWER_IQK_RESULT); + if (rx[0] == 0x132 || rx[1] == 0x036) + return (1); /* Rx failed. */ + + return (3); /* Both Tx and Rx succeeded. */ +} + +static void +r88e_iq_calib_run(struct rtwn_softc *sc, int n, uint16_t tx[2], + uint16_t rx[2], struct r88e_iq_cal_reg_vals *vals) +{ + /* Registers to save and restore during IQ calibration. */ + static const uint16_t reg_adda[16] = { + 0x85c, 0xe6c, 0xe70, 0xe74, + 0xe78, 0xe7c, 0xe80, 0xe84, + 0xe88, 0xe8c, 0xed0, 0xed4, + 0xed8, 0xedc, 0xee0, 0xeec + }; + int i; + uint32_t hssi_param1; + + if (n == 0) { + for (i = 0; i < nitems(reg_adda); i++) + vals->adda[i] = rtwn_bb_read(sc, reg_adda[i]); + + vals->txpause = rtwn_read_1(sc, R92C_TXPAUSE); + vals->bcn_ctrl[0] = rtwn_read_1(sc, R92C_BCN_CTRL(0)); + vals->bcn_ctrl[1] = rtwn_read_1(sc, R92C_BCN_CTRL(1)); + vals->gpio_muxcfg = rtwn_read_4(sc, R92C_GPIO_MUXCFG); + } + + rtwn_bb_write(sc, reg_adda[0], 0x0b1b25a0); + for (i = 1; i < nitems(reg_adda); i++) + rtwn_bb_write(sc, reg_adda[i], 0x0bdb25a0); + + hssi_param1 = rtwn_bb_read(sc, R92C_HSSI_PARAM1(0)); + if (!(hssi_param1 & R92C_HSSI_PARAM1_PI)) { + rtwn_bb_write(sc, R92C_HSSI_PARAM1(0), + hssi_param1 | R92C_HSSI_PARAM1_PI); + rtwn_bb_write(sc, R92C_HSSI_PARAM1(1), + hssi_param1 | R92C_HSSI_PARAM1_PI); + } + + if (n == 0) { + vals->cck0_afesetting = rtwn_bb_read(sc, R92C_CCK0_AFESETTING); + vals->ofdm0_trxpathena = + rtwn_bb_read(sc, R92C_OFDM0_TRXPATHENA); + vals->ofdm0_trmuxpar = rtwn_bb_read(sc, R92C_OFDM0_TRMUXPAR); + vals->fpga0_rfifacesw0 = + rtwn_bb_read(sc, R92C_FPGA0_RFIFACESW(0)); + vals->fpga0_rfifacesw1 = + rtwn_bb_read(sc, R92C_FPGA0_RFIFACESW(1)); + vals->fpga0_rfifaceoe0 = + rtwn_bb_read(sc, R92C_FPGA0_RFIFACEOE(0)); + vals->fpga0_rfifaceoe1 = + rtwn_bb_read(sc, R92C_FPGA0_RFIFACEOE(1)); + vals->config_ant0 = rtwn_bb_read(sc, R92C_CONFIG_ANT(0)); + vals->config_ant1 = rtwn_bb_read(sc, R92C_CONFIG_ANT(1)); + } + + rtwn_bb_setbits(sc, R92C_CCK0_AFESETTING, 0, 0x0f000000); + rtwn_bb_write(sc, R92C_OFDM0_TRXPATHENA, 0x03a05600); + rtwn_bb_write(sc, R92C_OFDM0_TRMUXPAR, 0x000800e4); + rtwn_bb_write(sc, R92C_FPGA0_RFIFACESW(1), 0x22204000); + rtwn_bb_setbits(sc, R92C_FPGA0_RFIFACESW(0), 0, 0x04000400); + rtwn_bb_setbits(sc, R92C_FPGA0_RFIFACEOE(0), 0x400, 0); + rtwn_bb_setbits(sc, R92C_FPGA0_RFIFACEOE(1), 0x400, 0); + + rtwn_write_1(sc, R92C_TXPAUSE, + R92C_TX_QUEUE_AC | R92C_TX_QUEUE_MGT | R92C_TX_QUEUE_HIGH); + rtwn_write_1(sc, R92C_BCN_CTRL(0), + vals->bcn_ctrl[0] & ~R92C_BCN_CTRL_EN_BCN); + rtwn_write_1(sc, R92C_BCN_CTRL(1), + vals->bcn_ctrl[1] & ~R92C_BCN_CTRL_EN_BCN); + rtwn_write_1(sc, R92C_GPIO_MUXCFG, + vals->gpio_muxcfg & ~R92C_GPIO_MUXCFG_ENBT); + + rtwn_bb_write(sc, R92C_CONFIG_ANT(0), 0x0f600000); + + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0x80800000); + rtwn_bb_write(sc, R92C_TX_IQK, 0x01007c00); + rtwn_bb_write(sc, R92C_RX_IQK, 0x01004800); + + /* Run IQ calibration twice. */ + for (i = 0; i < 2; i++) { + int ret; + + ret = r88e_iq_calib_chain(sc, tx, rx); + if (ret == 0) { + RTWN_DPRINTF(sc, RTWN_DEBUG_CALIB, "%s: Tx failed.\n", + __func__); + tx[0] = 0xff; + tx[1] = 0xff; + rx[0] = 0xff; + rx[1] = 0xff; + } else if (ret == 1) { + RTWN_DPRINTF(sc, RTWN_DEBUG_CALIB, "%s: Rx failed.\n", + __func__); + rx[0] = 0xff; + rx[1] = 0xff; + } else if (ret == 3) { + RTWN_DPRINTF(sc, RTWN_DEBUG_CALIB, "%s: Both Tx and Rx" + " succeeded.\n", __func__); + } + } + + RTWN_DPRINTF(sc, RTWN_DEBUG_CALIB, + "%s: results for run %d: tx[0] 0x%x, tx[1] 0x%x, rx[0] 0x%x, " + "rx[1] 0x%x\n", __func__, n, tx[0], tx[1], rx[0], rx[1]); + + rtwn_bb_write(sc, R92C_CCK0_AFESETTING, vals->cck0_afesetting); + rtwn_bb_write(sc, R92C_OFDM0_TRXPATHENA, vals->ofdm0_trxpathena); + rtwn_bb_write(sc, R92C_FPGA0_RFIFACESW(0), vals->fpga0_rfifacesw0); + rtwn_bb_write(sc, R92C_FPGA0_RFIFACESW(1), vals->fpga0_rfifacesw1); + rtwn_bb_write(sc, R92C_OFDM0_TRMUXPAR, vals->ofdm0_trmuxpar); + rtwn_bb_write(sc, R92C_FPGA0_RFIFACEOE(0), vals->fpga0_rfifaceoe0); + rtwn_bb_write(sc, R92C_FPGA0_RFIFACEOE(1), vals->fpga0_rfifaceoe1); + rtwn_bb_write(sc, R92C_CONFIG_ANT(0), vals->config_ant0); + rtwn_bb_write(sc, R92C_CONFIG_ANT(1), vals->config_ant1); + + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0); + rtwn_bb_write(sc, R92C_LSSI_PARAM(0), 0x00032ed3); + + if (n != 0) { + if (!(hssi_param1 & R92C_HSSI_PARAM1_PI)) { + rtwn_bb_write(sc, R92C_HSSI_PARAM1(0), hssi_param1); + rtwn_bb_write(sc, R92C_HSSI_PARAM1(1), hssi_param1); + } + + for (i = 0; i < nitems(reg_adda); i++) + rtwn_bb_write(sc, reg_adda[i], vals->adda[i]); + + rtwn_write_1(sc, R92C_TXPAUSE, vals->txpause); + rtwn_write_1(sc, R92C_BCN_CTRL(0), vals->bcn_ctrl[0]); + rtwn_write_1(sc, R92C_BCN_CTRL(1), vals->bcn_ctrl[1]); + rtwn_write_4(sc, R92C_GPIO_MUXCFG, vals->gpio_muxcfg); + } +} + +#define RTWN_IQ_CAL_MAX_TOLERANCE 5 +static int +r88e_iq_calib_compare_results(struct rtwn_softc *sc, uint16_t tx1[2], + uint16_t rx1[2], uint16_t tx2[2], uint16_t rx2[2]) +{ + int i, tx_ok, rx_ok; + + tx_ok = rx_ok = 0; + for (i = 0; i < 2; i++) { + if (tx1[i] == 0xff || tx2[i] == 0xff || + rx1[i] == 0xff || rx2[i] == 0xff) + continue; + + tx_ok = (abs(tx1[i] - tx2[i]) <= RTWN_IQ_CAL_MAX_TOLERANCE); + rx_ok = (abs(rx1[i] - rx2[i]) <= RTWN_IQ_CAL_MAX_TOLERANCE); + } + + return (tx_ok && rx_ok); +} +#undef RTWN_IQ_CAL_MAX_TOLERANCE + +static void +r88e_iq_calib_write_results(struct rtwn_softc *sc, uint16_t tx[2], + uint16_t rx[2]) +{ + uint32_t reg, val, x; + long y, tx_c; + + if (tx[0] == 0xff || tx[1] == 0xff) + return; + + reg = rtwn_bb_read(sc, R92C_OFDM0_TXIQIMBALANCE(0)); + val = ((reg >> 22) & 0x3ff); + x = tx[0]; + if (x & 0x00000200) + x |= 0xfffffc00; + reg = (((x * val) >> 8) & 0x3ff); + rtwn_bb_setbits(sc, R92C_OFDM0_TXIQIMBALANCE(0), 0x3ff, reg); + rtwn_bb_setbits(sc, R92C_OFDM0_ECCATHRESHOLD, 0x80000000, + ((x * val) & 0x80) << 24); + + y = tx[1]; + if (y & 0x00000200) + y |= 0xfffffc00; + tx_c = (y * val) >> 8; + rtwn_bb_setbits(sc, R92C_OFDM0_TXAFE(0), 0xf0000000, + (tx_c & 0x3c0) << 22); + rtwn_bb_setbits(sc, R92C_OFDM0_TXIQIMBALANCE(0), 0x003f0000, + (tx_c & 0x3f) << 16); + rtwn_bb_setbits(sc, R92C_OFDM0_ECCATHRESHOLD, 0x20000000, + ((y * val) & 0x80) << 22); + + if (rx[0] == 0xff || rx[1] == 0xff) + return; + + rtwn_bb_setbits(sc, R92C_OFDM0_RXIQIMBALANCE(0), 0x3ff, + rx[0] & 0x3ff); + rtwn_bb_setbits(sc, R92C_OFDM0_RXIQIMBALANCE(0), 0xfc00, + (rx[1] & 0x3f) << 10); + rtwn_bb_setbits(sc, R92C_OFDM0_RXIQEXTANTA, 0xf0000000, + (rx[1] & 0x3c0) << 22); +} + +#define RTWN_IQ_CAL_NRUN 3 void r88e_iq_calib(struct rtwn_softc *sc) { - /* XXX TODO */ + struct r88e_iq_cal_reg_vals vals; + uint16_t tx[RTWN_IQ_CAL_NRUN][2], rx[RTWN_IQ_CAL_NRUN][2]; + int n, valid; + + KASSERT(sc->ntxchains == 1, + ("%s: only 1T1R configuration is supported!\n", __func__)); + + valid = 0; + for (n = 0; n < RTWN_IQ_CAL_NRUN; n++) { + r88e_iq_calib_run(sc, n, tx[n], rx[n], &vals); + + if (n == 0) + continue; + + /* Valid results remain stable after consecutive runs. */ + valid = r88e_iq_calib_compare_results(sc, tx[n - 1], + rx[n - 1], tx[n], rx[n]); + if (valid) + break; + } + + if (valid) + r88e_iq_calib_write_results(sc, tx[n], rx[n]); } +#undef RTWN_IQ_CAL_NRUN void r88e_temp_measure(struct rtwn_softc *sc) Modified: head/sys/dev/rtwn/rtl8188e/r88e_reg.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_reg.h Wed Jan 2 04:08:37 2019 (r342673) +++ head/sys/dev/rtwn/rtl8188e/r88e_reg.h Wed Jan 2 04:19:28 2019 (r342674) @@ -79,6 +79,7 @@ * RF (6052) registers. */ #define R88E_RF_T_METER 0x42 +#define R88E_RF_WE_LUT 0xef /* Bits for R92C_RF_CHNLBW. */ #define R88E_RF_CHNLBW_BW20 0x00c00 From owner-svn-src-all@freebsd.org Wed Jan 2 04:27:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83A8C14340EA; Wed, 2 Jan 2019 04:27:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2515D712E8; Wed, 2 Jan 2019 04:27:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09D7D46B9; Wed, 2 Jan 2019 04:27:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x024RdVt006769; Wed, 2 Jan 2019 04:27:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x024RdrK006768; Wed, 2 Jan 2019 04:27:39 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020427.x024RdrK006768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 04:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342675 - in head/sys/dev/rtwn: rtl8188e/usb rtl8192e/usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: rtl8188e/usb rtl8192e/usb X-SVN-Commit-Revision: 342675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2515D712E8 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.975,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Jan 2019 04:27:40 -0000 Author: avos Date: Wed Jan 2 04:27:39 2019 New Revision: 342675 URL: https://svnweb.freebsd.org/changeset/base/342675 Log: rtwn(4): drop obsolete comment + use 'nop' function for 92eu calibration RTL8192EU was not tested with previously added code. MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c head/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 04:19:28 2019 (r342674) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 04:27:39 2019 (r342675) @@ -149,7 +149,7 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->sc_llt_init = r92c_llt_init; sc->sc_set_page_size = r92c_set_page_size; sc->sc_lc_calib = r92c_lc_calib; - sc->sc_iq_calib = r88e_iq_calib; /* XXX TODO */ + sc->sc_iq_calib = r88e_iq_calib; sc->sc_read_chipid_vendor = rtwn_nop_softc_uint32; sc->sc_adj_devcaps = r88eu_adj_devcaps; sc->sc_vap_preattach = rtwn_nop_softc_vap; Modified: head/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c Wed Jan 2 04:19:28 2019 (r342674) +++ head/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c Wed Jan 2 04:27:39 2019 (r342675) @@ -135,7 +135,7 @@ r92eu_attach(struct rtwn_usb_softc *uc) sc->sc_llt_init = r92e_llt_init; sc->sc_set_page_size = rtwn_nop_int_softc; sc->sc_lc_calib = r92c_lc_calib; - sc->sc_iq_calib = r88e_iq_calib; /* XXX TODO */ + sc->sc_iq_calib = rtwn_nop_softc; /* XXX TODO */ sc->sc_read_chipid_vendor = rtwn_nop_softc_uint32; sc->sc_adj_devcaps = r92eu_adj_devcaps; sc->sc_vap_preattach = rtwn_nop_softc_vap; From owner-svn-src-all@freebsd.org Wed Jan 2 04:56:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E87B71434E5C; Wed, 2 Jan 2019 04:56:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A1A972284; Wed, 2 Jan 2019 04:56:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 747BF4BC1; Wed, 2 Jan 2019 04:56:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x024uaAT022299; Wed, 2 Jan 2019 04:56:36 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x024ua0O022298; Wed, 2 Jan 2019 04:56:36 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020456.x024ua0O022298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 04:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342676 - head/sys/dev/rtwn/pci X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/rtwn/pci X-SVN-Commit-Revision: 342676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A1A972284 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.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 04:56:37 -0000 Author: avos Date: Wed Jan 2 04:56:36 2019 New Revision: 342676 URL: https://svnweb.freebsd.org/changeset/base/342676 Log: rtwn_pci(4): use proper bus_dmamap_sync flags after Tx (sync with r342672) MFC after: 4 days Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_rx.c Wed Jan 2 04:27:39 2019 (r342675) +++ head/sys/dev/rtwn/pci/rtwn_pci_rx.c Wed Jan 2 04:56:36 2019 (r342676) @@ -197,7 +197,8 @@ rtwn_pci_tx_done(struct rtwn_softc *sc, int qid) RTWN_DPRINTF(sc, RTWN_DEBUG_INTR, "%s: qid %d, last %d, cur %d\n", __func__, qid, ring->last, ring->cur); - bus_dmamap_sync(ring->desc_dmat, ring->desc_map, BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(ring->desc_dmat, ring->desc_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); while(ring->last != ring->cur) { data = &ring->tx_data[ring->last]; From owner-svn-src-all@freebsd.org Wed Jan 2 05:21:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 659411435BE8; Wed, 2 Jan 2019 05:21:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16EF272FC7; Wed, 2 Jan 2019 05:21:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 095AC4F54; Wed, 2 Jan 2019 05:21:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x025LAgo033517; Wed, 2 Jan 2019 05:21:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x025L7rY033503; Wed, 2 Jan 2019 05:21:07 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020521.x025L7rY033503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 05:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342677 - in head/sys: dev/rtwn/pci dev/rtwn/rtl8188e dev/rtwn/rtl8188e/usb dev/rtwn/rtl8192c dev/rtwn/rtl8192c/pci dev/rtwn/rtl8192c/usb modules/rtwn_usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys: dev/rtwn/pci dev/rtwn/rtl8188e dev/rtwn/rtl8188e/usb dev/rtwn/rtl8192c dev/rtwn/rtl8192c/pci dev/rtwn/rtl8192c/usb modules/rtwn_usb X-SVN-Commit-Revision: 342677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16EF272FC7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Jan 2019 05:21:10 -0000 Author: avos Date: Wed Jan 2 05:21:06 2019 New Revision: 342677 URL: https://svnweb.freebsd.org/changeset/base/342677 Log: rtwn_pci(4): add support for event-based Tx reports. It will be used for RTL8188EE (and, probably, others). MFC after: 4 days Deleted: head/sys/dev/rtwn/rtl8188e/usb/r88eu_rx.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c head/sys/dev/rtwn/pci/rtwn_pci_var.h head/sys/dev/rtwn/rtl8188e/r88e.h head/sys/dev/rtwn/rtl8188e/r88e_rx.c head/sys/dev/rtwn/rtl8188e/usb/r88eu.h head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c head/sys/dev/rtwn/rtl8192c/pci/r92ce.h head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c head/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c head/sys/dev/rtwn/rtl8192c/r92c.h head/sys/dev/rtwn/rtl8192c/r92c_rx.c head/sys/dev/rtwn/rtl8192c/usb/r92cu.h head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c head/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c head/sys/modules/rtwn_usb/Makefile Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_rx.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/pci/rtwn_pci_rx.c Wed Jan 2 05:21:06 2019 (r342677) @@ -83,12 +83,12 @@ rtwn_pci_setup_rx_desc(struct rtwn_pci_softc *pc, } static void -rtwn_pci_rx_frame(struct rtwn_softc *sc, struct rtwn_rx_stat_pci *rx_desc, - int desc_idx) +rtwn_pci_rx_frame(struct rtwn_pci_softc *pc) { - struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); + struct rtwn_softc *sc = &pc->pc_sc; struct rtwn_rx_ring *ring = &pc->rx_ring; - struct rtwn_rx_data *rx_data = &ring->rx_data[desc_idx]; + struct rtwn_rx_stat_pci *rx_desc = &ring->desc[ring->cur]; + struct rtwn_rx_data *rx_data = &ring->rx_data[ring->cur]; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni; uint32_t rxdw0; @@ -148,9 +148,6 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, struct rtwn_r panic("%s: could not load old RX mbuf", device_get_name(sc->sc_dev)); - /* Physical address may have changed. */ - rtwn_pci_setup_rx_desc(pc, rx_desc, rx_data->paddr, - MJUMPAGESIZE, desc_idx); goto fail; } @@ -165,10 +162,6 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, struct rtwn_r "%s: Rx frame len %d, infosz %d, shift %d\n", __func__, pktlen, infosz, shift); - /* Update RX descriptor. */ - rtwn_pci_setup_rx_desc(pc, rx_desc, rx_data->paddr, MJUMPAGESIZE, - desc_idx); - /* Send the frame to the 802.11 layer. */ RTWN_UNLOCK(sc); if (ni != NULL) { @@ -186,7 +179,73 @@ fail: counter_u64_add(ic->ic_ierrors, 1); } +static int +rtwn_pci_rx_buf_copy(struct rtwn_pci_softc *pc) +{ + struct rtwn_rx_ring *ring = &pc->rx_ring; + struct rtwn_rx_stat_pci *rx_desc = &ring->desc[ring->cur]; + struct rtwn_rx_data *rx_data = &ring->rx_data[ring->cur]; + uint32_t rxdw0; + int desc_size, pktlen; + + /* + * NB: tx_report() / c2h_report() expects to see USB Rx + * descriptor - same as for PCIe, but without rxbufaddr* fields. + */ + desc_size = sizeof(struct rtwn_rx_stat_common); + KASSERT(sizeof(pc->pc_rx_buf) < desc_size, + ("adjust size for PCIe Rx buffer!")); + + memcpy(pc->pc_rx_buf, rx_desc, desc_size); + + rxdw0 = le32toh(rx_desc->rxdw0); + pktlen = MS(rxdw0, RTWN_RXDW0_PKTLEN); + + if (pktlen > sizeof(pc->pc_rx_buf) - desc_size) + { + /* Looks like an ordinary Rx frame. */ + return (desc_size); + } + + bus_dmamap_sync(ring->data_dmat, rx_data->map, BUS_DMASYNC_POSTREAD); + memcpy(pc->pc_rx_buf + desc_size, mtod(rx_data->m, void *), pktlen); + + return (desc_size + pktlen); +} + static void +rtwn_pci_tx_report(struct rtwn_pci_softc *pc, int len) +{ + struct rtwn_softc *sc = &pc->pc_sc; + + if (sc->sc_ratectl != RTWN_RATECTL_NET80211) { + /* shouldn't happen */ + device_printf(sc->sc_dev, + "%s called while ratectl = %d!\n", + __func__, sc->sc_ratectl); + return; + } + + RTWN_NT_LOCK(sc); + rtwn_handle_tx_report(sc, pc->pc_rx_buf, len); + RTWN_NT_UNLOCK(sc); + +#ifdef IEEE80211_SUPPORT_SUPERG + /* + * NB: this will executed only when 'report' bit is set. + */ + if (sc->sc_tx_n_active > 0 && --sc->sc_tx_n_active <= 1) + rtwn_cmd_sleepable(sc, NULL, 0, rtwn_ff_flush_all); +#endif +} + +static void +rtwn_pci_c2h_report(struct rtwn_pci_softc *pc, int len) +{ + rtwn_handle_c2h_report(&pc->pc_sc, pc->pc_rx_buf, len); +} + +static void rtwn_pci_tx_done(struct rtwn_softc *sc, int qid) { struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); @@ -263,21 +322,50 @@ rtwn_pci_rx_done(struct rtwn_softc *sc) { struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); struct rtwn_rx_ring *ring = &pc->rx_ring; + struct rtwn_rx_stat_pci *rx_desc; + struct rtwn_rx_data *rx_data; + int len; bus_dmamap_sync(ring->desc_dmat, ring->desc_map, BUS_DMASYNC_POSTREAD); for (;;) { - struct rtwn_rx_stat_pci *rx_desc = &ring->desc[ring->cur]; + rx_desc = &ring->desc[ring->cur]; + rx_data = &ring->rx_data[ring->cur]; if (le32toh(rx_desc->rxdw0) & RTWN_RXDW0_OWN) break; - rtwn_pci_rx_frame(sc, rx_desc, ring->cur); + len = rtwn_pci_rx_buf_copy(pc); + switch (rtwn_classify_intr(sc, pc->pc_rx_buf, len)) { + case RTWN_RX_DATA: + rtwn_pci_rx_frame(pc); + break; + case RTWN_RX_TX_REPORT: + rtwn_pci_tx_report(pc, len); + break; + case RTWN_RX_OTHER: + rtwn_pci_c2h_report(pc, len); + break; + default: + /* NOTREACHED */ + KASSERT(0, ("unknown Rx classification code")); + break; + } + + /* Update / reset RX descriptor (and set OWN bit). */ + rtwn_pci_setup_rx_desc(pc, rx_desc, rx_data->paddr, + MJUMPAGESIZE, ring->cur); + if (!(sc->sc_flags & RTWN_RUNNING)) return; - ring->cur = (ring->cur + 1) % RTWN_PCI_RX_LIST_COUNT; + /* NB: device can reuse current descriptor. */ + bus_dmamap_sync(ring->desc_dmat, ring->desc_map, + BUS_DMASYNC_POSTREAD); + + if (le32toh(rx_desc->rxdw0) & RTWN_RXDW0_OWN) + ring->cur = (ring->cur + 1) % RTWN_PCI_RX_LIST_COUNT; } } @@ -289,13 +377,13 @@ rtwn_pci_intr(void *arg) int i, status, tx_rings; RTWN_LOCK(sc); - status = rtwn_classify_intr(sc, &tx_rings, 0); + status = rtwn_pci_get_intr_status(pc, &tx_rings); RTWN_DPRINTF(sc, RTWN_DEBUG_INTR, "%s: status %08X, tx_rings %08X\n", __func__, status, tx_rings); if (status == 0 && tx_rings == 0) goto unlock; - if (status & RTWN_PCI_INTR_RX) { + if (status & (RTWN_PCI_INTR_RX | RTWN_PCI_INTR_TX_REPORT)) { rtwn_pci_rx_done(sc); if (!(sc->sc_flags & RTWN_RUNNING)) goto unlock; Modified: head/sys/dev/rtwn/pci/rtwn_pci_var.h ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_var.h Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/pci/rtwn_pci_var.h Wed Jan 2 05:21:06 2019 (r342677) @@ -26,6 +26,9 @@ #define RTWN_PCI_RX_LIST_COUNT 256 #define RTWN_PCI_TX_LIST_COUNT 256 +/* sizeof(struct rtwn_rx_stat_common) + R88E_INTR_MSG_LEN */ +#define RTWN_PCI_RX_TMP_BUF_SIZE 84 + struct rtwn_rx_data { bus_dmamap_t map; struct mbuf *m; @@ -95,8 +98,8 @@ enum { /* Shortcuts */ /* Vendor driver treats RX errors like ROK... */ #define RTWN_PCI_INTR_RX \ - (RTWN_PCI_INTR_RX_OVERFLOW | RTWN_PCI_INTR_RX_DESC_UNAVAIL | \ - RTWN_PCI_INTR_RX_DONE) + (RTWN_PCI_INTR_RX_ERROR | RTWN_PCI_INTR_RX_OVERFLOW | \ + RTWN_PCI_INTR_RX_DESC_UNAVAIL | RTWN_PCI_INTR_RX_DONE) struct rtwn_pci_softc { @@ -109,6 +112,7 @@ struct rtwn_pci_softc { void *pc_ih; bus_size_t pc_mapsize; + uint8_t pc_rx_buf[RTWN_PCI_RX_TMP_BUF_SIZE]; struct rtwn_rx_ring rx_ring; struct rtwn_tx_ring tx_ring[RTWN_PCI_NTXQUEUES]; @@ -122,6 +126,8 @@ struct rtwn_pci_softc { void *, bus_dma_segment_t *); void (*pc_copy_tx_desc)(void *, const void *); void (*pc_enable_intr)(struct rtwn_pci_softc *); + int (*pc_get_intr_status)(struct rtwn_pci_softc *, + int *); }; #define RTWN_PCI_SOFTC(sc) ((struct rtwn_pci_softc *)(sc)) @@ -133,5 +139,7 @@ struct rtwn_pci_softc { (((_pc)->pc_copy_tx_desc)((_dest), (_src))) #define rtwn_pci_enable_intr(_pc) \ (((_pc)->pc_enable_intr)((_pc))) +#define rtwn_pci_get_intr_status(_pc, _tx_rings) \ + (((_pc)->pc_get_intr_status)((_pc), (_tx_rings))) #endif /* RTWN_PCI_VAR_H */ Modified: head/sys/dev/rtwn/rtl8188e/r88e.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e.h Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8188e/r88e.h Wed Jan 2 05:21:06 2019 (r342677) @@ -81,6 +81,7 @@ void r88e_rf_write(struct rtwn_softc *, int, uint8_t, void r88e_parse_rom(struct rtwn_softc *, uint8_t *); /* r88e_rx.c */ +int r88e_classify_intr(struct rtwn_softc *, void *, int); void r88e_ratectl_tx_complete(struct rtwn_softc *, uint8_t *, int); void r88e_handle_c2h_report(struct rtwn_softc *, uint8_t *, int); int8_t r88e_get_rssi_cck(struct rtwn_softc *, void *); Modified: head/sys/dev/rtwn/rtl8188e/r88e_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_rx.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8188e/r88e_rx.c Wed Jan 2 05:21:06 2019 (r342677) @@ -56,6 +56,25 @@ __FBSDID("$FreeBSD$"); #include +int +r88e_classify_intr(struct rtwn_softc *sc, void *buf, int len) +{ + struct r92c_rx_stat *stat = buf; + int report_sel = MS(le32toh(stat->rxdw3), R88E_RXDW3_RPT); + + switch (report_sel) { + case R88E_RXDW3_RPT_RX: + return (RTWN_RX_DATA); + case R88E_RXDW3_RPT_TX1: /* per-packet Tx report */ + case R88E_RXDW3_RPT_TX2: /* periodical Tx report */ + return (RTWN_RX_TX_REPORT); + case R88E_RXDW3_RPT_HIS: + return (RTWN_RX_OTHER); + default: /* shut up the compiler */ + return (RTWN_RX_DATA); + } +} + void r88e_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len) { Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu.h Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu.h Wed Jan 2 05:21:06 2019 (r342677) @@ -33,7 +33,4 @@ void r88eu_init_intr(struct rtwn_softc *); void r88eu_init_rx_agg(struct rtwn_softc *); void r88eu_post_init(struct rtwn_softc *); -/* r88eu_rx.c */ -int r88eu_classify_intr(struct rtwn_softc *, void *, int); - #endif /* RTL8188EU_H */ Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 05:21:06 2019 (r342677) @@ -130,7 +130,7 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->sc_get_rx_stats = r88e_get_rx_stats; sc->sc_get_rssi_cck = r88e_get_rssi_cck; sc->sc_get_rssi_ofdm = r88e_get_rssi_ofdm; - sc->sc_classify_intr = r88eu_classify_intr; + sc->sc_classify_intr = r88e_classify_intr; sc->sc_handle_tx_report = r88e_ratectl_tx_complete; sc->sc_handle_c2h_report = r88e_handle_c2h_report; sc->sc_check_frame = rtwn_nop_int_softc_mbuf; Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce.h Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce.h Wed Jan 2 05:21:06 2019 (r342677) @@ -60,7 +60,7 @@ void r92ce_post_init(struct rtwn_softc *); void r92ce_set_led(struct rtwn_softc *, int, int); /* r92ce_rx.c */ -int r92ce_classify_intr(struct rtwn_softc *, void *, int); +int r92ce_get_intr_status(struct rtwn_pci_softc *, int *); void r92ce_enable_intr(struct rtwn_pci_softc *); void r92ce_start_xfers(struct rtwn_softc *); Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Wed Jan 2 05:21:06 2019 (r342677) @@ -155,6 +155,7 @@ r92ce_attach(struct rtwn_pci_softc *pc) pc->pc_tx_postsetup = r92ce_tx_postsetup; pc->pc_copy_tx_desc = r92ce_copy_tx_desc; pc->pc_enable_intr = r92ce_enable_intr; + pc->pc_get_intr_status = r92ce_get_intr_status; pc->pc_qmap = 0xf771; pc->tcr = @@ -175,7 +176,7 @@ r92ce_attach(struct rtwn_pci_softc *pc) sc->sc_get_rx_stats = r92c_get_rx_stats; sc->sc_get_rssi_cck = r92c_get_rssi_cck; sc->sc_get_rssi_ofdm = r92c_get_rssi_ofdm; - sc->sc_classify_intr = r92ce_classify_intr; + sc->sc_classify_intr = r92c_classify_intr; sc->sc_handle_tx_report = rtwn_nop_softc_uint8_int; sc->sc_handle_c2h_report = rtwn_nop_softc_uint8_int; sc->sc_check_frame = rtwn_nop_int_softc_mbuf; Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c Wed Jan 2 05:21:06 2019 (r342677) @@ -58,10 +58,10 @@ __FBSDID("$FreeBSD$"); int -r92ce_classify_intr(struct rtwn_softc *sc, void *arg, int len __unused) +r92ce_get_intr_status(struct rtwn_pci_softc *pc, int *rings) { + struct rtwn_softc *sc = &pc->pc_sc; uint32_t status; - int *rings = arg; int ret; *rings = 0; Modified: head/sys/dev/rtwn/rtl8192c/r92c.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c.h Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/r92c.h Wed Jan 2 05:21:06 2019 (r342677) @@ -102,6 +102,7 @@ void r92c_efuse_postread(struct rtwn_softc *); void r92c_parse_rom(struct rtwn_softc *, uint8_t *); /* r92c_rx.c */ +int r92c_classify_intr(struct rtwn_softc *, void *, int); int8_t r92c_get_rssi_cck(struct rtwn_softc *, void *); int8_t r92c_get_rssi_ofdm(struct rtwn_softc *, void *); uint8_t r92c_rx_radiotap_flags(const void *); Modified: head/sys/dev/rtwn/rtl8192c/r92c_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_rx.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/r92c_rx.c Wed Jan 2 05:21:06 2019 (r342677) @@ -52,6 +52,13 @@ __FBSDID("$FreeBSD$"); #include +int +r92c_classify_intr(struct rtwn_softc *sc, void *buf, int len) +{ + /* NB: reports are fetched from C2H_MSG register. */ + return (RTWN_RX_DATA); +} + int8_t r92c_get_rssi_cck(struct rtwn_softc *sc, void *physt) { Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/usb/r92cu.h Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/usb/r92cu.h Wed Jan 2 05:21:06 2019 (r342677) @@ -47,7 +47,6 @@ void r92cu_post_init(struct rtwn_softc *); void r92cu_set_led(struct rtwn_softc *, int, int); /* r92cu_rx.c */ -int r92cu_classify_intr(struct rtwn_softc *, void *, int); int r92cu_align_rx(int, int); /* r92cu_tx.c */ Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c Wed Jan 2 05:21:06 2019 (r342677) @@ -168,7 +168,7 @@ r92cu_attach(struct rtwn_usb_softc *uc) sc->sc_get_rx_stats = r92c_get_rx_stats; sc->sc_get_rssi_cck = r92c_get_rssi_cck; sc->sc_get_rssi_ofdm = r92c_get_rssi_ofdm; - sc->sc_classify_intr = r92cu_classify_intr; + sc->sc_classify_intr = r92c_classify_intr; sc->sc_handle_tx_report = rtwn_nop_softc_uint8_int; sc->sc_handle_c2h_report = rtwn_nop_softc_uint8_int; sc->sc_check_frame = rtwn_nop_int_softc_mbuf; Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c Wed Jan 2 05:21:06 2019 (r342677) @@ -50,13 +50,6 @@ __FBSDID("$FreeBSD$"); int -r92cu_classify_intr(struct rtwn_softc *sc, void *buf, int len) -{ - /* NB: reports are fetched from C2H_MSG register. */ - return (RTWN_RX_DATA); -} - -int r92cu_align_rx(int totlen, int len) { return (roundup2(totlen, 128)); Modified: head/sys/modules/rtwn_usb/Makefile ============================================================================== --- head/sys/modules/rtwn_usb/Makefile Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/modules/rtwn_usb/Makefile Wed Jan 2 05:21:06 2019 (r342677) @@ -13,7 +13,7 @@ SRCS = rtwn_usb_attach.c rtwn_usb_ep.c rtwn_usb_reg.c opt_bus.h opt_rtwn.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h .PATH: ${SRCTOP}/sys/dev/rtwn/rtl8188e/usb -SRCS += r88eu_attach.c r88eu_init.c r88eu_rx.c \ +SRCS += r88eu_attach.c r88eu_init.c \ r88eu.h r88eu_reg.h .PATH: ${SRCTOP}/sys/dev/rtwn/rtl8192c/usb From owner-svn-src-all@freebsd.org Wed Jan 2 05:30:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57CEA1435E80; Wed, 2 Jan 2019 05:30:43 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF56D734A8; Wed, 2 Jan 2019 05:30:42 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E34DF50D7; Wed, 2 Jan 2019 05:30:42 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x025UgxW037919; Wed, 2 Jan 2019 05:30:42 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x025UfIV037915; Wed, 2 Jan 2019 05:30:41 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020530.x025UfIV037915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 05:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342678 - in head/sys/dev/rtwn/rtl8188e: . usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn/rtl8188e: . usb X-SVN-Commit-Revision: 342678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF56D734A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 05:30:43 -0000 Author: avos Date: Wed Jan 2 05:30:41 2019 New Revision: 342678 URL: https://svnweb.freebsd.org/changeset/base/342678 Log: Move USB-specific parts from rtwn(4) to rtwn_usb(4) MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8188e/r88e.h head/sys/dev/rtwn/rtl8188e/r88e_init.c head/sys/dev/rtwn/rtl8188e/usb/r88eu.h head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c head/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c Modified: head/sys/dev/rtwn/rtl8188e/r88e.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e.h Wed Jan 2 05:21:06 2019 (r342677) +++ head/sys/dev/rtwn/rtl8188e/r88e.h Wed Jan 2 05:30:41 2019 (r342678) @@ -24,9 +24,7 @@ /* * Global definitions. */ -#define R88E_PUBQ_NPAGES 142 #define R88E_TXPKTBUF_COUNT 177 -#define R88E_TX_PAGE_COUNT 169 #define R88E_MACID_MAX 63 #define R88E_RX_DMA_BUFFER_SIZE 0x2400 @@ -67,9 +65,8 @@ int r88e_set_pwrmode(struct rtwn_softc *, struct ieee8 #endif /* r88e_init.c */ -void r88e_init_bb(struct rtwn_softc *); +void r88e_init_bb_common(struct rtwn_softc *); void r88e_init_rf(struct rtwn_softc *); -int r88e_power_on(struct rtwn_softc *); /* r88e_led.c */ void r88e_set_led(struct rtwn_softc *, int, int); Modified: head/sys/dev/rtwn/rtl8188e/r88e_init.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_init.c Wed Jan 2 05:21:06 2019 (r342677) +++ head/sys/dev/rtwn/rtl8188e/r88e_init.c Wed Jan 2 05:30:41 2019 (r342678) @@ -70,20 +70,8 @@ r88e_crystalcap_write(struct rtwn_softc *sc) } void -r88e_init_bb(struct rtwn_softc *sc) +r88e_init_bb_common(struct rtwn_softc *sc) { - - /* Enable BB and RF. */ - rtwn_setbits_2(sc, R92C_SYS_FUNC_EN, 0, - R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST | - R92C_SYS_FUNC_EN_DIO_RF); - - rtwn_write_1(sc, R92C_RF_CTRL, - R92C_RF_CTRL_EN | R92C_RF_CTRL_RSTB | R92C_RF_CTRL_SDMRSTB); - rtwn_write_1(sc, R92C_SYS_FUNC_EN, - R92C_SYS_FUNC_EN_USBA | R92C_SYS_FUNC_EN_USBD | - R92C_SYS_FUNC_EN_BB_GLB_RST | R92C_SYS_FUNC_EN_BBRSTB); - r92c_init_bb_common(sc); rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), 0x69553422); @@ -92,67 +80,4 @@ r88e_init_bb(struct rtwn_softc *sc) rtwn_delay(sc, 1); r88e_crystalcap_write(sc); -} - -int -r88e_power_on(struct rtwn_softc *sc) -{ -#define RTWN_CHK(res) do { \ - if (res != 0) \ - return (EIO); \ -} while(0) - int ntries; - - /* Wait for power ready bit. */ - for (ntries = 0; ntries < 5000; ntries++) { - if (rtwn_read_4(sc, R92C_APS_FSMCO) & R92C_APS_FSMCO_SUS_HOST) - break; - rtwn_delay(sc, 10); - } - if (ntries == 5000) { - device_printf(sc->sc_dev, - "timeout waiting for chip power up\n"); - return (ETIMEDOUT); - } - - /* Reset BB. */ - RTWN_CHK(rtwn_setbits_1(sc, R92C_SYS_FUNC_EN, - R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST, 0)); - - RTWN_CHK(rtwn_setbits_1(sc, R92C_AFE_XTAL_CTRL + 2, 0, 0x80)); - - /* Disable HWPDN. */ - RTWN_CHK(rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, - R92C_APS_FSMCO_APDM_HPDN, 0, 1)); - - /* Disable WL suspend. */ - RTWN_CHK(rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, - R92C_APS_FSMCO_AFSM_HSUS | R92C_APS_FSMCO_AFSM_PCIE, 0, 1)); - - RTWN_CHK(rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, - 0, R92C_APS_FSMCO_APFM_ONMAC, 1)); - for (ntries = 0; ntries < 5000; ntries++) { - if (!(rtwn_read_2(sc, R92C_APS_FSMCO) & - R92C_APS_FSMCO_APFM_ONMAC)) - break; - rtwn_delay(sc, 10); - } - if (ntries == 5000) - return (ETIMEDOUT); - - /* Enable LDO normal mode. */ - RTWN_CHK(rtwn_setbits_1(sc, R92C_LPLDO_CTRL, - R92C_LPLDO_CTRL_SLEEP, 0)); - - /* Enable MAC DMA/WMAC/SCHEDULE/SEC blocks. */ - RTWN_CHK(rtwn_write_2(sc, R92C_CR, 0)); - RTWN_CHK(rtwn_setbits_2(sc, R92C_CR, 0, - R92C_CR_HCI_TXDMA_EN | R92C_CR_TXDMA_EN | - R92C_CR_HCI_RXDMA_EN | R92C_CR_RXDMA_EN | - R92C_CR_PROTOCOL_EN | R92C_CR_SCHEDULE_EN | - ((sc->sc_hwcrypto != RTWN_CRYPTO_SW) ? R92C_CR_ENSEC : 0) | - R92C_CR_CALTMR_EN)); - - return (0); -#undef RTWN_CHK } Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu.h Wed Jan 2 05:21:06 2019 (r342677) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu.h Wed Jan 2 05:30:41 2019 (r342678) @@ -25,9 +25,18 @@ /* + * Global definitions. + */ +#define R88EU_PUBQ_NPAGES 142 +#define R88EU_TX_PAGE_COUNT 169 + + +/* * Function declarations. */ /* r88eu_init.c */ +void r88eu_init_bb(struct rtwn_softc *); +int r88eu_power_on(struct rtwn_softc *); void r88eu_power_off(struct rtwn_softc *); void r88eu_init_intr(struct rtwn_softc *); void r88eu_init_rx_agg(struct rtwn_softc *); Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 05:21:06 2019 (r342677) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 05:30:41 2019 (r342678) @@ -140,7 +140,7 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->sc_efuse_postread = rtwn_nop_softc; sc->sc_parse_rom = r88e_parse_rom; sc->sc_set_led = r88e_set_led; - sc->sc_power_on = r88e_power_on; + sc->sc_power_on = r88eu_power_on; sc->sc_power_off = r88eu_power_off; #ifndef RTWN_WITHOUT_UCODE sc->sc_fw_reset = r88e_fw_reset; @@ -172,7 +172,7 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->sc_init_ampdu = rtwn_nop_softc; sc->sc_init_intr = r88eu_init_intr; sc->sc_init_edca = r92c_init_edca; - sc->sc_init_bb = r88e_init_bb; + sc->sc_init_bb = r88eu_init_bb; sc->sc_init_rf = r92c_init_rf; sc->sc_init_antsel = rtwn_nop_softc; sc->sc_post_init = r88eu_post_init; @@ -190,11 +190,11 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->fwname = "rtwn-rtl8188eufw"; sc->fwsig = 0x88e; - sc->page_count = R88E_TX_PAGE_COUNT; + sc->page_count = R88EU_TX_PAGE_COUNT; sc->pktbuf_count = R88E_TXPKTBUF_COUNT; sc->ackto = 0x40; - sc->npubqpages = R88E_PUBQ_NPAGES; + sc->npubqpages = R88EU_PUBQ_NPAGES; sc->page_size = R92C_TX_PAGE_SIZE; sc->txdesc_len = sizeof(struct r92cu_tx_desc); Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c Wed Jan 2 05:21:06 2019 (r342677) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c Wed Jan 2 05:30:41 2019 (r342678) @@ -55,6 +55,87 @@ __FBSDID("$FreeBSD$"); void +r88eu_init_bb(struct rtwn_softc *sc) +{ + + /* Enable BB and RF. */ + rtwn_setbits_2(sc, R92C_SYS_FUNC_EN, 0, + R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST | + R92C_SYS_FUNC_EN_DIO_RF); + + rtwn_write_1(sc, R92C_RF_CTRL, + R92C_RF_CTRL_EN | R92C_RF_CTRL_RSTB | R92C_RF_CTRL_SDMRSTB); + rtwn_write_1(sc, R92C_SYS_FUNC_EN, + R92C_SYS_FUNC_EN_USBA | R92C_SYS_FUNC_EN_USBD | + R92C_SYS_FUNC_EN_BB_GLB_RST | R92C_SYS_FUNC_EN_BBRSTB); + + r88e_init_bb_common(sc); +} + +int +r88eu_power_on(struct rtwn_softc *sc) +{ +#define RTWN_CHK(res) do { \ + if (res != 0) \ + return (EIO); \ +} while(0) + int ntries; + + /* Wait for power ready bit. */ + for (ntries = 0; ntries < 5000; ntries++) { + if (rtwn_read_4(sc, R92C_APS_FSMCO) & R92C_APS_FSMCO_SUS_HOST) + break; + rtwn_delay(sc, 10); + } + if (ntries == 5000) { + device_printf(sc->sc_dev, + "timeout waiting for chip power up\n"); + return (ETIMEDOUT); + } + + /* Reset BB. */ + RTWN_CHK(rtwn_setbits_1(sc, R92C_SYS_FUNC_EN, + R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST, 0)); + + RTWN_CHK(rtwn_setbits_1(sc, R92C_AFE_XTAL_CTRL + 2, 0, 0x80)); + + /* Disable HWPDN. */ + RTWN_CHK(rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, + R92C_APS_FSMCO_APDM_HPDN, 0, 1)); + + /* Disable WL suspend. */ + RTWN_CHK(rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, + R92C_APS_FSMCO_AFSM_HSUS | R92C_APS_FSMCO_AFSM_PCIE, 0, 1)); + + RTWN_CHK(rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, + 0, R92C_APS_FSMCO_APFM_ONMAC, 1)); + for (ntries = 0; ntries < 5000; ntries++) { + if (!(rtwn_read_2(sc, R92C_APS_FSMCO) & + R92C_APS_FSMCO_APFM_ONMAC)) + break; + rtwn_delay(sc, 10); + } + if (ntries == 5000) + return (ETIMEDOUT); + + /* Enable LDO normal mode. */ + RTWN_CHK(rtwn_setbits_1(sc, R92C_LPLDO_CTRL, + R92C_LPLDO_CTRL_SLEEP, 0)); + + /* Enable MAC DMA/WMAC/SCHEDULE/SEC blocks. */ + RTWN_CHK(rtwn_write_2(sc, R92C_CR, 0)); + RTWN_CHK(rtwn_setbits_2(sc, R92C_CR, 0, + R92C_CR_HCI_TXDMA_EN | R92C_CR_TXDMA_EN | + R92C_CR_HCI_RXDMA_EN | R92C_CR_RXDMA_EN | + R92C_CR_PROTOCOL_EN | R92C_CR_SCHEDULE_EN | + ((sc->sc_hwcrypto != RTWN_CRYPTO_SW) ? R92C_CR_ENSEC : 0) | + R92C_CR_CALTMR_EN)); + + return (0); +#undef RTWN_CHK +} + +void r88eu_power_off(struct rtwn_softc *sc) { uint8_t reg; From owner-svn-src-all@freebsd.org Wed Jan 2 05:37:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 491801436169; Wed, 2 Jan 2019 05:37:31 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5B3573901; Wed, 2 Jan 2019 05:37:30 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9AC0528B; Wed, 2 Jan 2019 05:37:30 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x025bUm7042973; Wed, 2 Jan 2019 05:37:30 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x025bUgg042972; Wed, 2 Jan 2019 05:37:30 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020537.x025bUgg042972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 05:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342679 - head/sys/dev/rtwn/rtl8188e X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/rtwn/rtl8188e X-SVN-Commit-Revision: 342679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5B3573901 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.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 05:37:31 -0000 Author: avos Date: Wed Jan 2 05:37:30 2019 New Revision: 342679 URL: https://svnweb.freebsd.org/changeset/base/342679 Log: rtwn(4): do not try to start RTL8188E* MCU during device shutdown. MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8188e/r88e_fw.c Modified: head/sys/dev/rtwn/rtl8188e/r88e_fw.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_fw.c Wed Jan 2 05:30:41 2019 (r342678) +++ head/sys/dev/rtwn/rtl8188e/r88e_fw.c Wed Jan 2 05:37:30 2019 (r342679) @@ -109,7 +109,11 @@ r88e_fw_reset(struct rtwn_softc *sc, int reason) reg = rtwn_read_2(sc, R92C_SYS_FUNC_EN); rtwn_write_2(sc, R92C_SYS_FUNC_EN, reg & ~R92C_SYS_FUNC_EN_CPUEN); - rtwn_write_2(sc, R92C_SYS_FUNC_EN, reg | R92C_SYS_FUNC_EN_CPUEN); + + if (reason != RTWN_FW_RESET_SHUTDOWN) { + rtwn_write_2(sc, R92C_SYS_FUNC_EN, + reg | R92C_SYS_FUNC_EN_CPUEN); + } } void From owner-svn-src-all@freebsd.org Wed Jan 2 05:43:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68FCF14363E4; Wed, 2 Jan 2019 05:43:34 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D98373D13; Wed, 2 Jan 2019 05:43:34 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0E3B542E; Wed, 2 Jan 2019 05:43:33 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x025hX3s047745; Wed, 2 Jan 2019 05:43:33 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x025hXBj047743; Wed, 2 Jan 2019 05:43:33 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020543.x025hXBj047743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 05:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342680 - in head/sys/dev/rtwn/rtl8188e: . usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn/rtl8188e: . usb X-SVN-Commit-Revision: 342680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D98373D13 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)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 05:43:34 -0000 Author: avos Date: Wed Jan 2 05:43:33 2019 New Revision: 342680 URL: https://svnweb.freebsd.org/changeset/base/342680 Log: rtwn(4): rename common RTL8188E* structures. No functional change intended. MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8188e/r88e_priv.h head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Modified: head/sys/dev/rtwn/rtl8188e/r88e_priv.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_priv.h Wed Jan 2 05:37:30 2019 (r342679) +++ head/sys/dev/rtwn/rtl8188e/r88e_priv.h Wed Jan 2 05:43:33 2019 (r342680) @@ -37,7 +37,7 @@ struct rtwn_r88e_txpwr { /* * MAC initialization values. */ -static const struct rtwn_mac_prog rtl8188eu_mac[] = { +static const struct rtwn_mac_prog rtl8188e_mac[] = { { 0x026, 0x41 }, { 0x027, 0x35 }, { 0x040, 0x00 }, { 0x428, 0x0a }, { 0x429, 0x10 }, { 0x430, 0x00 }, { 0x431, 0x01 }, { 0x432, 0x02 }, { 0x433, 0x04 }, { 0x434, 0x05 }, { 0x435, 0x06 }, { 0x436, 0x07 }, @@ -66,7 +66,7 @@ static const struct rtwn_mac_prog rtl8188eu_mac[] = { /* * Baseband initialization values. */ -static const uint16_t rtl8188eu_bb_regs[] = { +static const uint16_t rtl8188e_bb_regs[] = { 0x800, 0x804, 0x808, 0x80c, 0x810, 0x814, 0x818, 0x81c, 0x820, 0x824, 0x828, 0x82c, 0x830, 0x834, 0x838, 0x83c, 0x840, 0x844, 0x848, 0x84c, 0x850, 0x854, 0x858, 0x85c, @@ -93,7 +93,7 @@ static const uint16_t rtl8188eu_bb_regs[] = { 0xed8, 0xedc, 0xee0, 0xee8, 0xeec, 0xf14, 0xf4c, 0xf00 }; -static const uint32_t rtl8188eu_bb_vals[] = { +static const uint32_t rtl8188e_bb_vals[] = { 0x80040000, 0x00000003, 0x0000fc00, 0x0000000a, 0x10001331, 0x020c3d10, 0x02200385, 0x00000000, 0x01000100, 0x00390204, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -135,17 +135,17 @@ static const uint32_t rtl8188eu_bb_vals[] = { 0x00000000, 0x00000300 }; -static const struct rtwn_bb_prog rtl8188eu_bb[] = { +static const struct rtwn_bb_prog rtl8188e_bb[] = { { - nitems(rtl8188eu_bb_regs), - rtl8188eu_bb_regs, - rtl8188eu_bb_vals, + nitems(rtl8188e_bb_regs), + rtl8188e_bb_regs, + rtl8188e_bb_vals, { 0 }, NULL } }; -static const uint32_t rtl8188eu_agc_vals[] = { +static const uint32_t rtl8188e_agc_vals[] = { 0xfb000001, 0xfb010001, 0xfb020001, 0xfb030001, 0xfb040001, 0xfb050001, 0xfa060001, 0xf9070001, 0xf8080001, 0xf7090001, 0xf60a0001, 0xf50b0001, 0xf40c0001, 0xf30d0001, 0xf20e0001, @@ -174,10 +174,10 @@ static const uint32_t rtl8188eu_agc_vals[] = { 0x407d0001, 0x407e0001, 0x407f0001 }; -static const struct rtwn_agc_prog rtl8188eu_agc[] = { +static const struct rtwn_agc_prog rtl8188e_agc[] = { { - nitems(rtl8188eu_agc_vals), - rtl8188eu_agc_vals, + nitems(rtl8188e_agc_vals), + rtl8188e_agc_vals, { 0 }, NULL } @@ -186,7 +186,7 @@ static const struct rtwn_agc_prog rtl8188eu_agc[] = { /* * RF initialization values. */ -static const uint8_t rtl8188eu_rf_regs[] = { +static const uint8_t rtl8188e_rf_regs[] = { 0x00, 0x08, 0x18, 0x19, 0x1e, 0x1f, 0x2f, 0x3f, 0x42, 0x57, 0x58, 0x67, 0x83, 0xb0, 0xb1, 0xb2, 0xb4, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbf, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, @@ -199,7 +199,7 @@ static const uint8_t rtl8188eu_rf_regs[] = { 0x1f, 0xfe, 0xfe, 0x1e, 0x1f, 0x00 }; -static const uint32_t rtl8188eu_rf_vals[] = { +static const uint32_t rtl8188e_rf_vals[] = { 0x30000, 0x84000, 0x00407, 0x00012, 0x80009, 0x00880, 0x1a060, 0x00000, 0x060c0, 0xd0000, 0xbe180, 0x01552, 0x00000, 0xff8fc, 0x54400, 0xccc19, 0x43003, 0x4953e, 0x1c718, 0x060ff, 0x80001, @@ -216,11 +216,11 @@ static const uint32_t rtl8188eu_rf_vals[] = { 0x0c350, 0x0c350, 0x00001, 0x80000, 0x33e60 }; -static const struct rtwn_rf_prog rtl8188eu_rf[] = { +static const struct rtwn_rf_prog rtl8188e_rf[] = { { - nitems(rtl8188eu_rf_regs), - rtl8188eu_rf_regs, - rtl8188eu_rf_vals, + nitems(rtl8188e_rf_regs), + rtl8188e_rf_regs, + rtl8188e_rf_vals, { 0 }, NULL }, Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 05:37:30 2019 (r342679) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 05:43:33 2019 (r342680) @@ -178,13 +178,13 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->sc_post_init = r88eu_post_init; sc->sc_init_bcnq1_boundary = rtwn_nop_int_softc; - sc->mac_prog = &rtl8188eu_mac[0]; - sc->mac_size = nitems(rtl8188eu_mac); - sc->bb_prog = &rtl8188eu_bb[0]; - sc->bb_size = nitems(rtl8188eu_bb); - sc->agc_prog = &rtl8188eu_agc[0]; - sc->agc_size = nitems(rtl8188eu_agc); - sc->rf_prog = &rtl8188eu_rf[0]; + sc->mac_prog = &rtl8188e_mac[0]; + sc->mac_size = nitems(rtl8188e_mac); + sc->bb_prog = &rtl8188e_bb[0]; + sc->bb_size = nitems(rtl8188e_bb); + sc->agc_prog = &rtl8188e_agc[0]; + sc->agc_size = nitems(rtl8188e_agc); + sc->rf_prog = &rtl8188e_rf[0]; sc->name = "RTL8188EU"; sc->fwname = "rtwn-rtl8188eufw"; From owner-svn-src-all@freebsd.org Wed Jan 2 06:03:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BD3E1436D3C; Wed, 2 Jan 2019 06:03:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2762874C8F; Wed, 2 Jan 2019 06:03:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1569A5797; Wed, 2 Jan 2019 06:03:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0263KCM058228; Wed, 2 Jan 2019 06:03:20 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0263JQA058221; Wed, 2 Jan 2019 06:03:19 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020603.x0263JQA058221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 06:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342681 - in head/sys/dev/rtwn: rtl8188e rtl8188e/usb rtl8192c rtl8192c/pci rtl8192c/usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: rtl8188e rtl8188e/usb rtl8192c rtl8192c/pci rtl8192c/usb X-SVN-Commit-Revision: 342681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2762874C8F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Jan 2019 06:03:21 -0000 Author: avos Date: Wed Jan 2 06:03:19 2019 New Revision: 342681 URL: https://svnweb.freebsd.org/changeset/base/342681 Log: rtwn(4): rename set_name -> set_rom_opts method and reuse it for RTL8188E* MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8188e/r88e_rom.c head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c head/sys/dev/rtwn/rtl8192c/r92c_rom.c head/sys/dev/rtwn/rtl8192c/r92c_var.h head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c Modified: head/sys/dev/rtwn/rtl8188e/r88e_rom.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_rom.c Wed Jan 2 05:43:33 2019 (r342680) +++ head/sys/dev/rtwn/rtl8188e/r88e_rom.c Wed Jan 2 06:03:19 2019 (r342681) @@ -81,5 +81,6 @@ r88e_parse_rom(struct rtwn_softc *sc, uint8_t *buf) __func__,rs->regulatory); sc->thermal_meter = rom->thermal_meter; - IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, rom->macaddr); + + rtwn_r92c_set_rom_opts(sc, buf); } Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 05:43:33 2019 (r342680) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 06:03:19 2019 (r342681) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* for 'macaddr' field */ #include @@ -66,6 +67,14 @@ static struct rtwn_r88e_txpwr r88e_txpwr; void r88eu_attach(struct rtwn_usb_softc *); static void +r88eu_set_macaddr(struct rtwn_softc *sc, uint8_t *buf) +{ + struct r88e_rom *rom = (struct r88e_rom *)buf; + + IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, rom->macaddr); +} + +static void r88e_postattach(struct rtwn_softc *sc) { struct r92c_softc *rs = sc->sc_priv; @@ -93,7 +102,7 @@ r88eu_attach_private(struct rtwn_softc *sc) rs->rs_tx_enable_ampdu = r88e_tx_enable_ampdu; rs->rs_tx_setup_hwseq = r88e_tx_setup_hwseq; rs->rs_tx_setup_macid = r88e_tx_setup_macid; - rs->rs_set_name = rtwn_nop_softc; /* not used */ + rs->rs_set_rom_opts = r88eu_set_macaddr; rs->rf_read_delay[0] = 10; rs->rf_read_delay[1] = 100; Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Wed Jan 2 05:43:33 2019 (r342680) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Wed Jan 2 06:03:19 2019 (r342681) @@ -92,7 +92,7 @@ r92ce_postattach(struct rtwn_softc *sc) } static void -r92ce_set_name(struct rtwn_softc *sc) +r92ce_set_name(struct rtwn_softc *sc, uint8_t *buf) { struct r92c_softc *rs = sc->sc_priv; @@ -117,7 +117,7 @@ r92ce_attach_private(struct rtwn_softc *sc) rs->rs_tx_enable_ampdu = r92c_tx_enable_ampdu; rs->rs_tx_setup_hwseq = r92c_tx_setup_hwseq; rs->rs_tx_setup_macid = r92c_tx_setup_macid; - rs->rs_set_name = r92ce_set_name; + rs->rs_set_rom_opts = r92ce_set_name; /* XXX TODO: test with net80211 ratectl! */ #ifndef RTWN_WITHOUT_UCODE Modified: head/sys/dev/rtwn/rtl8192c/r92c_rom.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_rom.c Wed Jan 2 05:43:33 2019 (r342680) +++ head/sys/dev/rtwn/rtl8192c/r92c_rom.c Wed Jan 2 06:03:19 2019 (r342681) @@ -96,7 +96,7 @@ r92c_parse_rom(struct rtwn_softc *sc, uint8_t *buf) __func__, rs->regulatory); /* Need to be set before postinit() (but after preinit()). */ - rtwn_r92c_set_name(sc); + rtwn_r92c_set_rom_opts(sc, buf); r92c_set_chains(sc); for (j = 0; j < R92C_GROUP_2G; j++) { Modified: head/sys/dev/rtwn/rtl8192c/r92c_var.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_var.h Wed Jan 2 05:43:33 2019 (r342680) +++ head/sys/dev/rtwn/rtl8192c/r92c_var.h Wed Jan 2 06:03:19 2019 (r342681) @@ -58,7 +58,7 @@ struct r92c_softc { void (*rs_tx_enable_ampdu)(void *, int); void (*rs_tx_setup_hwseq)(void *); void (*rs_tx_setup_macid)(void *, int); - void (*rs_set_name)(struct rtwn_softc *); + void (*rs_set_rom_opts)(struct rtwn_softc *, uint8_t *); int rf_read_delay[3]; uint32_t rf_chnlbw[R92C_MAX_CHAINS]; @@ -77,7 +77,7 @@ struct r92c_softc { ((R92C_SOFTC(_sc)->rs_tx_setup_hwseq)((_buf))) #define rtwn_r92c_tx_setup_macid(_sc, _buf, _id) \ ((R92C_SOFTC(_sc)->rs_tx_setup_macid)((_buf), (_id))) -#define rtwn_r92c_set_name(_sc) \ - ((R92C_SOFTC(_sc)->rs_set_name)((_sc))) +#define rtwn_r92c_set_rom_opts(_sc, _buf) \ + ((R92C_SOFTC(_sc)->rs_set_rom_opts)((_sc), (_buf))) #endif /* R92C_VAR_H */ Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c Wed Jan 2 05:43:33 2019 (r342680) +++ head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c Wed Jan 2 06:03:19 2019 (r342681) @@ -94,7 +94,7 @@ r92cu_postattach(struct rtwn_softc *sc) } static void -r92cu_set_name(struct rtwn_softc *sc) +r92cu_set_name(struct rtwn_softc *sc, uint8_t *buf) { struct r92c_softc *rs = sc->sc_priv; @@ -124,7 +124,7 @@ r92cu_attach_private(struct rtwn_softc *sc) rs->rs_tx_enable_ampdu = r92c_tx_enable_ampdu; rs->rs_tx_setup_hwseq = r92c_tx_setup_hwseq; rs->rs_tx_setup_macid = r92c_tx_setup_macid; - rs->rs_set_name = r92cu_set_name; + rs->rs_set_rom_opts = r92cu_set_name; #ifndef RTWN_WITHOUT_UCODE rs->rs_c2h_timeout = hz; From owner-svn-src-all@freebsd.org Wed Jan 2 06:48:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66A801437C9F; Wed, 2 Jan 2019 06:48:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 149B375FA0; Wed, 2 Jan 2019 06:48:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBA0A5E58; Wed, 2 Jan 2019 06:48:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x026ms8B079339; Wed, 2 Jan 2019 06:48:54 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x026mrmC079331; Wed, 2 Jan 2019 06:48:53 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020648.x026mrmC079331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 06:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342682 - in head: share/man/man4 sys/contrib/dev/rtwn sys/dev/rtwn/pci sys/dev/rtwn/rtl8188e sys/dev/rtwn/rtl8188e/pci sys/dev/rtwn/rtl8188e/usb sys/modules/rtwn_pci sys/modules/rtwnfw... X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head: share/man/man4 sys/contrib/dev/rtwn sys/dev/rtwn/pci sys/dev/rtwn/rtl8188e sys/dev/rtwn/rtl8188e/pci sys/dev/rtwn/rtl8188e/usb sys/modules/rtwn_pci sys/modules/rtwnfw sys/modules/rtwnfw/rtwnr... X-SVN-Commit-Revision: 342682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 149B375FA0 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.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 06:48:55 -0000 Author: avos Date: Wed Jan 2 06:48:53 2019 New Revision: 342682 URL: https://svnweb.freebsd.org/changeset/base/342682 Log: rtwn_pci(4): add support for RTL8188EE chipset. Initially based on https://reviews.freebsd.org/D15692; later deduplicated and improved a bit (Tx reports, IQ calibration support). Submitted by: Farhan Khan MFC after: 4 days Relnotes: yes Differential Revision: https://reviews.freebsd.org/D15692 Added: head/sys/contrib/dev/rtwn/rtwn-rtl8188eefw.fw.uu head/sys/dev/rtwn/rtl8188e/pci/ head/sys/dev/rtwn/rtl8188e/pci/r88ee.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/pci/r88ee_attach.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/pci/r88ee_reg.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/pci/r88ee_rx.c (contents, props changed) head/sys/modules/rtwnfw/rtwnrtl8188ee/ head/sys/modules/rtwnfw/rtwnrtl8188ee/Makefile (contents, props changed) Modified: head/share/man/man4/rtwn.4 head/share/man/man4/rtwn_pci.4 head/sys/dev/rtwn/pci/rtwn_pci_attach.h head/sys/dev/rtwn/rtl8188e/r88e_reg.h head/sys/dev/rtwn/rtl8188e/r88e_rom_image.h head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c head/sys/modules/rtwn_pci/Makefile head/sys/modules/rtwnfw/Makefile Modified: head/share/man/man4/rtwn.4 ============================================================================== --- head/share/man/man4/rtwn.4 Wed Jan 2 06:03:19 2019 (r342681) +++ head/share/man/man4/rtwn.4 Wed Jan 2 06:48:53 2019 (r342682) @@ -93,6 +93,7 @@ The driver (if not compiled with ) may use following firmware files, which are loaded when an interface is brought up: .Bl -tag -width Ds -offset indent -compact +.It Pa /boot/kernel/rtwn-rtl8188eefw.ko .It Pa /boot/kernel/rtwn-rtl8188eufw.ko .It Pa /boot/kernel/rtwn-rtl8192cfwE_B.ko .It Pa /boot/kernel/rtwn-rtl8192cfwE.ko Modified: head/share/man/man4/rtwn_pci.4 ============================================================================== --- head/share/man/man4/rtwn_pci.4 Wed Jan 2 06:03:19 2019 (r342681) +++ head/share/man/man4/rtwn_pci.4 Wed Jan 2 06:48:53 2019 (r342682) @@ -48,11 +48,11 @@ kernel configuration file: The .Nm driver supports PCIe wireless network devices based on the Realtek -RTL8188CE chipset. +RTL8188CE/RTL8188EE chipsets. .Pp -The RTL8188CE is a highly integrated 802.11n adapter that combines a MAC, -a 1T1R capable baseband and an RF in a single chip. -It operates in the 2GHz spectrum only. +Both RTL8188CE and RTL8188EE are highly integrated 802.11n adapters +that combines a MAC, a 1T1R capable baseband and an RF in a single chip. +They are operate in the 2GHz spectrum only. .Sh SEE ALSO .Xr pci 4 , .Xr rtwn 4 , Added: head/sys/contrib/dev/rtwn/rtwn-rtl8188eefw.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/rtwn/rtwn-rtl8188eefw.fw.uu Wed Jan 2 06:48:53 2019 (r342682) @@ -0,0 +1,506 @@ +begin 644 rtwn-rtl8188eefw.fw +MX8@0``@````0)2%6L"L``*($```````````````````"134````````````` +M````````P58````````````````````````````````````````````````` +M````````````H01X@!;F"'`+PJ_F,.$#1!CVTJ\(V>WJB]`BY0S_(R2!^`\( +M"+\$!'\`>('F,.3R`.4,PY]0(`4,=(@E#/CF_::!".:N#+X#`G3_S?CH;6#@ +M".;`X(#VY0S3GT`GY0PDB?CFK@R^`P)T__T8YLWXY8%M8`;0X/88@/7E#"2( +MR/85#(#3Y0PC)('X?P3"K^8PX`,0X@Q_`##A!S#C!'\(5/14?,;2KU2`0@(BF@70#8`;_"';_W_M_!.1X@/8(]@C?^GB!=C"01<5T`9/`X.23P.!#B0%U +MBF!UC'G2C-*O(@/OTY0#0`-__R)T@2\O^.8@Y?3"K^9$,/;2KZX,[L.?4"$. +M=(@N^.;Y".88O@,"=/_][6E@"0GG&1GW"0F`\Q86@-KNTY]`!`6!!8'NTY]` +M(G2(+O@(YOGNM0P"J8$8!@;F_>UI8`D9&><)"?<9@/,>@-GO)(CXY@3X[R\$ +MD$7%D_8([R^3]G\`(N_3E`-``W__(N\C)('XYC#E],*OYE2,]M*OY0RU!PIT +MB"_XYO6!`D)-4"YTB2_XYK\#`G3__1CF^72(+_C[YOSI;&`(J`7G]AT9@/2H +M`Z8%'^4,M0?C?P`B=(DO^.;]&(8!#W2(+_BF`0B&!.4,M0<"K('M;&`(#0FH +M!>;W@/3E#+4'WHF!?P`B[].4`T`#?_\B[R,D@?C"K^8PY04PX`+2Y-+BQM*O +M?P`PX@$/`D),C_#D__[E#",D@/C"J3#W#7\(YF`++?9@,%`N@`!@J$"XY).C^N23H_CDDZ/(Q8+(RL6#RO"CR,6" +MR,K%@\K?Z=[G@+X`08&7`$&!F`!!@:0`43172EK3I_51(R'JT[?U82,AZM/']7$C(>4Y'O(L#@P/#`@\""P-!U +MT`#``,`!P`+``\`$P`7`!L`'D`'$=%;P=$:C\!)C(N5!,.0$?P*1)^5#,.`" +MT?3E0S#A`Q)-N^5#,.(#$DX*Y4,PXP,28W_E0S#D`O&PY4,PY0+QWN5#,.8" +M\8OE1##A`M'J=%8$D`'$\'1&H_#0!]`&T`70!-`#T`+0`=``T-#0@M"#T/#0 +MX#*0@.?@8`,23H0BD($*X&`/Y/"0!5/@1`+PD`7\X`3PY/^0@.?@8'F0@*/@ +M9`%P<9"`YN#$5`]@)"3^8`,$3U'9"`\."`#>3U'9"`\.!U\`.D +M)/[_D(#OX"\23O.0`5=T!?"0@.K@(.(#$DK`(I"`H^"T`1.0@.?@8`V0@.O@ +M5/[P5`=P`O&F(I"`Z>#_?0$"2L20@*/@9`%P)9"`Y^!@'Y`!5^3PD`$\=`+P +MD(#DX%3[\)"`Z^!4_?!4!W`"\:8BD("CX+0!%I"`Y^!@$)"`YN!4#V0"8`," +M:DH23CTBP.#`\,"#P(+`T'70`,``P`'``L`#P`3`!<`&P`>0`<1T_/!T1Z/P +M$F-/Y4DPX0(1E.5),.(#$F.AY4DPXP,28]WE2C#@`Q)D&>5*,.0#$F2XY4PP +MX05_`Q)$)^5,,.0"$9[E3##E`Q)DSN5,,.8#$F5D=/P$D`'$\'1'H_#0!]`& +MT`70!-`#T`+0`=``T-#0@M"#T/#0X#*0@.?@8`,2:OLBL2J0@.W@%)`%<_!] +M`G\"46.0@0'@,.`MD("CX+0!)I"!I.`$\."T"@N0@0/@!/#DD(&D\)"!`^#_ +MD($"X+4'!>2C\!'D(N3_CU.0!!W@8!B0!2+@]59T__#Q\;\!`C%0@9O@D`0E\)"!G.!@#G0/+_6"Y#3\]8/@1(#PKP5T""_U@N0T_/6#Y/!T +M"2_U@N0T_/6#X%3P\'0A+?6"Y#3\]8/@5/?PK@2O!=#0DJ\B=#TO^.9-_O9T +M,"_U@N0T`?6#[O`BD`$V='CPHW0"\'UX_U%C?0)_`U%CD`8*X$0'\)"`\J/@ +MD`58\)"`H^"T`120@.7@5/OPD(#JX"#B#7T!?P2`#)"`Y>!$!/`B?0%_!-,0 +MKP'#P-"0@:'M\)"`ZN"0@:+PD(#DX/[$$Q-4`S#@`H$6[L03$Q-4`3#@`H$6 +MD(&BX/YO<`*!%N]P`F&-)/YP`F'&)/Y@223\<`*!`23\8`*!%NZT#@*1EI"! +MHN!P!'\!D;Z0@:+@M`8"D7"0@:+@M`0.D(&AX/]@!1)I@H`"\5>0@:+@9`A@ +M`H$6$F:'@1:0@:+@<`1_`9&^D(&BX+0&`I%PD(&BX+0.!Y$;OP$"D9:0@:+@ +M9`Q@`H$6D1OO9`%@`H$6D=B!%I"!HN"T#@>1&[\!`I&6D(&BX+0&`I%PD(&B +MX+0,!Y$;OP$"D=B0@:+@9`1P7!)HU.]D`7!4L0Z`4)"!HN"T#@>1&[\!`I&6 +MD(&BX+0&`I%PD(&BX+0,!Y$;OP$"D=B0@:+@<`1_`9&^D(&BX+0$&A)IQ(`5 +MD(&BX+0,#I"`Y>#_$Q-4/S#@`O'GT-"2KR+Q:N]D`6`(D`&X=`'P@#V0@.3@ +M_Q,3$U0?,.`(D`&X=`+P@"COQ%0/,.`(D`&X=`3P@!F0@.G@TY0$0`B0`;AT +M"/"`")`!N.3P?P$BD`&Y=`+P?P`BD(#EX)`&!"#@#.!$0/"0@.IT!/"`"N!4 +M?_"0@.IT#/"0!2+D\"*0@.7@PQ,@X`B0@.IT#/"`$9`&!.!$0/#@1(#PD(#J +M=`3PD`4BY/`BD(&C[_`29@R0@:/@8`60!2+D\)"`ZG0$\"*0@*/@9`%P+9"` +MY>!4_?"0!2)T;_!_`1'FOP$.D(#DX$2`\)"`ZG0.\"*0`;ET`?"0`;@$\"*0 +M!2)T__#Q\9`!-W0"\/U_`U%C$F:0Y)"`ZO`BD(#GX&`MD("CX&0!<"60@.[P +M!&`>D(#KX$00\.3U'9"`[]'RD`%7=`7PD(#JX"#B`E'`(N]P-GUX?P*QHWT" +M?P.QHWW(?P(29VZ0`5?D\)`!/'0"\'T!?PQ1Q)"`Y.!4]_!4[_"0!@K@5/CP +M(D%X?0)_`K&C?0%_`G0]+_CF_NWT7O[V=#`O]8+D-`'U@^[P(I"`Y^!@19"` +MY>#_$Q,35!\PX!*0`3O@,.0+L9F0@.W@%)`%<_"0@9GD=?`!$D2IPY"!FN"4 +M@)"!F>!D@)2`0`N0`9C@5/[PX$0!\/&S`:^0@.K@9`)@*A)J99"`Y>`3$Q-4 +M'S#@%9"`[>#_H^!O<`L29TJQF9"`[N`4\)`!YN`$\"*0`5_D\)`!/'0(\.3U +M'9"`^N##$U1_]1[D^_U_7'X!T?R0`5]T!?"0!I)T`O"0@.3@1!#PD(#JX&0, +M8`KD_7\,4<3D_Q'F(I"`Y^!D`7!>D(#FX%0/8$Z0@.K@<`/_D;Z0@.K@9`Q@ +M`O%7D`%;Y/"0`3QT!/#Q:N]D`7`Q]1V0@/K@PQ-4?_4>Y/O]?UA^`='\D`%; +M=`7PD`:2=`'PD(#DX$0(\"*0@.K@<`)1P"+PY/4=D(#YX/4>Y/O]?U1^`8X9 +MCQKE'E0'Q#-4X(49@X4:@O#E'50'Q#-4X/_E'A,3$U0?3Z/PZU0'Q#-4X/_E +M'1,3$U0?3X4:@H49@Z.C\+T!#(4:@HZ#HZ.C=`/P(H4:@H49@Z.CHW0!\"*0 +M!@3@5'_PD`4BY/"0@.IT#/`BD`0:X/1@`W\`(I`$&^!4!V0'?P%@`G\`(I"! +M>!)%!A)HDI"`Y^#_L5Z0@.?@8!F0@7@21/V0``$2'[U4#_^0``(2'[W]$FBC +M(I"!!.`PX"R0@0?@!/#@_Y"!!>"U!QV0!I+@5!QP"A'DD($(X`3P@`:0!I)T +M'/#DD($'\"(29I"0@.IT"/`BY)"!G?"C\)`%^.!P#Z/@<`NCX'`'H^!P`W\! +M(M.0@9[@E.B0@9W@E`-`"I`!P.!$(/!_`")_,GX`$C*JD(&=Y'7P`1)$J8"_ +MD`#WX"#G">!_`2#F#'\"(I``]^`PY@)_`R(1.9"``>_P$660`61T`?`"+:<1 +MTS$#$9(1L>3U-?4V]3?U.*TU?U`2,AZM-G]1$C(>K3=_4A(R'JTX?U,",AYU +M/1#D]3YU/P=U0`*0`3#E/?"CY3[PH^4_\*/E0/`B=44.=48!0T80=4<#=4AB +MD`$XY47PH^5&\*/E1_"CY4CP(I`!,.3PH_"C\*/PD`$X\*/PH_"C\/U_4!(R +M'N3]?U$2,A[D_7]2$C(>Y/U_4P(R'I`!-'3_\*/PH_"C\)`!//"C\*/PH_#] +M?U02,AY]_W]5$C(>??]_5A(R'GW_?U<",AZ0`(#@1(#]?X`2,AZ0_0#@5+_P +M,<`2,G=Q>S&G?P$20Q60@0!T`O#_$D,5D($`X`3P?P,20Q60@0#@!/`14S&, +MD`"`X$1`_7^`$C(>=2#_,;&1<>3_`D.>,:LQN+%#,!)$_9```A(?O9"! +M?/"`!9"!?._PD(%[[O"0@7S@_I"!>^#_TYY0.)"!>!)$_1(?I%0!_G2C+_6" +MY#2`]8/N\'2C+_6"Y#2`]8/@<`1Q,(`'D(%[X/]Q+Y"!>^`$\("ZD("CX'`E +MD(#JX'`$_Q),OI"`ZN!D#&`#$D]7D(#DX%3W\%3O\%2_\%1_\"(B(A(?I)"` +M\?`B$A^DD(#_\)"`_^"0`>?P(A(?I)"!"?"0``$2'[V0@0KP(A(?I/]4`?Z0 +M@0'@5/Y.\._#$S#@"I```1(?O9"!`O`BD`$!X$0$\)`!G'1^\*-TDO"C=*#P +MHW0D\)`!FW1)\)`!FG3@\)`!F>3PD`&8!/`BTQ"O`"4,I"!$."4`$"YD`'&X##CLB(2'Z3_ +M5'^0@.?P[\03$Q-4`:/PD``!$A^]_U3PQ%0/_I"`YN!4\$[PD``#$A^]5`$E +MX/Z0@.3@5/U.\.]4#\14\/^0@.;@5`]/\)``!!(?O9"`Z?`23X.0`;ET`?"0 +M`;CPD(#GX)`!NO"0@.G@D`&[\)"`YN!4#Y`!OO`BY)"`Y_"C\)"`YN!4#_!4 +M\/"0@.3@5/WP5/?P5._PD(#M=`'PH_"0@.3@5/OPH^!4^_#DD(#P\)"`[W0' +M\)"`\N3PHW0"\.20@.OPD(#DX%3^\)"`Z70,\)"`Y.!4W_"0@.IT#/"0@.3@ +M5+_P5'_PH^!4_O!4_?!4]_"0@/02(-H`````D(`!X+0!")"`\729\(`2D(`! +MX)"`\;0#!720\(`#=$#PD(#X=`'PHW0'\*/@5`%$*/"C=`7PY*/PH_"C\*/P +M(M,0KP'#P-"0`H%Y +M;1(K[9"!E^!U\`20`=$21/'@D(%N\)"!E^!U\`20`=(21/'@D(%O\)"!E^!U +M\`20`=,21/'@D(%P\)"!E^!U\`20`?`21/'@D(%Q\)"!E^!U\`20`?$21/'@ +MD(%R\)"!E^!U\`20`?(21/'@D(%S\)"!E^!U\`20`?,21/'@D(%T\)"!:^#_ +MD(&7X/YT`:@&"(`"PS/8_/1?D(%K\)"!E^#_=`&H!PB``L,SV/R0`6Y1!I"!E^`$\.!4`_#!&)`!P.!$`O#0T)*O(N3[^OU_`1)$3I"! +M:N_P8/#1!X#LY)"!$O"0@1+@9`'P)$J0`<3P=%>C\)"`ZN#_D(#IX&]@`Q)' +MIA)B^[\!`O&%$C*>OP$#$EY&$D)-@,K3$*\!P\#0D(#DX##@`O&:T-"2KR*0 +M@.K@<`X2:52_`0CQKY`!Y>`$\"+3$*\!P\#0$F<$\<#0T)*O(A)F_)``".!4 +M[_U_"!(R'N3_CU#DD($3\*/PD`$)X'\`,.<"?P'O95!@/L.0@13@E(B0@1/@ +ME!-`")`!P.!$$/`BD($3Y'7P`1)$J7\4?@`2,JK3D($4X)0RD($3X)0`0+F0 +M`<;@,."R(N3[^OU_`1)$3I"!?>_P8/`1/8#LTQ"O`X/Z0@)W@ +M_;4&!'X!@`)^`.YD`6`RD`&OX'`3[77P#Z0D!_ET@#7P^GL!$95_`>]@%I"` +MG>`$\.!_`+0*`G\![V`%Y)"`G?#0T)*O(M,0KP'#P-"0@7X210:0@9C@_P3P +MD``![Q(?_'^O?@$1^.]@.I"!?A)$_8L3BA2)%9``#A(?O20"]19[`7H!>:`2 +M*^V0@7X21/V0``X2'[V0`:[PHW3_\)`!R^!D@/#0T)*O(M,0KP'#P-"0@8ON +M\*/O\.2C\*/PD(&+X/ZCX/6"CH/@8"W#D(&.X)3HD(&-X)0#0`N0`<#@1(#P +M?P"`%9"!C>1U\`$21*E_"GX`$C*J@,5_`=#0DJ\BD(%%[_"C[?"C$B#:```` +M`.20@5/P?R1^"!(M7)"!2Q(@SI"!1>#[<`B0@4L21-F`%NMU\`BD)&+U@N0T +MA_6#X/ZCX/\2+5R0@4\2(,Z0@4;@_^3\_?YX%Q(@NZ@$J06J!JL'D(%/$D39 +M[51__>Q4@/P21,SL1(#\D(%/$B#.D(%+$D39[%1__)"%NQ(@SG\D?@@2+J*0 +M@47@=?`(I"1B]8+D-(?U@^#^H^#_P`;`!Y"!3Q)$V9"%NQ(@SM`'T`82+J*0 +M@4L21-GL1(#\D(6[$B#.?R1^"!(NHI"!1>!P!'\@@`F0@47@M`$6?RA^"!(M +M7'@($B"H[U0!_^20@5/O\)"!4^"0@45@#N!U\`BD)&;U@N0TAX`,X'7P"*0D +M9/6"Y#2']8/@_J/@_Q(M7.U4#_WD_)"!1Q(@SI"!1P)$V=,0KP'#P-`Q3M#0 +MDJ\BD($E$D4&$A^DD($I\)```1(?O9"!*/"0``(2'[V0@3OPD``#$A^]D($\ +M\)"!)1)$_>DD!/GD.HL3]12)%746!'L!>H%Y/1(K[9"!)1)$_>DD"/GD.HL3 +M]12)%746!'L!>H%Y01(K[9"!*>`D^&!Y)/Q@=20(8`*!W)"!*."T`042*<6! +MWY"!*."T`@42$;V!WY"!*."T`P42!NN!WY"!*."T$!F0@3S@_I"!.^#][?^0 +M@2KN\*/O\!(RJH'?D($HX+01&9"!/.#^D($[X/WM_Y"!*N[PH^_P$C(&@=^0 +M@2C@]&`"@=__(I"!*>"T#`B0@3IT`?"`!>20@3KPD($HX&0'8`*!KY"!.^"0 +M@3CPD($\X)"!.?"0@3[@_^3\_?YX"!(@NZ@$J06J!JL'D($]X/_D_/W^$D3, +MP`3`!<`&P`>0@3_@_^3\_?YX$!(@N]`#T`+0`=``$D3,D($L$B#.D($YX/^0 +M@3C@_5&-D($P$B#.D($ZX'`"@9>0@4+@_^3\_?YX"!(@NZ@$J06J!JL'D(%! +MX/_D_/W^$D3,P`3`!<`&P`>0@4/@_^3\_?YX$!(@N]`#T`+0`=``$D3,D($T +M$B#.D($T$D39$B";D($P$D3E$D2_P`3`!<`&P`>0@2P21-F0@3021.421+_0 +M`]`"T`'0`!)$S)"!+!(@SI"!+!)$V9"!1Q(@SI"!..#]H^#_D>*`,)"!.^#_ +MH^#]D($ZX)"!2/![`7J!>3VC$D4&>H%Y09"!3!)%!I"!*.#[\9.``W\"(G\! +M(M,0KP'#P-#`!\`%D(%'$D39D(%-$B#.T`70![$$T-"2KR*0@4OO\*L%D(%1 +M$B#:`````*\#Y/S]_G@4$B"[J`2I!:H&JP>0@4T21-GM5`_]Y/P21,SL5`_\ +MD(%1$B#.D(%+X'7P"*0D8/6"Y#2']8/@_J/@_\`&P`>0@5$21-F0A;L2(,[0 +M!]`&`BZBD`()X)"!$_"C="#PD($3X/\PX`6CX"2`\._#$Y#]$/#DD($D\)"! +M%.`D`/6"Y#3\]8/@D($6\)"!).!D`?`D;I`!Q/!T7:/PD($6X/]D!&`*[V0( +M8`7O9`QP>N20@17PD($6X/^0@17@_L.?4#_@_Y"!%.#]+R0`]8+D-/SU@^#\ +M=!1=1FY"!(^_PPY0"4!:0@2/@8`V0@17@_Y"!%.`O\*&3?P$B?P`B$BVG +MY/52$C*>[V!R8U(!Y5(D1I`!Q/!T7J/PD`"(X/50]5%4#V#?Y5`PX`L@Y`,2 +M*<534>Z`/N50,.$6(.4.$A&][W`#0U$@D`$&Y/!34?V`(^50,.(+(.8#$@;K +M4U'[@!/E4##C#B#G"+%N[W`#0U&`4U'WK5%_B!(R'H"((I"!@>_PH^WPK0.L +M`N20@8GPH_"0`<1TQ?!T7J/P[%0__)`!0.WPK@3NH_"0@8'@)(%@-"3:8!PD +M/'!!D(&"X,0S,S-4@)"!AO"C=&GPHW2`\(`LD(&"X%0!D(&&\*-TI?"C=`'P +M@!B0@8+@Q%00D(&&\*-T?_"C=!#P@`-_`"*0@8?@D`$&\)"!AN!@#I`!0O"0 +M@87@D`%#\(`-D`%#Y/"0@8;@D`%"\)"!B.#_D`%"X%__D(&&X&]@[G3%!)`! +MQ/!T7J/PD`%#Y/!_`2(BD(%%[_"C[?"CZ_"0@4D21/V+$XH4B15U%@1[`7J! +M>6(2*^V0@4P21/V+$XH4B15U%@1[`7J!>682*^V0@4;@_I"!1>#][?^0@4_N +M\*/O\)"!1^#_M`0(D(%2=`'P@`_OD(%2M`4%=`+P@`-T!/#3D(%0X)3_D(%/ +MX)0`0`(!DN20@5'PD(%2X/^0@5'@_L.?0`)!]'1B+O6"Y#2!]8/@D(%3\.[_ +MD(%0X"__D(%/X#0`CX+U@^"0@53PD(%(X&`ED(%1X"1F]8+D-('U@^"0@5WP +MX/_T_I"!5.!>_I"!4^#][UU.\)"!3Z/@_Z/@+_^0@5/@_1(R'I"!4>`$\("% +MTY"!4."4_Y"!3^"4!U!XY)"!4?"0@5+@_Y"!4>#^PY]``D'T=&(N]8+D-('U +M@^"0@5/P[O^0@5#@+_N0@4_@-`#ZBX+U@^"0@53PD(%(X&`ED(%1X"1F]8+D +M-('U@^"0@5WPX/_T_I"!5.!>_I"!4^#][UU.\)"!4^"+@HJ#\)"!4>`$\("- +MY)"!4_"0@5X2(-H`````D(%5$B#:`````)"!2.!@$9"!3^#^H^#_$BU#^PY]``D$?=&(N]8+D-('U@^"0@5/PD(%(X&!W +MD(%1X/LD9O6"Y#2!]8/@D(%=\)"!61)$V>MU\`BD^?@2(*B0@5W@_O1?_Y"! +M4^#][EU/\)"!7A)$Y<``P`'``L`#D(%=X/]^`)"!4>!U\`BD_>^H!0B`!<,S +MSC/.V/G_[C.5X/W\T`/0`M`!T``21,R0@5X2(,Z0@5421.7``,`!D(%3X/_D +M_/W^D(%1X'7P"*3Y^!(@N]`!T``21,R0@542(,Z0@5'@!/`A3I"!2.!@.I"! +M7A)$V1(@FY"!61)$Y1)$O\`$P`7`!L`'D(%5$D39D(%>$D3E$D2_T`/0`M`! +MT``21,R0@542(,Z0@5421-F0A;L2(,Z0@4_@_J/@_Q(NHI"!1^"0`:#PD(%2 +MX)`!H?"0@4C@D`&B\)"!21)$_1(?I)`!I/"0``$2'[V0`:7PD``"$A^]D`&F +M\)```Q(?O9`!I_"0@5421-F0`:CO\)"!51)$V7@($B"HD`&I[_"0@5421-EX +M$!(@J)`!JN_PD(%5$D39>!@2(*B0`:OO\"*/#2*/#B)_`I"!`.#^[\.>4!CO +M)>`D@?CF,.0+D`&X=`CPH_!_`"(/@-Y_`2*0`33@53WU0:/@53[U0J/@53_U +M0Z/@54#U1)`!-.5!\*/E0O"CY4/PH^5$\"*0`3S@547U2:/@54;U2J/@54?U +M2Z/@54CU3)`!/.5)\*/E2O"CY4OPH^5,\%.1WR*0@*/@9`%P&9"`Y^!@$Y`! +M5^3PD`$\=`(23NN0`5=T!?`BD(#GX&`UD`:2X##@).3U'9"`^N##$U1_]1[D +M^_U_6'X!$D[\D`%;=`7PD`:2=`'P(I"`Y.!4]_`21Z8BD(#GX&`UD`:2X##A +M).3U'9"`^N##$U1_]1[D^_U_7'X!$D[\D`%?=`7PD`:2=`+P(I"`Y.!4[_`2 +M1Z8BD7&0@0SO\)"`Y##@!N!$`?"`!.!4_O"0@0S@,.81D`$OX##G!.3P@`:0 +M`2]T@/"0@.3@,.`:D(#RY/"C=`?PD(#RH^"0!5CPD`3LX%3=\"*0!.S@1"+P +M(N20@0WPH_"C\)``@^"0@0WPD`"#X/Z0@0W@_[4&`2+#D($/X)1DD($.X)0` +M0`V0`<#@1$#PD($-X/\BD($.Y'7P`1)$J8#"D($)X&`/Y/"0!5/@1`'PD`7] +MX`3P(I"`Y.#_Q!,35`,PX"?O5+_PD`3@X)"`Y3#@!N!$`?"`$.!4_O"0`;ET +M`?"0`;AT!/`21Z;D_Y"!!.`PX$B0@0C@_6!!=`%^`*@'"(`%PS/.,\[8^?^0 +M!.#@^^];8`;DD($(\"*0@0;@TYU0$)`!QW00\+%4D($$X%3^\"(22.20@0C@ +M!/`BD(`!X&0"8`>0!I#@1`'P(I"`Y.#_Q!,3$U0!,.`L[U1_\)`$X."0@.4P +MX0;@1`+P@`_@5/WPD`&Y=`'PD`&X!/"0@.?@8`,21Z9_`:$$TQ"O`!@&I`%(N!4D&`'D`'`X$0(\)`!QN`PX>1_`(`"?P'0T)*O(L/NE`%`"@WM +M$Y#]$/#D+_\BP^Z4`4`DD/T1X&UP&I`!%^"U!0V0`>1T=_"0_1'D\(`&[020 +M_1'PY"__(M,0KP'#P-"0`0'@1`+PD`$`=/_PD`:W=`GPD`:T=(;P?WQ^"!(M +M7.Q4?_R0@8\2(,Z0@8\21-F0A;L2(,Y_?'X($BZBD(6[$B#:S,``P'^,?@@2 +M+J*0A;L2(-H`P``4?W!^#A(NHI"%EA(@V@`#/F#D_?\2,4W0T)*O(M$,D(#J +M=`SP(A)/\9"%NQ(@VLSP`,!_C'X($BZBD(6[$B#:````%']P?@X2+J*0A982 +M(-H`````Y/W_$C%-?WQ^"!(M7.Q$@/R0@9,2(,Z0@9,21-F0A;L2(,Y_?'X( +M$BZBD`$`=#_PH^!4_?"0!5/@1"#P(I``D.`@X/DBD(#QX/U_DQ(R'I"`Z.!@ +M$I`!+^`PYP5T$/"`!I`!+W20\)``".!$$/U_"!(R'G\!$E?1D`"0X$0!_7^0 +M$C(>?Q1^``(RJN\4D`5S\)`!/W00\/U_`W1%+_CF3?[V=#@O]8+D-`'U@^[P +M(G1%+_CF_NWT7O[V=#@O]8+D-`'U@^[P(M,0KP'#P-"0@:#M\)"!G^_PTY0' +M4'#@_W0!J`<(@`+#,]C\]/^0`$?@7_U_1Q(R'I"!G^#_=`&H!PB``L,SV/S_ +MD`!&X$_]?T82,AZ0@:#@8!B0@9_@_W0!J`<(@`+#,]C\_Y``1>!/@!>0@9_@ +M_W0!J`<(@`+#,]C\]/^0`$7@7_U_18!^D(&?X"3X\.`D!/]T`:@'"(`"PS/8 +M_/3_D`!#X%_]?T,2,AZ0@9_@_W0!J`<(@`+#,]C\_Y``0^!/_7]#$C(>D(&@ +MX&`=D(&?X"0$_W0!J`<(@`+#,]C\_Y``0N!/_7]"@!R0@9_@)`3_=`&H!PB` +M`L,SV/ST_Y``0N!?_7]"$C(>T-"2KR*0@.3@5/OPY)"`\/"0@.OP(N\D_F`, +M!'`HD(#M=`'PH_`B[7`*D(#[X)"`[?"`!9"`[>WPD(#MX*/PD(#EX$0(\"(2 +M3VKO9`%@")`!N'0!\(!GD(#KX/]4`V`(D`&X=`+P@%:0@.G@_N3#GE`(D`&X +M=`3P@$3O,.((D`&X=`CP@#B0@.O@,.0(D`&X=!#P@"F0@.7@$Q-4/R#@")`! +MN'0@\(`6D(#_X&`(D`&X=(#P@`B0`;CD\'\!(I`!N70$\'\`(I`"A^!@")`! +MN'0!\(`7D`*&X"#A")`!N'0$\(`(D`&XY/!_`2*0`;ET"/!_`"+O8#Z0@*/@ +M9`%P-I"`Y>!4_O"0!2)T#_"0!@3@5+_PY/\22.:_`0Z0@.3@1$#PD(#J=`;P +M(I`!N70!\)`!N'0(\"*0!2)T;_"0!2?@5+_PD(#J=`+P(N20@0OPD`:IX)"! +M"_#@5,!P#9"`Z^!4_O!4_?`"1Z:0@0O@,.8BD(#GX&0!<"&0@.O@1`'PD(#F +MX%0/9`)@!%%*@`P23CV`!Y"`Z^!4_O"0@0O@D(#K,.<4X$0"$D[KD`%7=`7P +MD(#DX$0$\"+@5/WP(I`$'>!P%)"``^#_Y/T22?F.3H]/D`0?="#P(I"`H^!D +M`6`"0?J0@.?@<`)!^I"`YN#$5`]D`7`BD`:KX)"`[O"0!JK@D(#M\*/@_W`( +MD(#MX/[_@`"0@.[O\)"`Y>!$!/#DD(#P\)"`\J/@D`58\)`!5^3PD`$\=`+P +MD(#KX%3]\%3O\)"`YN#_Q%0/)/U0`H`",=B0@.7@$Q,35!\PX!"0@.W@_Z/@ +MM0<&$F=*$DV?(I"`Y.#_$Q-4/S#@$>]4^_"0@.O@5/WP5`=P0H`]D(#PX`3P +MD(#KX%3O\)"`\.#_M`$"@`3OM`(&D`58X`3PD(#XX/^0@/#@TY]`#Y"`H^"T +M`0N0@.7@5/OP(A)'IB+D_N_#$_WO,.`$[B2`_I#]$.WPKP8BJP>J!NTK^^0Z +M^L.0@*#@FY"`G^":4!.CX"0!_Y"`G^`T`/[#ZY_[ZI[ZZI#]$?"O`W0`+_6" ++Y#3[]8/@_R(`,@@` +` +end +begin 644 rtwn-rtl8188eefw.fw +MX8@0``@````0)2%6L"L``*($```````````````````"134````````````` +M````````P58````````````````````````````````````````````````` +M````````````H01X@!;F"'`+PJ_F,.$#1!CVTJ\(V>WJB]`BY0S_(R2!^`\( +M"+\$!'\`>('F,.3R`.4,PY]0(`4,=(@E#/CF_::!".:N#+X#`G3_S?CH;6#@ +M".;`X(#VY0S3GT`GY0PDB?CFK@R^`P)T__T8YLWXY8%M8`;0X/88@/7E#"2( +MR/85#(#3Y0PC)('X?P3"K^8PX`,0X@Q_`##A!S#C!'\(5/14?,;2KU2`0@(BF@70#8`;_"';_W_M_!.1X@/8(]@C?^GB!=C"01<5T`9/`X.23P.!#B0%U +MBF!UC'G2C-*O(@/OTY0#0`-__R)T@2\O^.8@Y?3"K^9$,/;2KZX,[L.?4"$. +M=(@N^.;Y".88O@,"=/_][6E@"0GG&1GW"0F`\Q86@-KNTY]`!`6!!8'NTY]` +M(G2(+O@(YOGNM0P"J8$8!@;F_>UI8`D9&><)"?<9@/,>@-GO)(CXY@3X[R\$ +MD$7%D_8([R^3]G\`(N_3E`-``W__(N\C)('XYC#E],*OYE2,]M*OY0RU!PIT +MB"_XYO6!`D)-4"YTB2_XYK\#`G3__1CF^72(+_C[YOSI;&`(J`7G]AT9@/2H +M`Z8%'^4,M0?C?P`B=(DO^.;]&(8!#W2(+_BF`0B&!.4,M0<"K('M;&`(#0FH +M!>;W@/3E#+4'WHF!?P`B[].4`T`#?_\B[R,D@?C"K^8PY04PX`+2Y-+BQM*O +M?P`PX@$/`D),C_#D__[E#",D@/C"J3#W#7\(YF`++?9@,%`N@`!@J$"XY).C^N23H_CDDZ/(Q8+(RL6#RO"CR,6" +MR,K%@\K?Z=[G@+X`08&7`$&!F`!!@:0`43172EK3I_51(R'JT[?U82,AZM/']7$C(>4Y'O(L#@P/#`@\""P-!U +MT`#``,`!P`+``\`$P`7`!L`'D`'$=%;P=$:C\!)C(N5!,.0$?P*1)^5#,.`" +MT?3E0S#A`Q)-N^5#,.(#$DX*Y4,PXP,28W_E0S#D`O&PY4,PY0+QWN5#,.8" +M\8OE1##A`M'J=%8$D`'$\'1&H_#0!]`&T`70!-`#T`+0`=``T-#0@M"#T/#0 +MX#*0@.?@8`,23H0BD($*X&`/Y/"0!5/@1`+PD`7\X`3PY/^0@.?@8'F0@*/@ +M9`%P<9"`YN#$5`]@)"3^8`,$3U'9"`\."`#>3U'9"`\.!U\`.D +M)/[_D(#OX"\23O.0`5=T!?"0@.K@(.(#$DK`(I"`H^"T`1.0@.?@8`V0@.O@ +M5/[P5`=P`O&F(I"`Z>#_?0$"2L20@*/@9`%P)9"`Y^!@'Y`!5^3PD`$\=`+P +MD(#DX%3[\)"`Z^!4_?!4!W`"\:8BD("CX+0!%I"`Y^!@$)"`YN!4#V0"8`," +M:DH23CTBP.#`\,"#P(+`T'70`,``P`'``L`#P`3`!<`&P`>0`<1T_/!T1Z/P +M$F-/Y4DPX0(1E.5),.(#$F.AY4DPXP,28]WE2C#@`Q)D&>5*,.0#$F2XY4PP +MX05_`Q)$)^5,,.0"$9[E3##E`Q)DSN5,,.8#$F5D=/P$D`'$\'1'H_#0!]`& +MT`70!-`#T`+0`=``T-#0@M"#T/#0X#*0@.?@8`,2:OLBL2J0@.W@%)`%<_!] +M`G\"46.0@0'@,.`MD("CX+0!)I"!I.`$\."T"@N0@0/@!/#DD(&D\)"!`^#_ +MD($"X+4'!>2C\!'D(N3_CU.0!!W@8!B0!2+@]59T__#Q\;\!`C%0@9O@D`0E\)"!G.!@#G0/+_6"Y#3\]8/@1(#PKP5T""_U@N0T_/6#Y/!T +M"2_U@N0T_/6#X%3P\'0A+?6"Y#3\]8/@5/?PK@2O!=#0DJ\B=#TO^.9-_O9T +M,"_U@N0T`?6#[O`BD`$V='CPHW0"\'UX_U%C?0)_`U%CD`8*X$0'\)"`\J/@ +MD`58\)"`H^"T`120@.7@5/OPD(#JX"#B#7T!?P2`#)"`Y>!$!/`B?0%_!-,0 +MKP'#P-"0@:'M\)"`ZN"0@:+PD(#DX/[$$Q-4`S#@`H$6[L03$Q-4`3#@`H$6 +MD(&BX/YO<`*!%N]P`F&-)/YP`F'&)/Y@223\<`*!`23\8`*!%NZT#@*1EI"! +MHN!P!'\!D;Z0@:+@M`8"D7"0@:+@M`0.D(&AX/]@!1)I@H`"\5>0@:+@9`A@ +M`H$6$F:'@1:0@:+@<`1_`9&^D(&BX+0&`I%PD(&BX+0.!Y$;OP$"D9:0@:+@ +M9`Q@`H$6D1OO9`%@`H$6D=B!%I"!HN"T#@>1&[\!`I&6D(&BX+0&`I%PD(&B +MX+0,!Y$;OP$"D=B0@:+@9`1P7!)HU.]D`7!4L0Z`4)"!HN"T#@>1&[\!`I&6 +MD(&BX+0&`I%PD(&BX+0,!Y$;OP$"D=B0@:+@<`1_`9&^D(&BX+0$&A)IQ(`5 +MD(&BX+0,#I"`Y>#_$Q-4/S#@`O'GT-"2KR+Q:N]D`6`(D`&X=`'P@#V0@.3@ +M_Q,3$U0?,.`(D`&X=`+P@"COQ%0/,.`(D`&X=`3P@!F0@.G@TY0$0`B0`;AT +M"/"`")`!N.3P?P$BD`&Y=`+P?P`BD(#EX)`&!"#@#.!$0/"0@.IT!/"`"N!4 +M?_"0@.IT#/"0!2+D\"*0@.7@PQ,@X`B0@.IT#/"`$9`&!.!$0/#@1(#PD(#J +M=`3PD`4BY/`BD(&C[_`29@R0@:/@8`60!2+D\)"`ZG0$\"*0@*/@9`%P+9"` +MY>!4_?"0!2)T;_!_`1'FOP$.D(#DX$2`\)"`ZG0.\"*0`;ET`?"0`;@$\"*0 +M!2)T__#Q\9`!-W0"\/U_`U%C$F:0Y)"`ZO`BD(#GX&`MD("CX&0!<"60@.[P +M!&`>D(#KX$00\.3U'9"`[]'RD`%7=`7PD(#JX"#B`E'`(N]P-GUX?P*QHWT" +M?P.QHWW(?P(29VZ0`5?D\)`!/'0"\'T!?PQ1Q)"`Y.!4]_!4[_"0!@K@5/CP +M(D%X?0)_`K&C?0%_`G0]+_CF_NWT7O[V=#`O]8+D-`'U@^[P(I"`Y^!@19"` +MY>#_$Q,35!\PX!*0`3O@,.0+L9F0@.W@%)`%<_"0@9GD=?`!$D2IPY"!FN"4 +M@)"!F>!D@)2`0`N0`9C@5/[PX$0!\/&S`:^0@.K@9`)@*A)J99"`Y>`3$Q-4 +M'S#@%9"`[>#_H^!O<`L29TJQF9"`[N`4\)`!YN`$\"*0`5_D\)`!/'0(\.3U +M'9"`^N##$U1_]1[D^_U_7'X!T?R0`5]T!?"0!I)T`O"0@.3@1!#PD(#JX&0, +M8`KD_7\,4<3D_Q'F(I"`Y^!D`7!>D(#FX%0/8$Z0@.K@<`/_D;Z0@.K@9`Q@ +M`O%7D`%;Y/"0`3QT!/#Q:N]D`7`Q]1V0@/K@PQ-4?_4>Y/O]?UA^`='\D`%; +M=`7PD`:2=`'PD(#DX$0(\"*0@.K@<`)1P"+PY/4=D(#YX/4>Y/O]?U1^`8X9 +MCQKE'E0'Q#-4X(49@X4:@O#E'50'Q#-4X/_E'A,3$U0?3Z/PZU0'Q#-4X/_E +M'1,3$U0?3X4:@H49@Z.C\+T!#(4:@HZ#HZ.C=`/P(H4:@H49@Z.CHW0!\"*0 +M!@3@5'_PD`4BY/"0@.IT#/`BD`0:X/1@`W\`(I`$&^!4!V0'?P%@`G\`(I"! +M>!)%!A)HDI"`Y^#_L5Z0@.?@8!F0@7@21/V0``$2'[U4#_^0``(2'[W]$FBC +M(I"!!.`PX"R0@0?@!/#@_Y"!!>"U!QV0!I+@5!QP"A'DD($(X`3P@`:0!I)T +M'/#DD($'\"(29I"0@.IT"/`BY)"!G?"C\)`%^.!P#Z/@<`NCX'`'H^!P`W\! +M(M.0@9[@E.B0@9W@E`-`"I`!P.!$(/!_`")_,GX`$C*JD(&=Y'7P`1)$J8"_ +MD`#WX"#G">!_`2#F#'\"(I``]^`PY@)_`R(1.9"``>_P$660`61T`?`"+:<1 +MTS$#$9(1L>3U-?4V]3?U.*TU?U`2,AZM-G]1$C(>K3=_4A(R'JTX?U,",AYU +M/1#D]3YU/P=U0`*0`3#E/?"CY3[PH^4_\*/E0/`B=44.=48!0T80=4<#=4AB +MD`$XY47PH^5&\*/E1_"CY4CP(I`!,.3PH_"C\*/PD`$X\*/PH_"C\/U_4!(R +M'N3]?U$2,A[D_7]2$C(>Y/U_4P(R'I`!-'3_\*/PH_"C\)`!//"C\*/PH_#] +M?U02,AY]_W]5$C(>??]_5A(R'GW_?U<",AZ0`(#@1(#]?X`2,AZ0_0#@5+_P +M,<`2,G=Q>S&G?P$20Q60@0!T`O#_$D,5D($`X`3P?P,20Q60@0#@!/`14S&, +MD`"`X$1`_7^`$C(>=2#_,;&1<>3_`D.>,:LQN+%#,!)$_9```A(?O9"! +M?/"`!9"!?._PD(%[[O"0@7S@_I"!>^#_TYY0.)"!>!)$_1(?I%0!_G2C+_6" +MY#2`]8/N\'2C+_6"Y#2`]8/@<`1Q,(`'D(%[X/]Q+Y"!>^`$\("ZD("CX'`E +MD(#JX'`$_Q),OI"`ZN!D#&`#$D]7D(#DX%3W\%3O\%2_\%1_\"(B(A(?I)"` +M\?`B$A^DD(#_\)"`_^"0`>?P(A(?I)"!"?"0``$2'[V0@0KP(A(?I/]4`?Z0 +M@0'@5/Y.\._#$S#@"I```1(?O9"!`O`BD`$!X$0$\)`!G'1^\*-TDO"C=*#P +MHW0D\)`!FW1)\)`!FG3@\)`!F>3PD`&8!/`BTQ"O`"4,I"!$."4`$"YD`'&X##CLB(2'Z3_ +M5'^0@.?P[\03$Q-4`:/PD``!$A^]_U3PQ%0/_I"`YN!4\$[PD``#$A^]5`$E +MX/Z0@.3@5/U.\.]4#\14\/^0@.;@5`]/\)``!!(?O9"`Z?`23X.0`;ET`?"0 +M`;CPD(#GX)`!NO"0@.G@D`&[\)"`YN!4#Y`!OO`BY)"`Y_"C\)"`YN!4#_!4 +M\/"0@.3@5/WP5/?P5._PD(#M=`'PH_"0@.3@5/OPH^!4^_#DD(#P\)"`[W0' +M\)"`\N3PHW0"\.20@.OPD(#DX%3^\)"`Z70,\)"`Y.!4W_"0@.IT#/"0@.3@ +M5+_P5'_PH^!4_O!4_?!4]_"0@/02(-H`````D(`!X+0!")"`\729\(`2D(`! +MX)"`\;0#!720\(`#=$#PD(#X=`'PHW0'\*/@5`%$*/"C=`7PY*/PH_"C\*/P +M(M,0KP'#P-"0`H%Y +M;1(K[9"!E^!U\`20`=$21/'@D(%N\)"!E^!U\`20`=(21/'@D(%O\)"!E^!U +M\`20`=,21/'@D(%P\)"!E^!U\`20`?`21/'@D(%Q\)"!E^!U\`20`?$21/'@ +MD(%R\)"!E^!U\`20`?(21/'@D(%S\)"!E^!U\`20`?,21/'@D(%T\)"!:^#_ +MD(&7X/YT`:@&"(`"PS/8_/1?D(%K\)"!E^#_=`&H!PB``L,SV/R0`6Y1!I"!E^`$\.!4`_#!&)`!P.!$`O#0T)*O(N3[^OU_`1)$3I"! +M:N_P8/#1!X#LY)"!$O"0@1+@9`'P)$J0`<3P=%>C\)"`ZN#_D(#IX&]@`Q)' +MIA)B^[\!`O&%$C*>OP$#$EY&$D)-@,K3$*\!P\#0D(#DX##@`O&:T-"2KR*0 +M@.K@<`X2:52_`0CQKY`!Y>`$\"+3$*\!P\#0$F<$\<#0T)*O(A)F_)``".!4 +M[_U_"!(R'N3_CU#DD($3\*/PD`$)X'\`,.<"?P'O95!@/L.0@13@E(B0@1/@ +ME!-`")`!P.!$$/`BD($3Y'7P`1)$J7\4?@`2,JK3D($4X)0RD($3X)0`0+F0 +M`<;@,."R(N3[^OU_`1)$3I"!?>_P8/`1/8#LTQ"O`X/Z0@)W@ +M_;4&!'X!@`)^`.YD`6`RD`&OX'`3[77P#Z0D!_ET@#7P^GL!$95_`>]@%I"` +MG>`$\.!_`+0*`G\![V`%Y)"`G?#0T)*O(M,0KP'#P-"0@7X210:0@9C@_P3P +MD``![Q(?_'^O?@$1^.]@.I"!?A)$_8L3BA2)%9``#A(?O20"]19[`7H!>:`2 +M*^V0@7X21/V0``X2'[V0`:[PHW3_\)`!R^!D@/#0T)*O(M,0KP'#P-"0@8ON +M\*/O\.2C\*/PD(&+X/ZCX/6"CH/@8"W#D(&.X)3HD(&-X)0#0`N0`<#@1(#P +M?P"`%9"!C>1U\`$21*E_"GX`$C*J@,5_`=#0DJ\BD(%%[_"C[?"C$B#:```` +M`.20@5/P?R1^"!(M7)"!2Q(@SI"!1>#[<`B0@4L21-F`%NMU\`BD)&+U@N0T +MA_6#X/ZCX/\2+5R0@4\2(,Z0@4;@_^3\_?YX%Q(@NZ@$J06J!JL'D(%/$D39 +M[51__>Q4@/P21,SL1(#\D(%/$B#.D(%+$D39[%1__)"%NQ(@SG\D?@@2+J*0 +M@47@=?`(I"1B]8+D-(?U@^#^H^#_P`;`!Y"!3Q)$V9"%NQ(@SM`'T`82+J*0 +M@4L21-GL1(#\D(6[$B#.?R1^"!(NHI"!1>!P!'\@@`F0@47@M`$6?RA^"!(M +M7'@($B"H[U0!_^20@5/O\)"!4^"0@45@#N!U\`BD)&;U@N0TAX`,X'7P"*0D +M9/6"Y#2']8/@_J/@_Q(M7.U4#_WD_)"!1Q(@SI"!1P)$V=,0KP'#P-`Q3M#0 +MDJ\BD($E$D4&$A^DD($I\)```1(?O9"!*/"0``(2'[V0@3OPD``#$A^]D($\ +M\)"!)1)$_>DD!/GD.HL3]12)%746!'L!>H%Y/1(K[9"!)1)$_>DD"/GD.HL3 +M]12)%746!'L!>H%Y01(K[9"!*>`D^&!Y)/Q@=20(8`*!W)"!*."T`042*<6! +MWY"!*."T`@42$;V!WY"!*."T`P42!NN!WY"!*."T$!F0@3S@_I"!.^#][?^0 +M@2KN\*/O\!(RJH'?D($HX+01&9"!/.#^D($[X/WM_Y"!*N[PH^_P$C(&@=^0 +M@2C@]&`"@=__(I"!*>"T#`B0@3IT`?"`!>20@3KPD($HX&0'8`*!KY"!.^"0 +M@3CPD($\X)"!.?"0@3[@_^3\_?YX"!(@NZ@$J06J!JL'D($]X/_D_/W^$D3, +MP`3`!<`&P`>0@3_@_^3\_?YX$!(@N]`#T`+0`=``$D3,D($L$B#.D($YX/^0 +M@3C@_5&-D($P$B#.D($ZX'`"@9>0@4+@_^3\_?YX"!(@NZ@$J06J!JL'D(%! +MX/_D_/W^$D3,P`3`!<`&P`>0@4/@_^3\_?YX$!(@N]`#T`+0`=``$D3,D($T +M$B#.D($T$D39$B";D($P$D3E$D2_P`3`!<`&P`>0@2P21-F0@3021.421+_0 +M`]`"T`'0`!)$S)"!+!(@SI"!+!)$V9"!1Q(@SI"!..#]H^#_D>*`,)"!.^#_ +MH^#]D($ZX)"!2/![`7J!>3VC$D4&>H%Y09"!3!)%!I"!*.#[\9.``W\"(G\! +M(M,0KP'#P-#`!\`%D(%'$D39D(%-$B#.T`70![$$T-"2KR*0@4OO\*L%D(%1 +M$B#:`````*\#Y/S]_G@4$B"[J`2I!:H&JP>0@4T21-GM5`_]Y/P21,SL5`_\ +MD(%1$B#.D(%+X'7P"*0D8/6"Y#2']8/@_J/@_\`&P`>0@5$21-F0A;L2(,[0 +M!]`&`BZBD`()X)"!$_"C="#PD($3X/\PX`6CX"2`\._#$Y#]$/#DD($D\)"! +M%.`D`/6"Y#3\]8/@D($6\)"!).!D`?`D;I`!Q/!T7:/PD($6X/]D!&`*[V0( +M8`7O9`QP>N20@17PD($6X/^0@17@_L.?4#_@_Y"!%.#]+R0`]8+D-/SU@^#\ +M=!1=1FY"!(^_PPY0"4!:0@2/@8`V0@17@_Y"!%.`O\*&3?P$B?P`B$BVG +MY/52$C*>[V!R8U(!Y5(D1I`!Q/!T7J/PD`"(X/50]5%4#V#?Y5`PX`L@Y`,2 +M*<534>Z`/N50,.$6(.4.$A&][W`#0U$@D`$&Y/!34?V`(^50,.(+(.8#$@;K +M4U'[@!/E4##C#B#G"+%N[W`#0U&`4U'WK5%_B!(R'H"((I"!@>_PH^WPK0.L +M`N20@8GPH_"0`<1TQ?!T7J/P[%0__)`!0.WPK@3NH_"0@8'@)(%@-"3:8!PD +M/'!!D(&"X,0S,S-4@)"!AO"C=&GPHW2`\(`LD(&"X%0!D(&&\*-TI?"C=`'P +M@!B0@8+@Q%00D(&&\*-T?_"C=!#P@`-_`"*0@8?@D`$&\)"!AN!@#I`!0O"0 +M@87@D`%#\(`-D`%#Y/"0@8;@D`%"\)"!B.#_D`%"X%__D(&&X&]@[G3%!)`! +MQ/!T7J/PD`%#Y/!_`2(BD(%%[_"C[?"CZ_"0@4D21/V+$XH4B15U%@1[`7J! +M>6(2*^V0@4P21/V+$XH4B15U%@1[`7J!>682*^V0@4;@_I"!1>#][?^0@4_N +M\*/O\)"!1^#_M`0(D(%2=`'P@`_OD(%2M`4%=`+P@`-T!/#3D(%0X)3_D(%/ +MX)0`0`(!DN20@5'PD(%2X/^0@5'@_L.?0`)!]'1B+O6"Y#2!]8/@D(%3\.[_ +MD(%0X"__D(%/X#0`CX+U@^"0@53PD(%(X&`ED(%1X"1F]8+D-('U@^"0@5WP +MX/_T_I"!5.!>_I"!4^#][UU.\)"!3Z/@_Z/@+_^0@5/@_1(R'I"!4>`$\("% +MTY"!4."4_Y"!3^"4!U!XY)"!4?"0@5+@_Y"!4>#^PY]``D'T=&(N]8+D-('U +M@^"0@5/P[O^0@5#@+_N0@4_@-`#ZBX+U@^"0@53PD(%(X&`ED(%1X"1F]8+D +M-('U@^"0@5WPX/_T_I"!5.!>_I"!4^#][UU.\)"!4^"+@HJ#\)"!4>`$\("- +MY)"!4_"0@5X2(-H`````D(%5$B#:`````)"!2.!@$9"!3^#^H^#_$BU#^PY]``D$?=&(N]8+D-('U@^"0@5/PD(%(X&!W +MD(%1X/LD9O6"Y#2!]8/@D(%=\)"!61)$V>MU\`BD^?@2(*B0@5W@_O1?_Y"! +M4^#][EU/\)"!7A)$Y<``P`'``L`#D(%=X/]^`)"!4>!U\`BD_>^H!0B`!<,S +MSC/.V/G_[C.5X/W\T`/0`M`!T``21,R0@5X2(,Z0@5421.7``,`!D(%3X/_D +M_/W^D(%1X'7P"*3Y^!(@N]`!T``21,R0@542(,Z0@5'@!/`A3I"!2.!@.I"! +M7A)$V1(@FY"!61)$Y1)$O\`$P`7`!L`'D(%5$D39D(%>$D3E$D2_T`/0`M`! +MT``21,R0@542(,Z0@5421-F0A;L2(,Z0@4_@_J/@_Q(NHI"!1^"0`:#PD(%2 +MX)`!H?"0@4C@D`&B\)"!21)$_1(?I)`!I/"0``$2'[V0`:7PD``"$A^]D`&F +M\)```Q(?O9`!I_"0@5421-F0`:CO\)"!51)$V7@($B"HD`&I[_"0@5421-EX +M$!(@J)`!JN_PD(%5$D39>!@2(*B0`:OO\"*/#2*/#B)_`I"!`.#^[\.>4!CO +M)>`D@?CF,.0+D`&X=`CPH_!_`"(/@-Y_`2*0`33@53WU0:/@53[U0J/@53_U +M0Z/@54#U1)`!-.5!\*/E0O"CY4/PH^5$\"*0`3S@547U2:/@54;U2J/@54?U +M2Z/@54CU3)`!/.5)\*/E2O"CY4OPH^5,\%.1WR*0@*/@9`%P&9"`Y^!@$Y`! +M5^3PD`$\=`(23NN0`5=T!?`BD(#GX&`UD`:2X##@).3U'9"`^N##$U1_]1[D +M^_U_6'X!$D[\D`%;=`7PD`:2=`'P(I"`Y.!4]_`21Z8BD(#GX&`UD`:2X##A +M).3U'9"`^N##$U1_]1[D^_U_7'X!$D[\D`%?=`7PD`:2=`+P(I"`Y.!4[_`2 +M1Z8BD7&0@0SO\)"`Y##@!N!$`?"`!.!4_O"0@0S@,.81D`$OX##G!.3P@`:0 +M`2]T@/"0@.3@,.`:D(#RY/"C=`?PD(#RH^"0!5CPD`3LX%3=\"*0!.S@1"+P +M(N20@0WPH_"C\)``@^"0@0WPD`"#X/Z0@0W@_[4&`2+#D($/X)1DD($.X)0` +M0`V0`<#@1$#PD($-X/\BD($.Y'7P`1)$J8#"D($)X&`/Y/"0!5/@1`'PD`7] +MX`3P(I"`Y.#_Q!,35`,PX"?O5+_PD`3@X)"`Y3#@!N!$`?"`$.!4_O"0`;ET +M`?"0`;AT!/`21Z;D_Y"!!.`PX$B0@0C@_6!!=`%^`*@'"(`%PS/.,\[8^?^0 +M!.#@^^];8`;DD($(\"*0@0;@TYU0$)`!QW00\+%4D($$X%3^\"(22.20@0C@ +M!/`BD(`!X&0"8`>0!I#@1`'P(I"`Y.#_Q!,3$U0!,.`L[U1_\)`$X."0@.4P +MX0;@1`+P@`_@5/WPD`&Y=`'PD`&X!/"0@.?@8`,21Z9_`:$$TQ"O`!@&I`%(N!4D&`'D`'`X$0(\)`!QN`PX>1_`(`"?P'0T)*O(L/NE`%`"@WM +M$Y#]$/#D+_\BP^Z4`4`DD/T1X&UP&I`!%^"U!0V0`>1T=_"0_1'D\(`&[020 +M_1'PY"__(M,0KP'#P-"0`0'@1`+PD`$`=/_PD`:W=`GPD`:T=(;P?WQ^"!(M +M7.Q4?_R0@8\2(,Z0@8\21-F0A;L2(,Y_?'X($BZBD(6[$B#:S,``P'^,?@@2 +M+J*0A;L2(-H`P``4?W!^#A(NHI"%EA(@V@`#/F#D_?\2,4W0T)*O(M$,D(#J +M=`SP(A)/\9"%NQ(@VLSP`,!_C'X($BZBD(6[$B#:````%']P?@X2+J*0A982 +M(-H`````Y/W_$C%-?WQ^"!(M7.Q$@/R0@9,2(,Z0@9,21-F0A;L2(,Y_?'X( +M$BZBD`$`=#_PH^!4_?"0!5/@1"#P(I``D.`@X/DBD(#QX/U_DQ(R'I"`Z.!@ +M$I`!+^`PYP5T$/"`!I`!+W20\)``".!$$/U_"!(R'G\!$E?1D`"0X$0!_7^0 +M$C(>?Q1^``(RJN\4D`5S\)`!/W00\/U_`W1%+_CF3?[V=#@O]8+D-`'U@^[P +M(G1%+_CF_NWT7O[V=#@O]8+D-`'U@^[P(M,0KP'#P-"0@:#M\)"!G^_PTY0' +M4'#@_W0!J`<(@`+#,]C\]/^0`$?@7_U_1Q(R'I"!G^#_=`&H!PB``L,SV/S_ +MD`!&X$_]?T82,AZ0@:#@8!B0@9_@_W0!J`<(@`+#,]C\_Y``1>!/@!>0@9_@ +M_W0!J`<(@`+#,]C\]/^0`$7@7_U_18!^D(&?X"3X\.`D!/]T`:@'"(`"PS/8 +M_/3_D`!#X%_]?T,2,AZ0@9_@_W0!J`<(@`+#,]C\_Y``0^!/_7]#$C(>D(&@ +MX&`=D(&?X"0$_W0!J`<(@`+#,]C\_Y``0N!/_7]"@!R0@9_@)`3_=`&H!PB` +M`L,SV/ST_Y``0N!?_7]"$C(>T-"2KR*0@.3@5/OPY)"`\/"0@.OP(N\D_F`, +M!'`HD(#M=`'PH_`B[7`*D(#[X)"`[?"`!9"`[>WPD(#MX*/PD(#EX$0(\"(2 +M3VKO9`%@")`!N'0!\(!GD(#KX/]4`V`(D`&X=`+P@%:0@.G@_N3#GE`(D`&X +M=`3P@$3O,.((D`&X=`CP@#B0@.O@,.0(D`&X=!#P@"F0@.7@$Q-4/R#@")`! +MN'0@\(`6D(#_X&`(D`&X=(#P@`B0`;CD\'\!(I`!N70$\'\`(I`"A^!@")`! +MN'0!\(`7D`*&X"#A")`!N'0$\(`(D`&XY/!_`2*0`;ET"/!_`"+O8#Z0@*/@ +M9`%P-I"`Y>!4_O"0!2)T#_"0!@3@5+_PY/\22.:_`0Z0@.3@1$#PD(#J=`;P +M(I`!N70!\)`!N'0(\"*0!2)T;_"0!2?@5+_PD(#J=`+P(N20@0OPD`:IX)"! +M"_#@5,!P#9"`Z^!4_O!4_?`"1Z:0@0O@,.8BD(#GX&0!<"&0@.O@1`'PD(#F +MX%0/9`)@!%%*@`P23CV`!Y"`Z^!4_O"0@0O@D(#K,.<4X$0"$D[KD`%7=`7P +MD(#DX$0$\"+@5/WP(I`$'>!P%)"``^#_Y/T22?F.3H]/D`0?="#P(I"`H^!D +M`6`"0?J0@.?@<`)!^I"`YN#$5`]D`7`BD`:KX)"`[O"0!JK@D(#M\*/@_W`( +MD(#MX/[_@`"0@.[O\)"`Y>!$!/#DD(#P\)"`\J/@D`58\)`!5^3PD`$\=`+P +MD(#KX%3]\%3O\)"`YN#_Q%0/)/U0`H`",=B0@.7@$Q,35!\PX!"0@.W@_Z/@ +MM0<&$F=*$DV?(I"`Y.#_$Q-4/S#@$>]4^_"0@.O@5/WP5`=P0H`]D(#PX`3P +MD(#KX%3O\)"`\.#_M`$"@`3OM`(&D`58X`3PD(#XX/^0@/#@TY]`#Y"`H^"T +M`0N0@.7@5/OP(A)'IB+D_N_#$_WO,.`$[B2`_I#]$.WPKP8BJP>J!NTK^^0Z +M^L.0@*#@FY"`G^":4!.CX"0!_Y"`G^`T`/[#ZY_[ZI[ZZI#]$?"O`W0`+_6" ++Y#3[]8/@_R(`,@@` +` +end Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.h ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_attach.h Wed Jan 2 06:03:19 2019 (r342681) +++ head/sys/dev/rtwn/pci/rtwn_pci_attach.h Wed Jan 2 06:48:53 2019 (r342682) @@ -17,9 +17,11 @@ */ void r92ce_attach(struct rtwn_pci_softc *); +void r88ee_attach(struct rtwn_pci_softc *); enum { RTWN_CHIP_RTL8192CE, + RTWN_CHIP_RTL8188EE, RTWN_CHIP_MAX_PCI }; @@ -32,13 +34,15 @@ struct rtwn_pci_ident { static const struct rtwn_pci_ident rtwn_pci_ident_table[] = { { 0x10ec, 0x8176, "Realtek RTL8188CE", RTWN_CHIP_RTL8192CE }, + { 0x10ec, 0x8179, "Realtek RTL8188EE", RTWN_CHIP_RTL8188EE }, { 0, 0, NULL, RTWN_CHIP_MAX_PCI } }; typedef void (*chip_pci_attach)(struct rtwn_pci_softc *); static const chip_pci_attach rtwn_chip_pci_attach[RTWN_CHIP_MAX_PCI] = { - [RTWN_CHIP_RTL8192CE] = r92ce_attach + [RTWN_CHIP_RTL8192CE] = r92ce_attach, + [RTWN_CHIP_RTL8188EE] = r88ee_attach }; static __inline void Added: head/sys/dev/rtwn/rtl8188e/pci/r88ee.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/rtwn/rtl8188e/pci/r88ee.h Wed Jan 2 06:48:53 2019 (r342682) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2018 Farhan Khan + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef RTL8188EE_H +#define RTL8188EE_H + +#include + + +/* + * Global definitions. + */ +#define R88EE_PUBQ_NPAGES 115 +#define R88EE_HPQ_NPAGES 41 +#define R88EE_NPQ_NPAGES 1 +#define R88EE_LPQ_NPAGES 13 +#define R88EE_TX_PAGE_COUNT \ + (R88EE_PUBQ_NPAGES + R88EE_HPQ_NPAGES + \ + R88EE_NPQ_NPAGES + R88EE_LPQ_NPAGES) + + +/* + * Function declarations. + */ +/* r88ee_init.c */ +void r88ee_init_bb(struct rtwn_softc *); +void r88ee_init_intr(struct rtwn_softc *); +int r88ee_power_on(struct rtwn_softc *); +void r88ee_power_off(struct rtwn_softc *); + +/* r88ee_rx.c */ +int r88ee_get_intr_status(struct rtwn_pci_softc *, int *); +void r88ee_enable_intr(struct rtwn_pci_softc *); +void r88ee_start_xfers(struct rtwn_softc *); +void r88ee_post_init(struct rtwn_softc *); + +#endif /* RTL8188EE_H */ + Added: head/sys/dev/rtwn/rtl8188e/pci/r88ee_attach.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/rtwn/rtl8188e/pci/r88ee_attach.c Wed Jan 2 06:48:53 2019 (r342682) @@ -0,0 +1,242 @@ +/*- + * Copyright (c) 2018 Farhan Khan + * + * 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 +__FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include + +#include +#include /* for 'macaddr' field */ + +#include +#include + +#include +#include + +static struct rtwn_r88e_txpwr r88ee_txpwr; + +void r88ee_attach(struct rtwn_pci_softc *); + +static void +r88ee_set_macaddr(struct rtwn_softc *sc, uint8_t *buf) +{ + struct r88e_rom *rom = (struct r88e_rom *)buf; + + IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, rom->diff_d0.pci.macaddr); +} + +static void +r88ee_postattach(struct rtwn_softc *sc) +{ + struct r92c_softc *rs = sc->sc_priv; + struct ieee80211com *ic = &sc->sc_ic; + + rs->rs_scan_start = ic->ic_scan_start; + ic->ic_scan_start = r92c_scan_start; + rs->rs_scan_end = ic->ic_scan_end; + ic->ic_scan_end = r92c_scan_end; +} + +static void +r88ee_attach_private(struct rtwn_softc *sc) +{ + struct r92c_softc *rs; + + rs = malloc(sizeof(struct r92c_softc), M_RTWN_PRIV, M_WAITOK | M_ZERO); + + rs->rs_txpwr = &r88ee_txpwr; + + rs->rs_set_bw20 = r88e_set_bw20; + rs->rs_get_txpower = r88e_get_txpower; + rs->rs_set_gain = r88e_set_gain; + rs->rs_tx_enable_ampdu = r88e_tx_enable_ampdu; + rs->rs_tx_setup_hwseq = r88e_tx_setup_hwseq; + rs->rs_tx_setup_macid = r88e_tx_setup_macid; + rs->rs_set_rom_opts = r88ee_set_macaddr; + + rs->rf_read_delay[0] = 1000; + rs->rf_read_delay[1] = 1000; + rs->rf_read_delay[2] = 1000; + + sc->sc_priv = rs; + +} + +static void +r88ee_adj_devcaps(struct rtwn_softc *sc) +{ + /* XXX TODO */ +} + +void +r88ee_attach(struct rtwn_pci_softc *pc) +{ + struct rtwn_softc *sc = &pc->pc_sc; + + /* PCIe part. */ + pc->pc_setup_tx_desc = r92ce_setup_tx_desc; + pc->pc_tx_postsetup = r92ce_tx_postsetup; + pc->pc_copy_tx_desc = r92ce_copy_tx_desc; + pc->pc_enable_intr = r88ee_enable_intr; + pc->pc_get_intr_status = r88ee_get_intr_status; + + pc->pc_qmap = 0xe771; + pc->tcr = 0x8200; + + /* Common part. */ + sc->sc_flags = RTWN_FLAG_EXT_HDR; + + sc->sc_start_xfers = r88ee_start_xfers; + sc->sc_set_chan = r92c_set_chan; + sc->sc_fill_tx_desc = r92c_fill_tx_desc; + sc->sc_fill_tx_desc_raw = r92c_fill_tx_desc_raw; + sc->sc_fill_tx_desc_null = r92c_fill_tx_desc_null; /* XXX recheck */ + sc->sc_dump_tx_desc = r92ce_dump_tx_desc; + sc->sc_tx_radiotap_flags = r92c_tx_radiotap_flags; + sc->sc_rx_radiotap_flags = r92c_rx_radiotap_flags; + sc->sc_get_rx_stats = r88e_get_rx_stats; + sc->sc_get_rssi_cck = r88e_get_rssi_cck; + sc->sc_get_rssi_ofdm = r88e_get_rssi_ofdm; + sc->sc_classify_intr = r88e_classify_intr; + sc->sc_handle_tx_report = r88e_ratectl_tx_complete; + sc->sc_handle_c2h_report = r88e_handle_c2h_report; + sc->sc_check_frame = rtwn_nop_int_softc_mbuf; + sc->sc_rf_read = r92c_rf_read; + sc->sc_rf_write = r88e_rf_write; + sc->sc_check_condition = r92c_check_condition; + sc->sc_efuse_postread = rtwn_nop_softc; + sc->sc_parse_rom = r88e_parse_rom; + sc->sc_set_led = r88e_set_led; + sc->sc_power_on = r88ee_power_on; + sc->sc_power_off = r88ee_power_off; +#ifndef RTWN_WITHOUT_UCODE + sc->sc_fw_reset = r88e_fw_reset; + sc->sc_fw_download_enable = r88e_fw_download_enable; +#endif + sc->sc_llt_init = r92c_llt_init; + sc->sc_set_page_size = r92c_set_page_size; + sc->sc_lc_calib = r92c_lc_calib; + sc->sc_iq_calib = r88e_iq_calib; + sc->sc_read_chipid_vendor = rtwn_nop_softc_uint32; + sc->sc_adj_devcaps = r88ee_adj_devcaps; + sc->sc_vap_preattach = rtwn_nop_softc_vap; + sc->sc_postattach = r88ee_postattach; + sc->sc_detach_private = r92c_detach_private; + sc->sc_set_media_status = r88e_set_media_status; +#ifndef RTWN_WITHOUT_UCODE + sc->sc_set_rsvd_page = r88e_set_rsvd_page; + sc->sc_set_pwrmode = r88e_set_pwrmode; + sc->sc_set_rssi = r92c_set_rssi; +#endif + sc->sc_beacon_init = r92c_beacon_init; + sc->sc_beacon_enable = r88e_beacon_enable; + sc->sc_beacon_set_rate = rtwn_nop_void_int; + sc->sc_beacon_select = rtwn_nop_softc_int; + sc->sc_temp_measure = r88e_temp_measure; + sc->sc_temp_read = r88e_temp_read; + sc->sc_init_tx_agg = rtwn_nop_softc; + sc->sc_init_rx_agg = rtwn_nop_softc; + sc->sc_init_ampdu = r92ce_init_ampdu; + sc->sc_init_intr = r88ee_init_intr; + sc->sc_init_edca = r92ce_init_edca; + sc->sc_init_bb = r88ee_init_bb; + sc->sc_init_rf = r92c_init_rf; + sc->sc_init_antsel = rtwn_nop_softc; + sc->sc_post_init = r88ee_post_init; + sc->sc_init_bcnq1_boundary = rtwn_nop_int_softc; + + sc->mac_prog = &rtl8188e_mac[0]; + sc->mac_size = nitems(rtl8188e_mac); + sc->bb_prog = &rtl8188e_bb[0]; + sc->bb_size = nitems(rtl8188e_bb); + sc->agc_prog = &rtl8188e_agc[0]; + sc->agc_size = nitems(rtl8188e_agc); + sc->rf_prog = &rtl8188e_rf[0]; + + sc->name = "RTL8188EE"; + sc->fwname = "rtwn-rtl8188eefw"; + sc->fwsig = 0x88e; + + sc->page_count = R88EE_TX_PAGE_COUNT; + sc->pktbuf_count = R88E_TXPKTBUF_COUNT; + + sc->ackto = 0x40; + sc->npubqpages = R88EE_PUBQ_NPAGES; + sc->nhqpages = R88EE_HPQ_NPAGES; + sc->nnqpages = R88EE_NPQ_NPAGES; + sc->nlqpages = R88EE_LPQ_NPAGES; + sc->page_size = R92C_TX_PAGE_SIZE; + + sc->txdesc_len = sizeof(struct r92ce_tx_desc); + sc->efuse_maxlen = R88E_EFUSE_MAX_LEN; + sc->efuse_maplen = R88E_EFUSE_MAP_LEN; + sc->rx_dma_size = R88E_RX_DMA_BUFFER_SIZE; + + sc->macid_limit = R88E_MACID_MAX + 1; + sc->cam_entry_limit = R92C_CAM_ENTRY_COUNT; + sc->fwsize_limit = R92C_MAX_FW_SIZE; + sc->temp_delta = R88E_CALIB_THRESHOLD; + + sc->bcn_status_reg[0] = R92C_TDECTRL; + /* + * TODO: some additional setup is required + * to maintain few beacons at the same time. + * + * XXX BCNQ1 mechanism is not needed here; move it to the USB module. + */ + sc->bcn_status_reg[1] = R92C_TDECTRL; + sc->rcr = 0; + + sc->ntxchains = 1; + sc->nrxchains = 1; + + r88ee_attach_private(sc); +} Added: head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c Wed Jan 2 06:48:53 2019 (r342682) @@ -0,0 +1,276 @@ +/*- + * Copyright (c) 2017 Farhan Khan + * + * 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 +__FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include + +#include + +#include +#include + +void +r88ee_init_bb(struct rtwn_softc *sc) +{ + + /* Enable BB and RF. */ + rtwn_setbits_2(sc, R92C_SYS_FUNC_EN, 0, + R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST | + R92C_SYS_FUNC_EN_DIO_RF); + + rtwn_write_1(sc, R92C_RF_CTRL, + R92C_RF_CTRL_EN | R92C_RF_CTRL_RSTB | R92C_RF_CTRL_SDMRSTB); + rtwn_write_1(sc, R92C_SYS_FUNC_EN, R92C_SYS_FUNC_EN_PPLL | + R92C_SYS_FUNC_EN_PCIEA | R92C_SYS_FUNC_EN_DIO_PCIE | + R92C_SYS_FUNC_EN_BB_GLB_RST | R92C_SYS_FUNC_EN_BBRSTB); + + r88e_init_bb_common(sc); +} + +void +r88ee_init_intr(struct rtwn_softc *sc) +{ + /* Disable interrupts. */ + rtwn_write_4(sc, R88E_HIMR, 0x00000000); + rtwn_write_4(sc, R88E_HIMRE, 0x00000000); +} + +int +r88ee_power_on(struct rtwn_softc *sc) +{ + int ntries; + + /* Wait for power ready bit. */ + for (ntries = 0; ntries < 5000; ntries++) { + if (rtwn_read_4(sc, R92C_APS_FSMCO) & R92C_APS_FSMCO_SUS_HOST) + break; + rtwn_delay(sc, 10); + } + if (ntries == 5000) { + device_printf(sc->sc_dev, + "timeout waiting for chip power up\n"); + return (ETIMEDOUT); + } + + /* Unlock ISO/CLK/Power control register. */ + rtwn_write_1(sc, R92C_RSV_CTRL, 0); + + /* Reset BB. */ + rtwn_setbits_1(sc, R92C_SYS_FUNC_EN, + R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST, 0); + + /* schmit trigger */ + rtwn_setbits_1(sc, R92C_AFE_XTAL_CTRL + 2, 0, 0x80); + + /* Disable HWPDN. */ + rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, + R92C_APS_FSMCO_APDM_HPDN, 0, 1); + + /* Disable WL suspend. */ + rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, + R92C_APS_FSMCO_AFSM_HSUS | R92C_APS_FSMCO_AFSM_PCIE, 0, 1); + + rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, + 0, R92C_APS_FSMCO_APFM_ONMAC, 1); + for (ntries = 0; ntries < 5000; ntries++) { + if (!(rtwn_read_2(sc, R92C_APS_FSMCO) & + R92C_APS_FSMCO_APFM_ONMAC)) + break; + rtwn_delay(sc, 10); + } + if (ntries == 5000) + return (ETIMEDOUT); + + rtwn_setbits_1(sc, R92C_PCIE_CTRL_REG + 2, 0, 0x04); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jan 2 06:59:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E620A1438030; Wed, 2 Jan 2019 06:59:55 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1D2764A2; Wed, 2 Jan 2019 06:59:55 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf1-f45.google.com with SMTP id b20so20347022lfa.12; Tue, 01 Jan 2019 22:59:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=QYqERu8GeyYdieNESg3IS2cfx8Dbbj+NCHLEYSZkdPQ=; b=rp0Bs7nny/ivx6L9zFlTZKVL/rzZSfJ7YRsMjS9YGEGee+mJsvwGh7mGbrKZbfWiDV phkyuE5cCQjRtp/GuKJU3Mtcw2Wl520bhUGHeJmPyD1r9NiprM0/wn61dX6SpjM8axEt M/cRuk31JQk1TMUmAmK1rREe3XKtl4BN/kEl7nxiy8tvBC0wIVBTnmZQHsEKJ7pF29eG 1XMs4rYO7eoJafYzzPNbpwGdOPpHzfwxZpAgiQdoMwDcR6bspLU9i7FDCUYFD5mVwZ0K 5NC4GqL+lqtGcagIgy/JAJzcwfNa01pfUFDysL7Np7IHrF3voacqAEfPYfht5uQFKAqh bYCQ== X-Gm-Message-State: AA+aEWZmA0k+0lQXIH0XIfXPDHxMpF0Dq/7Idbu1uWYpQu/UPTHTCZ2V LV3t4KP6mdqJPPVDRM0V52jZwPUb X-Google-Smtp-Source: AFSGD/V4kTi3Twwei3vewqQL/63HchzJR2C7XoJX8/tCyWRYjYk+jieRmn29Mfp7mFkykLfXvLEMkw== X-Received: by 2002:a19:24c6:: with SMTP id k189mr21980186lfk.77.1546411928071; Tue, 01 Jan 2019 22:52:08 -0800 (PST) Received: from localhost (46-133-39-7.dialup.umc.net.ua. [46.133.39.7]) by smtp.gmail.com with ESMTPSA id q3sm10013659lff.42.2019.01.01.22.52.07 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 01 Jan 2019 22:52:07 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342682 - in head: share/man/man4 sys/contrib/dev/rtwn sys/dev/rtwn/pci sys/dev/rtwn/rtl8188e sys/dev/rtwn/rtl8188e/pci sys/dev/rtwn/rtl8188e/usb sys/modules/rtwn_pci sys/modules/rtwnfw... References: <201901020648.x026mrmC079331@repo.freebsd.org> Date: Wed, 02 Jan 2019 06:52:02 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201901020648.x026mrmC079331@repo.freebsd.org> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: 4D1D2764A2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,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, 02 Jan 2019 06:59:56 -0000 Wed, 02 Jan 2019 08:48:53 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Andriy Voskoboinyk = : Tested with: RTL8188CUS, RTL8188EE, RTL8188EU and RTL8821AU From owner-svn-src-all@freebsd.org Wed Jan 2 07:30:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15D491439017; Wed, 2 Jan 2019 07:30:29 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABC0477847; Wed, 2 Jan 2019 07:30:28 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A033C6565; Wed, 2 Jan 2019 07:30:28 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x027USkp000230; Wed, 2 Jan 2019 07:30:28 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x027USZ9000228; Wed, 2 Jan 2019 07:30:28 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201901020730.x027USZ9000228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 2 Jan 2019 07:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342683 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 342683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ABC0477847 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)[-0.998,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: Wed, 02 Jan 2019 07:30:29 -0000 Author: tsoome Date: Wed Jan 2 07:30:27 2019 New Revision: 342683 URL: https://svnweb.freebsd.org/changeset/base/342683 Log: MFC r341438: zfs: we can boot from dataset with large_dnode enabled loader has been supporting large_dnode for some time, no need to block the feature for boot dataset. Relnotes: yes Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Jan 2 06:48:53 2019 (r342682) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Jan 2 07:30:27 2019 (r342683) @@ -615,9 +615,7 @@ spa_prop_validate(spa_t *spa, nvlist_t *props) /* * Must be ZPL, and its property settings - * must be supported by GRUB (compression - * is not gzip, and large blocks or large - * dnodes are not used). + * must be supported. */ if (dmu_objset_type(os) != DMU_OST_ZFS) { @@ -627,12 +625,6 @@ spa_prop_validate(spa_t *spa, nvlist_t *props) zfs_prop_to_name(ZFS_PROP_COMPRESSION), &propval)) == 0 && !BOOTFS_COMPRESS_VALID(propval)) { - error = SET_ERROR(ENOTSUP); - } else if ((error = - dsl_prop_get_int_ds(dmu_objset_ds(os), - zfs_prop_to_name(ZFS_PROP_DNODESIZE), - &propval)) == 0 && - propval != ZFS_DNSIZE_LEGACY) { error = SET_ERROR(ENOTSUP); } else { objnum = dmu_objset_id(os); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jan 2 06:48:53 2019 (r342682) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jan 2 07:30:27 2019 (r342683) @@ -4208,16 +4208,6 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, intval != ZFS_DNSIZE_LEGACY) { spa_t *spa; - /* - * If this is a bootable dataset then - * we don't allow large (>512B) dnodes, - * because GRUB doesn't support them. - */ - if (zfs_is_bootfs(dsname) && - intval != ZFS_DNSIZE_LEGACY) { - return (SET_ERROR(EDOM)); - } - if ((err = spa_open(dsname, &spa, FTAG)) != 0) return (err); From owner-svn-src-all@freebsd.org Wed Jan 2 15:01:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49D0814233B1; Wed, 2 Jan 2019 15:01:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B971A8FB96; Wed, 2 Jan 2019 15:01:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9F27B399; Wed, 2 Jan 2019 15:01:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02F1tD0038438; Wed, 2 Jan 2019 15:01:55 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02F1tWK038437; Wed, 2 Jan 2019 15:01:55 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901021501.x02F1tWK038437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 15:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342684 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 342684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B971A8FB96 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.961,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 15:01:56 -0000 Author: avos Date: Wed Jan 2 15:01:55 2019 New Revision: 342684 URL: https://svnweb.freebsd.org/changeset/base/342684 Log: Refresh sys/conf/files after recent rtwn(4) update. MFC after: 4 days Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jan 2 07:30:27 2019 (r342683) +++ head/sys/conf/files Wed Jan 2 15:01:55 2019 (r342684) @@ -2859,9 +2859,11 @@ dev/rtwn/rtl8188e/r88e_tx.c optional rtwn dev/rtwn/rtl8188e/r88e_rf.c optional rtwn dev/rtwn/rtl8188e/r88e_rom.c optional rtwn dev/rtwn/rtl8188e/r88e_rx.c optional rtwn +dev/rtwn/rtl8188e/pci/r88ee_attach.c optional rtwn_pci pci +dev/rtwn/rtl8188e/pci/r88ee_init.c optional rtwn_pci pci +dev/rtwn/rtl8188e/pci/r88ee_rx.c optional rtwn_pci pci dev/rtwn/rtl8188e/usb/r88eu_attach.c optional rtwn_usb dev/rtwn/rtl8188e/usb/r88eu_init.c optional rtwn_usb -dev/rtwn/rtl8188e/usb/r88eu_rx.c optional rtwn_usb # RTL8192C dev/rtwn/rtl8192c/r92c_attach.c optional rtwn dev/rtwn/rtl8192c/r92c_beacon.c optional rtwn @@ -2924,6 +2926,20 @@ dev/rtwn/rtl8821a/r21a_rx.c optional rtwn dev/rtwn/rtl8821a/usb/r21au_attach.c optional rtwn_usb dev/rtwn/rtl8821a/usb/r21au_dfs.c optional rtwn_usb dev/rtwn/rtl8821a/usb/r21au_init.c optional rtwn_usb +rtwn-rtl8188eefw.c optional rtwn-rtl8188eefw | rtwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8188eefw.fw:rtwn-rtl8188eefw:111 -mrtwn-rtl8188eefw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "rtwn-rtl8188eefw.c" +rtwn-rtl8188eefw.fwo optional rtwn-rtl8188eefw | rtwnfw \ + dependency "rtwn-rtl8188eefw.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "rtwn-rtl8188eefw.fwo" +rtwn-rtl8188eefw.fw optional rtwn-rtl8188eefw | rtwnfw \ + dependency "$S/contrib/dev/rtwn/rtwn-rtl8188eefw.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "rtwn-rtl8188eefw.fw" rtwn-rtl8188eufw.c optional rtwn-rtl8188eufw | rtwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8188eufw.fw:rtwn-rtl8188eufw:111 -mrtwn-rtl8188eufw -c${.TARGET}" \ no-implicit-rule before-depend local \ From owner-svn-src-all@freebsd.org Wed Jan 2 15:13:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D9AD1423A8B; Wed, 2 Jan 2019 15:13:09 +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 3FD4B90384; Wed, 2 Jan 2019 15:13:09 +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 2D7B6B580; Wed, 2 Jan 2019 15:13:09 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02FD9NU045542; Wed, 2 Jan 2019 15:13:09 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02FD9J9045541; Wed, 2 Jan 2019 15:13:09 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901021513.x02FD9J9045541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 2 Jan 2019 15:13:09 +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: r342685 - in stable: 10/sys/contrib/ipfilter/netinet 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: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3FD4B90384 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)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Jan 2019 15:13:09 -0000 Author: cy Date: Wed Jan 2 15:13:08 2019 New Revision: 342685 URL: https://svnweb.freebsd.org/changeset/base/342685 Log: MFC r342596: Remove duplicate include of sys/mbuf.h. Reported by: Trond Endrest Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jan 2 15:01:55 2019 (r342684) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jan 2 15:13:08 2019 (r342685) @@ -39,7 +39,6 @@ static const char rcsid[] = "@(#)$Id$"; # include # include # include -# include #include # include # include From owner-svn-src-all@freebsd.org Wed Jan 2 15:13:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 428C51423A96; Wed, 2 Jan 2019 15:13:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6B2490386; Wed, 2 Jan 2019 15:13:09 +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 CADD4B582; Wed, 2 Jan 2019 15:13:09 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02FD9UG045554; Wed, 2 Jan 2019 15:13:09 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02FD9YN045553; Wed, 2 Jan 2019 15:13:09 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901021513.x02FD9YN045553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 2 Jan 2019 15:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342685 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D6B2490386 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)[-0.998,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, 02 Jan 2019 15:13:10 -0000 Author: cy Date: Wed Jan 2 15:13:08 2019 New Revision: 342685 URL: https://svnweb.freebsd.org/changeset/base/342685 Log: MFC r342596: Remove duplicate include of sys/mbuf.h. Reported by: Trond Endrest Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jan 2 15:01:55 2019 (r342684) +++ stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jan 2 15:13:08 2019 (r342685) @@ -38,7 +38,6 @@ static const char rcsid[] = "@(#)$Id$"; #endif # include # include -# include #include # include # include From owner-svn-src-all@freebsd.org Wed Jan 2 15:13:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A13C1423A91; Wed, 2 Jan 2019 15:13:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A58A090385; Wed, 2 Jan 2019 15:13:09 +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 97062B581; Wed, 2 Jan 2019 15:13:09 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02FD9FD045548; Wed, 2 Jan 2019 15:13:09 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02FD94I045547; Wed, 2 Jan 2019 15:13:09 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901021513.x02FD94I045547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 2 Jan 2019 15:13: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: r342685 - in stable: 10/sys/contrib/ipfilter/netinet 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: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A58A090385 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)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Jan 2019 15:13:10 -0000 Author: cy Date: Wed Jan 2 15:13:08 2019 New Revision: 342685 URL: https://svnweb.freebsd.org/changeset/base/342685 Log: MFC r342596: Remove duplicate include of sys/mbuf.h. Reported by: Trond Endrest Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jan 2 15:01:55 2019 (r342684) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Jan 2 15:13:08 2019 (r342685) @@ -39,7 +39,6 @@ static const char rcsid[] = "@(#)$Id$"; # include # include # include -# include #include # include # include From owner-svn-src-all@freebsd.org Wed Jan 2 15:36:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC32C1424F56; Wed, 2 Jan 2019 15:36:36 +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 5395791A33; Wed, 2 Jan 2019 15:36:36 +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 47B55B8F0; Wed, 2 Jan 2019 15:36:36 +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 x02FaaWL055813; Wed, 2 Jan 2019 15:36:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02FaZtB055811; Wed, 2 Jan 2019 15:36:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021536.x02FaZtB055811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 15:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342686 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 342686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5395791A33 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 15:36:36 -0000 Author: markj Date: Wed Jan 2 15:36:35 2019 New Revision: 342686 URL: https://svnweb.freebsd.org/changeset/base/342686 Log: Avoid setting PG_U unconditionally in pmap_enter_quick_locked(). This KPI may in principle be used to create kernel mappings, in which case we certainly should not be setting PG_U. In any case, PG_U must be set on all layers in the page tables to grant user mode access, and we were only setting it on leaf entries. Thus, this change should have no functional impact. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Jan 2 15:13:08 2019 (r342685) +++ head/sys/amd64/amd64/pmap.c Wed Jan 2 15:36:35 2019 (r342686) @@ -5453,8 +5453,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp) { struct spglist free; - pt_entry_t *pte, PG_V; - vm_paddr_t pa; + pt_entry_t newpte, *pte, PG_V; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || (m->oflags & VPO_UNMANAGED) != 0, @@ -5544,17 +5543,15 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ pmap_resident_count_inc(pmap, 1); - pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(pmap, m->md.pat_mode, 0); + newpte = VM_PAGE_TO_PHYS(m) | PG_V | + pmap_cache_bits(pmap, m->md.pat_mode, 0); + if ((m->oflags & VPO_UNMANAGED) == 0) + newpte |= PG_MANAGED; if ((prot & VM_PROT_EXECUTE) == 0) - pa |= pg_nx; - - /* - * Now validate mapping with RO protection - */ - if ((m->oflags & VPO_UNMANAGED) != 0) - pte_store(pte, pa | PG_V | PG_U); - else - pte_store(pte, pa | PG_V | PG_U | PG_MANAGED); + newpte |= pg_nx; + if (va < VM_MAXUSER_ADDRESS) + newpte |= PG_U; + pte_store(pte, newpte); return (mpte); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Jan 2 15:13:08 2019 (r342685) +++ head/sys/i386/i386/pmap.c Wed Jan 2 15:36:35 2019 (r342686) @@ -4095,8 +4095,7 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte) { - pt_entry_t *pte; - vm_paddr_t pa; + pt_entry_t newpte, *pte; struct spglist free; KASSERT(pmap != kernel_pmap || va < kmi.clean_sva || @@ -4179,19 +4178,17 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ pmap->pm_stats.resident_count++; - pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(pmap, m->md.pat_mode, 0); + newpte = VM_PAGE_TO_PHYS(m) | PG_V | + pmap_cache_bits(pmap, m->md.pat_mode, 0); + if ((m->oflags & VPO_UNMANAGED) == 0) + newpte |= PG_MANAGED; #if defined(PAE) || defined(PAE_TABLES) if ((prot & VM_PROT_EXECUTE) == 0) - pa |= pg_nx; + newpte |= pg_nx; #endif - - /* - * Now validate mapping with RO protection - */ - if ((m->oflags & VPO_UNMANAGED) != 0) - pte_store(pte, pa | PG_V | PG_U); - else - pte_store(pte, pa | PG_V | PG_U | PG_MANAGED); + if (pmap != kernel_pmap) + newpte |= PG_U; + pte_store(pte, newpte); sched_unpin(); return (mpte); } From owner-svn-src-all@freebsd.org Wed Jan 2 15:52:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8902D1425B44; Wed, 2 Jan 2019 15:52:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F2B8928CB; Wed, 2 Jan 2019 15:52:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23867BDE0; Wed, 2 Jan 2019 15:52:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02FqHpi066262; Wed, 2 Jan 2019 15:52:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02FqGPX066259; Wed, 2 Jan 2019 15:52:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021552.x02FqGPX066259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 15:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342687 - in head/sys/geom: concat mirror raid X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/geom: concat mirror raid X-SVN-Commit-Revision: 342687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F2B8928CB 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)[-0.998,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, 02 Jan 2019 15:52:17 -0000 Author: markj Date: Wed Jan 2 15:52:16 2019 New Revision: 342687 URL: https://svnweb.freebsd.org/changeset/base/342687 Log: Use g_handleattr() to reply to GEOM::candelete queries. g_handleattr() fills out bp->bio_completed; otherwise, g_getattr() returns an error in response to the query. This caused BIO_DELETE support to not be propagated through stacked configurations, e.g., a gconcat of gmirror volumes would not handle BIO_DELETE even when the gmirrors do. g_io_getattr() was not affected by the problem. PR: 232676 Reported and tested by: noah.bergbauer@tum.de MFC after: 1 week Modified: head/sys/geom/concat/g_concat.c head/sys/geom/mirror/g_mirror.c head/sys/geom/raid/g_raid.c Modified: head/sys/geom/concat/g_concat.c ============================================================================== --- head/sys/geom/concat/g_concat.c Wed Jan 2 15:36:35 2019 (r342686) +++ head/sys/geom/concat/g_concat.c Wed Jan 2 15:52:16 2019 (r342687) @@ -210,20 +210,16 @@ g_concat_candelete(struct bio *bp) { struct g_concat_softc *sc; struct g_concat_disk *disk; - int i, *val; + int i, val; - val = (int *)bp->bio_data; - *val = 0; - sc = bp->bio_to->geom->softc; for (i = 0; i < sc->sc_ndisks; i++) { disk = &sc->sc_disks[i]; - if (!disk->d_removed && disk->d_candelete) { - *val = 1; + if (!disk->d_removed && disk->d_candelete) break; - } } - g_io_deliver(bp, 0); + val = i < sc->sc_ndisks; + g_handleattr(bp, "GEOM::candelete", &val, sizeof(val)); } static void Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Jan 2 15:36:35 2019 (r342686) +++ head/sys/geom/mirror/g_mirror.c Wed Jan 2 15:52:16 2019 (r342687) @@ -1086,16 +1086,15 @@ g_mirror_candelete(struct bio *bp) { struct g_mirror_softc *sc; struct g_mirror_disk *disk; - int *val; + int val; sc = bp->bio_to->private; LIST_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_flags & G_MIRROR_DISK_FLAG_CANDELETE) break; } - val = (int *)bp->bio_data; - *val = (disk != NULL); - g_io_deliver(bp, 0); + val = disk != NULL; + g_handleattr(bp, "GEOM::candelete", &val, sizeof(val)); } static void Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Wed Jan 2 15:36:35 2019 (r342686) +++ head/sys/geom/raid/g_raid.c Wed Jan 2 15:52:16 2019 (r342687) @@ -1075,23 +1075,19 @@ g_raid_candelete(struct g_raid_softc *sc, struct bio * struct g_provider *pp; struct g_raid_volume *vol; struct g_raid_subdisk *sd; - int *val; - int i; + int i, val; - val = (int *)bp->bio_data; pp = bp->bio_to; vol = pp->private; - *val = 0; for (i = 0; i < vol->v_disks_count; i++) { sd = &vol->v_subdisks[i]; if (sd->sd_state == G_RAID_SUBDISK_S_NONE) continue; - if (sd->sd_disk->d_candelete) { - *val = 1; + if (sd->sd_disk->d_candelete) break; - } } - g_io_deliver(bp, 0); + val = i < vol->v_disks_count; + g_handleattr(bp, "GEOM::candelete", &val, sizeof(val)); } static void From owner-svn-src-all@freebsd.org Wed Jan 2 16:01:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2E691426221; Wed, 2 Jan 2019 16:01:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9882593135; Wed, 2 Jan 2019 16:01:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B941BF80; Wed, 2 Jan 2019 16:01:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02G1slH071363; Wed, 2 Jan 2019 16:01:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02G1sBF071362; Wed, 2 Jan 2019 16:01:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021601.x02G1sBF071362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 16:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342688 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 342688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9882593135 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 16:01:55 -0000 Author: markj Date: Wed Jan 2 16:01:54 2019 New Revision: 342688 URL: https://svnweb.freebsd.org/changeset/base/342688 Log: Typo. Reported by: Christian Barthel MFC after: 3 days Modified: head/share/man/man3/timeradd.3 Modified: head/share/man/man3/timeradd.3 ============================================================================== --- head/share/man/man3/timeradd.3 Wed Jan 2 15:52:16 2019 (r342687) +++ head/share/man/man3/timeradd.3 Wed Jan 2 16:01:54 2019 (r342688) @@ -94,7 +94,7 @@ structure is defined in as: .Bd -literal struct timespec { - time_t tv_nsec; /* seconds */ + time_t tv_sec; /* seconds */ long tv_nsec; /* and nanoseconds */ }; .Ed From owner-svn-src-all@freebsd.org Wed Jan 2 16:11:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE35D14267F0; Wed, 2 Jan 2019 16:11:03 +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 72BCA938F8; Wed, 2 Jan 2019 16:11:03 +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 65328BFFA; Wed, 2 Jan 2019 16:11:03 +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 x02GB3bu072653; Wed, 2 Jan 2019 16:11:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02GB2UL072648; Wed, 2 Jan 2019 16:11:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021611.x02GB2UL072648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 16:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342689 - in stable/12/sys: dev/drm2/radeon modules/drm2/radeonkms X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: dev/drm2/radeon modules/drm2/radeonkms X-SVN-Commit-Revision: 342689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 72BCA938F8 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.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 16:11:04 -0000 Author: markj Date: Wed Jan 2 16:11:02 2019 New Revision: 342689 URL: https://svnweb.freebsd.org/changeset/base/342689 Log: MFC r342182: Remove UMS support code from radeonkms. Deleted: stable/12/sys/dev/drm2/radeon/r300_cmdbuf.c stable/12/sys/dev/drm2/radeon/r600_blit.c stable/12/sys/dev/drm2/radeon/r600_cp.c stable/12/sys/dev/drm2/radeon/radeon_cp.c stable/12/sys/dev/drm2/radeon/radeon_ioc32.c stable/12/sys/dev/drm2/radeon/radeon_state.c Modified: stable/12/sys/dev/drm2/radeon/r600_blit_kms.c stable/12/sys/dev/drm2/radeon/r600_cs.c stable/12/sys/dev/drm2/radeon/radeon_irq.c stable/12/sys/modules/drm2/radeonkms/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/drm2/radeon/r600_blit_kms.c ============================================================================== --- stable/12/sys/dev/drm2/radeon/r600_blit_kms.c Wed Jan 2 16:01:54 2019 (r342688) +++ stable/12/sys/dev/drm2/radeon/r600_blit_kms.c Wed Jan 2 16:11:02 2019 (r342689) @@ -35,6 +35,39 @@ __FBSDID("$FreeBSD$"); #include "r600_blit_shaders.h" #include "radeon_blit_common.h" +/* 23 bits of float fractional data */ +#define I2F_FRAC_BITS 23 +#define I2F_MASK ((1 << I2F_FRAC_BITS) - 1) + +/* + * Converts unsigned integer into 32-bit IEEE floating point representation. + * Will be exact from 0 to 2^24. Above that, we round towards zero + * as the fractional bits will not fit in a float. (It would be better to + * round towards even as the fpu does, but that is slower.) + * + * Moved from r600_blit.c after that file was removed. + */ +__pure uint32_t int2float(uint32_t x) +{ + uint32_t msb, exponent, fraction; + + /* Zero is special */ + if (!x) return 0; + + /* Get location of the most significant bit */ + msb = fls(x); + + /* + * Use a rotate instead of a shift because that works both leftwards + * and rightwards due to the mod(32) behaviour. This means we don't + * need to check to see if we are above 2^24 or not. + */ + fraction = ror32(x, (msb - I2F_FRAC_BITS) & 0x1f) & I2F_MASK; + exponent = (127 + msb) << I2F_FRAC_BITS; + + return fraction + exponent; +} + /* emits 21 on rv770+, 23 on r600 */ static void set_render_target(struct radeon_device *rdev, int format, Modified: stable/12/sys/dev/drm2/radeon/r600_cs.c ============================================================================== --- stable/12/sys/dev/drm2/radeon/r600_cs.c Wed Jan 2 16:01:54 2019 (r342688) +++ stable/12/sys/dev/drm2/radeon/r600_cs.c Wed Jan 2 16:11:02 2019 (r342689) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); static int r600_cs_packet_next_reloc_mm(struct radeon_cs_parser *p, struct radeon_cs_reloc **cs_reloc); -static int r600_cs_packet_next_reloc_nomm(struct radeon_cs_parser *p, - struct radeon_cs_reloc **cs_reloc); typedef int (*next_reloc_t)(struct radeon_cs_parser*, struct radeon_cs_reloc**); static next_reloc_t r600_cs_packet_next_reloc = &r600_cs_packet_next_reloc_mm; #ifdef FREEBSD_WIP /* FreeBSD: to please GCC 4.2. */ @@ -885,53 +883,6 @@ static int r600_cs_packet_next_reloc_mm(struct radeon_ } /** - * r600_cs_packet_next_reloc_nomm() - parse next packet which should be reloc packet3 - * @parser: parser structure holding parsing context. - * @data: pointer to relocation data - * @offset_start: starting offset - * @offset_mask: offset mask (to align start offset on) - * @reloc: reloc informations - * - * Check next packet is relocation packet3, do bo validation and compute - * GPU offset using the provided start. - **/ -static int r600_cs_packet_next_reloc_nomm(struct radeon_cs_parser *p, - struct radeon_cs_reloc **cs_reloc) -{ - struct radeon_cs_chunk *relocs_chunk; - struct radeon_cs_packet p3reloc; - unsigned idx; - int r; - - if (p->chunk_relocs_idx == -1) { - DRM_ERROR("No relocation chunk !\n"); - return -EINVAL; - } - *cs_reloc = NULL; - relocs_chunk = &p->chunks[p->chunk_relocs_idx]; - r = r600_cs_packet_parse(p, &p3reloc, p->idx); - if (r) { - return r; - } - p->idx += p3reloc.count + 2; - if (p3reloc.type != PACKET_TYPE3 || p3reloc.opcode != PACKET3_NOP) { - DRM_ERROR("No packet3 for relocation for packet at %d.\n", - p3reloc.idx); - return -EINVAL; - } - idx = radeon_get_ib_value(p, p3reloc.idx + 1); - if (idx >= relocs_chunk->length_dw) { - DRM_ERROR("Relocs at %d after relocations chunk end %d !\n", - idx, relocs_chunk->length_dw); - return -EINVAL; - } - *cs_reloc = p->relocs; - (*cs_reloc)->lobj.gpu_offset = (u64)relocs_chunk->kdata[idx + 3] << 32; - (*cs_reloc)->lobj.gpu_offset |= relocs_chunk->kdata[idx + 0]; - return 0; -} - -/** * r600_cs_packet_next_is_pkt3_nop() - test if next packet is packet3 nop for reloc * @parser: parser structure holding parsing context. * @@ -2456,105 +2407,6 @@ int r600_cs_parse(struct radeon_cs_parser *p) free(p->track, DRM_MEM_DRIVER); p->track = NULL; return 0; -} - -static int r600_cs_parser_relocs_legacy(struct radeon_cs_parser *p) -{ - if (p->chunk_relocs_idx == -1) { - return 0; - } - p->relocs = malloc(sizeof(struct radeon_cs_reloc), - DRM_MEM_DRIVER, M_NOWAIT | M_ZERO); - if (p->relocs == NULL) { - return -ENOMEM; - } - return 0; -} - -/** - * cs_parser_fini() - clean parser states - * @parser: parser structure holding parsing context. - * @error: error number - * - * If error is set than unvalidate buffer, otherwise just free memory - * used by parsing context. - **/ -static void r600_cs_parser_fini(struct radeon_cs_parser *parser, int error) -{ - unsigned i; - - free(parser->relocs, DRM_MEM_DRIVER); - for (i = 0; i < parser->nchunks; i++) { - free(parser->chunks[i].kdata, DRM_MEM_DRIVER); - if (parser->rdev && (parser->rdev->flags & RADEON_IS_AGP)) { - free(parser->chunks[i].kpage[0], DRM_MEM_DRIVER); - free(parser->chunks[i].kpage[1], DRM_MEM_DRIVER); - } - } - free(parser->chunks, DRM_MEM_DRIVER); - free(parser->chunks_array, DRM_MEM_DRIVER); - free(parser->track, DRM_MEM_DRIVER); -} - -int r600_cs_legacy(struct drm_device *dev, void *data, struct drm_file *filp, - unsigned family, u32 *ib, int *l) -{ - struct radeon_cs_parser parser; - struct radeon_cs_chunk *ib_chunk; - struct r600_cs_track *track; - int r; - - /* initialize tracker */ - track = malloc(sizeof(*track), DRM_MEM_DRIVER, M_NOWAIT | M_ZERO); - if (track == NULL) - return -ENOMEM; - r600_cs_track_init(track); - r600_cs_legacy_get_tiling_conf(dev, &track->npipes, &track->nbanks, &track->group_size); - /* initialize parser */ - memset(&parser, 0, sizeof(struct radeon_cs_parser)); - parser.filp = filp; - parser.dev = dev->dev; - parser.rdev = NULL; - parser.family = family; - parser.track = track; - parser.ib.ptr = ib; - r = radeon_cs_parser_init(&parser, data); - if (r) { - DRM_ERROR("Failed to initialize parser !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - r = r600_cs_parser_relocs_legacy(&parser); - if (r) { - DRM_ERROR("Failed to parse relocation !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - /* Copy the packet into the IB, the parser will read from the - * input memory (cached) and write to the IB (which can be - * uncached). */ - ib_chunk = &parser.chunks[parser.chunk_ib_idx]; - parser.ib.length_dw = ib_chunk->length_dw; - *l = parser.ib.length_dw; - r = r600_cs_parse(&parser); - if (r) { - DRM_ERROR("Invalid command stream !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - r = radeon_cs_finish_pages(&parser); - if (r) { - DRM_ERROR("Invalid command stream !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - r600_cs_parser_fini(&parser, r); - return r; -} - -void r600_cs_legacy_init(void) -{ - r600_cs_packet_next_reloc = &r600_cs_packet_next_reloc_nomm; } /* Modified: stable/12/sys/dev/drm2/radeon/radeon_irq.c ============================================================================== --- stable/12/sys/dev/drm2/radeon/radeon_irq.c Wed Jan 2 16:01:54 2019 (r342688) +++ stable/12/sys/dev/drm2/radeon/radeon_irq.c Wed Jan 2 16:11:02 2019 (r342689) @@ -221,41 +221,6 @@ irqreturn_t radeon_driver_irq_handler(DRM_IRQ_ARGS) return IRQ_HANDLED; } -static int radeon_emit_irq(struct drm_device * dev) -{ - drm_radeon_private_t *dev_priv = dev->dev_private; - unsigned int ret; - RING_LOCALS; - - atomic_inc(&dev_priv->swi_emitted); - ret = atomic_read(&dev_priv->swi_emitted); - - BEGIN_RING(4); - OUT_RING_REG(RADEON_LAST_SWI_REG, ret); - OUT_RING_REG(RADEON_GEN_INT_STATUS, RADEON_SW_INT_FIRE); - ADVANCE_RING(); - COMMIT_RING(); - - return ret; -} - -static int radeon_wait_irq(struct drm_device * dev, int swi_nr) -{ - drm_radeon_private_t *dev_priv = - (drm_radeon_private_t *) dev->dev_private; - int ret = 0; - - if (RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr) - return 0; - - dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; - - DRM_WAIT_ON(ret, dev_priv->swi_queue, 3 * DRM_HZ, - RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr); - - return ret; -} - u32 radeon_get_vblank_counter(struct drm_device *dev, int crtc) { drm_radeon_private_t *dev_priv = dev->dev_private; @@ -281,52 +246,6 @@ u32 radeon_get_vblank_counter(struct drm_device *dev, else return RADEON_READ(RADEON_CRTC2_CRNT_FRAME); } -} - -/* Needs the lock as it touches the ring. - */ -int radeon_irq_emit(struct drm_device *dev, void *data, struct drm_file *file_priv) -{ - drm_radeon_private_t *dev_priv = dev->dev_private; - drm_radeon_irq_emit_t *emit = data; - int result; - - if (!dev_priv) { - DRM_ERROR("called with no initialization\n"); - return -EINVAL; - } - - if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) - return -EINVAL; - - LOCK_TEST_WITH_RETURN(dev, file_priv); - - result = radeon_emit_irq(dev); - - if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) { - DRM_ERROR("copy_to_user\n"); - return -EFAULT; - } - - return 0; -} - -/* Doesn't need the hardware lock. - */ -int radeon_irq_wait(struct drm_device *dev, void *data, struct drm_file *file_priv) -{ - drm_radeon_private_t *dev_priv = dev->dev_private; - drm_radeon_irq_wait_t *irqwait = data; - - if (!dev_priv) { - DRM_ERROR("called with no initialization\n"); - return -EINVAL; - } - - if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) - return -EINVAL; - - return radeon_wait_irq(dev, irqwait->irq_seq); } /* drm_dma.h hooks Modified: stable/12/sys/modules/drm2/radeonkms/Makefile ============================================================================== --- stable/12/sys/modules/drm2/radeonkms/Makefile Wed Jan 2 16:01:54 2019 (r342688) +++ stable/12/sys/modules/drm2/radeonkms/Makefile Wed Jan 2 16:11:02 2019 (r342689) @@ -25,7 +25,6 @@ SRCS += \ radeon_clocks.c \ radeon_combios.c \ radeon_connectors.c \ - radeon_cp.c \ radeon_cs.c \ radeon_cursor.c \ radeon_device.c \ @@ -50,7 +49,6 @@ SRCS += \ radeon_ring.c \ radeon_sa.c \ radeon_semaphore.c \ - radeon_state.c \ radeon_test.c \ radeon_ttm.c \ atom.c \ @@ -61,7 +59,6 @@ SRCS += \ r100.c \ r200.c \ r300.c \ - r300_cmdbuf.c \ r420.c \ rs400.c \ rs600.c \ @@ -70,10 +67,8 @@ SRCS += \ r520.c \ r600.c \ r600_audio.c \ - r600_blit.c \ r600_blit_kms.c \ r600_blit_shaders.c \ - r600_cp.c \ r600_cs.c \ r600_hdmi.c \ rv770.c \ @@ -92,10 +87,6 @@ radeon_acpi= radeon_acpi.c #radeon_atpx_handler= radeon_atpx_handler.c .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" -radeon_ioc32= radeon_ioc32.c -.endif - #radeon_prime.c #--radeon_trace_points.c @@ -115,7 +106,5 @@ SRCS += \ CFLAGS+= -I${SRCTOP}/sys/dev/drm2/radeon -CWARNFLAGS.radeon_cp.c= -Wno-unused-value -CWARNFLAGS.r600_cp.c= -Wno-unused-value CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} From owner-svn-src-all@freebsd.org Wed Jan 2 16:22:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF3DA1427092; Wed, 2 Jan 2019 16:22:33 +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 93F1B94141; Wed, 2 Jan 2019 16:22:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 872DFC36F; Wed, 2 Jan 2019 16:22:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02GMXLD082187; Wed, 2 Jan 2019 16:22:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02GMXpE082186; Wed, 2 Jan 2019 16:22:33 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201901021622.x02GMXpE082186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 2 Jan 2019 16:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342690 - head/release/i386 X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/i386 X-SVN-Commit-Revision: 342690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 93F1B94141 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 16:22:34 -0000 Author: gjb Date: Wed Jan 2 16:22:33 2019 New Revision: 342690 URL: https://svnweb.freebsd.org/changeset/base/342690 Log: Escape a new line following r342283. Sponsored by: The FreeBSD Foundation Modified: head/release/i386/make-memstick.sh Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Wed Jan 2 16:11:02 2019 (r342689) +++ head/release/i386/make-memstick.sh Wed Jan 2 16:22:33 2019 (r342690) @@ -45,7 +45,7 @@ make_esp_file ${espfilename} ${fat32min} ${1}/boot/loa mkimg -s mbr \ -b ${1}/boot/mbr \ - -p efi:=${espfilename} + -p efi:=${espfilename} \ -p freebsd:-"mkimg -s bsd -b ${1}/boot/boot -p freebsd-ufs:=${2}.part" \ -o ${2} rm ${espfilename} From owner-svn-src-all@freebsd.org Wed Jan 2 16:28:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E567214272CC; Wed, 2 Jan 2019 16:28:57 +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 85F9B94415; Wed, 2 Jan 2019 16:28:57 +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 69EA7C378; Wed, 2 Jan 2019 16:28:57 +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 x02GSvfx082590; Wed, 2 Jan 2019 16:28:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02GSuY3082587; Wed, 2 Jan 2019 16:28:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021628.x02GSuY3082587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 16:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342691 - in stable/11/sys: dev/drm2/radeon modules/drm2/radeonkms X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys: dev/drm2/radeon modules/drm2/radeonkms X-SVN-Commit-Revision: 342691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 85F9B94415 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)[-0.998,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: Wed, 02 Jan 2019 16:28:58 -0000 Author: markj Date: Wed Jan 2 16:28:56 2019 New Revision: 342691 URL: https://svnweb.freebsd.org/changeset/base/342691 Log: MFC r342182: Remove UMS support code from radeonkms. Deleted: stable/11/sys/dev/drm2/radeon/r300_cmdbuf.c stable/11/sys/dev/drm2/radeon/r600_blit.c stable/11/sys/dev/drm2/radeon/r600_cp.c stable/11/sys/dev/drm2/radeon/radeon_cp.c stable/11/sys/dev/drm2/radeon/radeon_ioc32.c stable/11/sys/dev/drm2/radeon/radeon_state.c Modified: stable/11/sys/dev/drm2/radeon/r600_blit_kms.c stable/11/sys/dev/drm2/radeon/r600_cs.c stable/11/sys/dev/drm2/radeon/radeon_irq.c stable/11/sys/modules/drm2/radeonkms/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/drm2/radeon/r600_blit_kms.c ============================================================================== --- stable/11/sys/dev/drm2/radeon/r600_blit_kms.c Wed Jan 2 16:22:33 2019 (r342690) +++ stable/11/sys/dev/drm2/radeon/r600_blit_kms.c Wed Jan 2 16:28:56 2019 (r342691) @@ -35,6 +35,39 @@ __FBSDID("$FreeBSD$"); #include "r600_blit_shaders.h" #include "radeon_blit_common.h" +/* 23 bits of float fractional data */ +#define I2F_FRAC_BITS 23 +#define I2F_MASK ((1 << I2F_FRAC_BITS) - 1) + +/* + * Converts unsigned integer into 32-bit IEEE floating point representation. + * Will be exact from 0 to 2^24. Above that, we round towards zero + * as the fractional bits will not fit in a float. (It would be better to + * round towards even as the fpu does, but that is slower.) + * + * Moved from r600_blit.c after that file was removed. + */ +__pure uint32_t int2float(uint32_t x) +{ + uint32_t msb, exponent, fraction; + + /* Zero is special */ + if (!x) return 0; + + /* Get location of the most significant bit */ + msb = fls(x); + + /* + * Use a rotate instead of a shift because that works both leftwards + * and rightwards due to the mod(32) behaviour. This means we don't + * need to check to see if we are above 2^24 or not. + */ + fraction = ror32(x, (msb - I2F_FRAC_BITS) & 0x1f) & I2F_MASK; + exponent = (127 + msb) << I2F_FRAC_BITS; + + return fraction + exponent; +} + /* emits 21 on rv770+, 23 on r600 */ static void set_render_target(struct radeon_device *rdev, int format, Modified: stable/11/sys/dev/drm2/radeon/r600_cs.c ============================================================================== --- stable/11/sys/dev/drm2/radeon/r600_cs.c Wed Jan 2 16:22:33 2019 (r342690) +++ stable/11/sys/dev/drm2/radeon/r600_cs.c Wed Jan 2 16:28:56 2019 (r342691) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); static int r600_cs_packet_next_reloc_mm(struct radeon_cs_parser *p, struct radeon_cs_reloc **cs_reloc); -static int r600_cs_packet_next_reloc_nomm(struct radeon_cs_parser *p, - struct radeon_cs_reloc **cs_reloc); typedef int (*next_reloc_t)(struct radeon_cs_parser*, struct radeon_cs_reloc**); static next_reloc_t r600_cs_packet_next_reloc = &r600_cs_packet_next_reloc_mm; #ifdef FREEBSD_WIP /* FreeBSD: to please GCC 4.2. */ @@ -885,53 +883,6 @@ static int r600_cs_packet_next_reloc_mm(struct radeon_ } /** - * r600_cs_packet_next_reloc_nomm() - parse next packet which should be reloc packet3 - * @parser: parser structure holding parsing context. - * @data: pointer to relocation data - * @offset_start: starting offset - * @offset_mask: offset mask (to align start offset on) - * @reloc: reloc informations - * - * Check next packet is relocation packet3, do bo validation and compute - * GPU offset using the provided start. - **/ -static int r600_cs_packet_next_reloc_nomm(struct radeon_cs_parser *p, - struct radeon_cs_reloc **cs_reloc) -{ - struct radeon_cs_chunk *relocs_chunk; - struct radeon_cs_packet p3reloc; - unsigned idx; - int r; - - if (p->chunk_relocs_idx == -1) { - DRM_ERROR("No relocation chunk !\n"); - return -EINVAL; - } - *cs_reloc = NULL; - relocs_chunk = &p->chunks[p->chunk_relocs_idx]; - r = r600_cs_packet_parse(p, &p3reloc, p->idx); - if (r) { - return r; - } - p->idx += p3reloc.count + 2; - if (p3reloc.type != PACKET_TYPE3 || p3reloc.opcode != PACKET3_NOP) { - DRM_ERROR("No packet3 for relocation for packet at %d.\n", - p3reloc.idx); - return -EINVAL; - } - idx = radeon_get_ib_value(p, p3reloc.idx + 1); - if (idx >= relocs_chunk->length_dw) { - DRM_ERROR("Relocs at %d after relocations chunk end %d !\n", - idx, relocs_chunk->length_dw); - return -EINVAL; - } - *cs_reloc = p->relocs; - (*cs_reloc)->lobj.gpu_offset = (u64)relocs_chunk->kdata[idx + 3] << 32; - (*cs_reloc)->lobj.gpu_offset |= relocs_chunk->kdata[idx + 0]; - return 0; -} - -/** * r600_cs_packet_next_is_pkt3_nop() - test if next packet is packet3 nop for reloc * @parser: parser structure holding parsing context. * @@ -2456,105 +2407,6 @@ int r600_cs_parse(struct radeon_cs_parser *p) free(p->track, DRM_MEM_DRIVER); p->track = NULL; return 0; -} - -static int r600_cs_parser_relocs_legacy(struct radeon_cs_parser *p) -{ - if (p->chunk_relocs_idx == -1) { - return 0; - } - p->relocs = malloc(sizeof(struct radeon_cs_reloc), - DRM_MEM_DRIVER, M_NOWAIT | M_ZERO); - if (p->relocs == NULL) { - return -ENOMEM; - } - return 0; -} - -/** - * cs_parser_fini() - clean parser states - * @parser: parser structure holding parsing context. - * @error: error number - * - * If error is set than unvalidate buffer, otherwise just free memory - * used by parsing context. - **/ -static void r600_cs_parser_fini(struct radeon_cs_parser *parser, int error) -{ - unsigned i; - - free(parser->relocs, DRM_MEM_DRIVER); - for (i = 0; i < parser->nchunks; i++) { - free(parser->chunks[i].kdata, DRM_MEM_DRIVER); - if (parser->rdev && (parser->rdev->flags & RADEON_IS_AGP)) { - free(parser->chunks[i].kpage[0], DRM_MEM_DRIVER); - free(parser->chunks[i].kpage[1], DRM_MEM_DRIVER); - } - } - free(parser->chunks, DRM_MEM_DRIVER); - free(parser->chunks_array, DRM_MEM_DRIVER); - free(parser->track, DRM_MEM_DRIVER); -} - -int r600_cs_legacy(struct drm_device *dev, void *data, struct drm_file *filp, - unsigned family, u32 *ib, int *l) -{ - struct radeon_cs_parser parser; - struct radeon_cs_chunk *ib_chunk; - struct r600_cs_track *track; - int r; - - /* initialize tracker */ - track = malloc(sizeof(*track), DRM_MEM_DRIVER, M_NOWAIT | M_ZERO); - if (track == NULL) - return -ENOMEM; - r600_cs_track_init(track); - r600_cs_legacy_get_tiling_conf(dev, &track->npipes, &track->nbanks, &track->group_size); - /* initialize parser */ - memset(&parser, 0, sizeof(struct radeon_cs_parser)); - parser.filp = filp; - parser.dev = dev->dev; - parser.rdev = NULL; - parser.family = family; - parser.track = track; - parser.ib.ptr = ib; - r = radeon_cs_parser_init(&parser, data); - if (r) { - DRM_ERROR("Failed to initialize parser !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - r = r600_cs_parser_relocs_legacy(&parser); - if (r) { - DRM_ERROR("Failed to parse relocation !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - /* Copy the packet into the IB, the parser will read from the - * input memory (cached) and write to the IB (which can be - * uncached). */ - ib_chunk = &parser.chunks[parser.chunk_ib_idx]; - parser.ib.length_dw = ib_chunk->length_dw; - *l = parser.ib.length_dw; - r = r600_cs_parse(&parser); - if (r) { - DRM_ERROR("Invalid command stream !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - r = radeon_cs_finish_pages(&parser); - if (r) { - DRM_ERROR("Invalid command stream !\n"); - r600_cs_parser_fini(&parser, r); - return r; - } - r600_cs_parser_fini(&parser, r); - return r; -} - -void r600_cs_legacy_init(void) -{ - r600_cs_packet_next_reloc = &r600_cs_packet_next_reloc_nomm; } /* Modified: stable/11/sys/dev/drm2/radeon/radeon_irq.c ============================================================================== --- stable/11/sys/dev/drm2/radeon/radeon_irq.c Wed Jan 2 16:22:33 2019 (r342690) +++ stable/11/sys/dev/drm2/radeon/radeon_irq.c Wed Jan 2 16:28:56 2019 (r342691) @@ -221,41 +221,6 @@ irqreturn_t radeon_driver_irq_handler(DRM_IRQ_ARGS) return IRQ_HANDLED; } -static int radeon_emit_irq(struct drm_device * dev) -{ - drm_radeon_private_t *dev_priv = dev->dev_private; - unsigned int ret; - RING_LOCALS; - - atomic_inc(&dev_priv->swi_emitted); - ret = atomic_read(&dev_priv->swi_emitted); - - BEGIN_RING(4); - OUT_RING_REG(RADEON_LAST_SWI_REG, ret); - OUT_RING_REG(RADEON_GEN_INT_STATUS, RADEON_SW_INT_FIRE); - ADVANCE_RING(); - COMMIT_RING(); - - return ret; -} - -static int radeon_wait_irq(struct drm_device * dev, int swi_nr) -{ - drm_radeon_private_t *dev_priv = - (drm_radeon_private_t *) dev->dev_private; - int ret = 0; - - if (RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr) - return 0; - - dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; - - DRM_WAIT_ON(ret, dev_priv->swi_queue, 3 * DRM_HZ, - RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr); - - return ret; -} - u32 radeon_get_vblank_counter(struct drm_device *dev, int crtc) { drm_radeon_private_t *dev_priv = dev->dev_private; @@ -281,52 +246,6 @@ u32 radeon_get_vblank_counter(struct drm_device *dev, else return RADEON_READ(RADEON_CRTC2_CRNT_FRAME); } -} - -/* Needs the lock as it touches the ring. - */ -int radeon_irq_emit(struct drm_device *dev, void *data, struct drm_file *file_priv) -{ - drm_radeon_private_t *dev_priv = dev->dev_private; - drm_radeon_irq_emit_t *emit = data; - int result; - - if (!dev_priv) { - DRM_ERROR("called with no initialization\n"); - return -EINVAL; - } - - if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) - return -EINVAL; - - LOCK_TEST_WITH_RETURN(dev, file_priv); - - result = radeon_emit_irq(dev); - - if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) { - DRM_ERROR("copy_to_user\n"); - return -EFAULT; - } - - return 0; -} - -/* Doesn't need the hardware lock. - */ -int radeon_irq_wait(struct drm_device *dev, void *data, struct drm_file *file_priv) -{ - drm_radeon_private_t *dev_priv = dev->dev_private; - drm_radeon_irq_wait_t *irqwait = data; - - if (!dev_priv) { - DRM_ERROR("called with no initialization\n"); - return -EINVAL; - } - - if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) - return -EINVAL; - - return radeon_wait_irq(dev, irqwait->irq_seq); } /* drm_dma.h hooks Modified: stable/11/sys/modules/drm2/radeonkms/Makefile ============================================================================== --- stable/11/sys/modules/drm2/radeonkms/Makefile Wed Jan 2 16:22:33 2019 (r342690) +++ stable/11/sys/modules/drm2/radeonkms/Makefile Wed Jan 2 16:28:56 2019 (r342691) @@ -25,7 +25,6 @@ SRCS += \ radeon_clocks.c \ radeon_combios.c \ radeon_connectors.c \ - radeon_cp.c \ radeon_cs.c \ radeon_cursor.c \ radeon_device.c \ @@ -50,7 +49,6 @@ SRCS += \ radeon_ring.c \ radeon_sa.c \ radeon_semaphore.c \ - radeon_state.c \ radeon_test.c \ radeon_ttm.c \ atom.c \ @@ -61,7 +59,6 @@ SRCS += \ r100.c \ r200.c \ r300.c \ - r300_cmdbuf.c \ r420.c \ rs400.c \ rs600.c \ @@ -70,10 +67,8 @@ SRCS += \ r520.c \ r600.c \ r600_audio.c \ - r600_blit.c \ r600_blit_kms.c \ r600_blit_shaders.c \ - r600_cp.c \ r600_cs.c \ r600_hdmi.c \ rv770.c \ @@ -92,10 +87,6 @@ radeon_acpi= radeon_acpi.c #radeon_atpx_handler= radeon_atpx_handler.c .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" -radeon_ioc32= radeon_ioc32.c -.endif - #radeon_prime.c #--radeon_trace_points.c @@ -116,6 +107,4 @@ SRCS += \ CFLAGS+= -I${SRCTOP}/sys/dev/drm2/radeon -CWARNFLAGS.radeon_cp.c= -Wno-unused-value -CWARNFLAGS.r600_cp.c= -Wno-unused-value CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-all@freebsd.org Wed Jan 2 16:33:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FED51427587; Wed, 2 Jan 2019 16:33: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 D280394865; Wed, 2 Jan 2019 16:33:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5197C51F; Wed, 2 Jan 2019 16:33:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02GXHVo087365; Wed, 2 Jan 2019 16:33:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02GXHOl087364; Wed, 2 Jan 2019 16:33:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021633.x02GXHOl087364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 16:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342692 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 342692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D280394865 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.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 16:33:18 -0000 Author: markj Date: Wed Jan 2 16:33:17 2019 New Revision: 342692 URL: https://svnweb.freebsd.org/changeset/base/342692 Log: MFC r342098: Assume that pmap_l1() will return a PTE. 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 Jan 2 16:28:56 2019 (r342691) +++ stable/12/sys/riscv/riscv/pmap.c Wed Jan 2 16:33:17 2019 (r342692) @@ -316,8 +316,6 @@ pmap_l2(pmap_t pmap, vm_offset_t va) pd_entry_t *l1; l1 = pmap_l1(pmap, va); - if (l1 == NULL) - return (NULL); if ((pmap_load(l1) & PTE_V) == 0) return (NULL); if ((pmap_load(l1) & PTE_RX) != 0) From owner-svn-src-all@freebsd.org Wed Jan 2 16:33:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A4D514275DD; Wed, 2 Jan 2019 16:33: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 B5C3B94983; Wed, 2 Jan 2019 16:33: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 A9C35C520; Wed, 2 Jan 2019 16:33: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 x02GXnr5087444; Wed, 2 Jan 2019 16:33:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02GXnd8087443; Wed, 2 Jan 2019 16:33:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021633.x02GXnd8087443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 16:33: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: r342693 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 342693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B5C3B94983 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)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Jan 2019 16:33:50 -0000 Author: markj Date: Wed Jan 2 16:33:49 2019 New Revision: 342693 URL: https://svnweb.freebsd.org/changeset/base/342693 Log: MFC r342100: Add some more checking to the RISC-V page fault handler. Modified: stable/12/sys/riscv/riscv/trap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/trap.c ============================================================================== --- stable/12/sys/riscv/riscv/trap.c Wed Jan 2 16:33:17 2019 (r342692) +++ stable/12/sys/riscv/riscv/trap.c Wed Jan 2 16:33:49 2019 (r342693) @@ -167,7 +167,7 @@ svc_handler(struct trapframe *frame) } static void -data_abort(struct trapframe *frame, int lower) +data_abort(struct trapframe *frame, int usermode) { struct vm_map *map; uint64_t sbadaddr; @@ -176,9 +176,7 @@ data_abort(struct trapframe *frame, int lower) vm_prot_t ftype; vm_offset_t va; struct proc *p; - int ucode; - int error; - int sig; + int error, sig, ucode; #ifdef KDB if (kdb_active) { @@ -188,19 +186,23 @@ data_abort(struct trapframe *frame, int lower) #endif td = curthread; + p = td->td_proc; pcb = td->td_pcb; sbadaddr = frame->tf_sbadaddr; - p = td->td_proc; + if (td->td_critnest != 0 || td->td_intr_nesting_level != 0 || + WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL, + "Kernel page fault") != 0) + goto fatal; - if (lower) + if (usermode) map = &td->td_proc->p_vmspace->vm_map; + else if (sbadaddr >= VM_MAX_USER_ADDRESS) + map = kernel_map; else { - /* The top bit tells us which range to use */ - if ((sbadaddr >> 63) == 1) - map = kernel_map; - else - map = &td->td_proc->p_vmspace->vm_map; + if (pcb->pcb_onfault == 0) + goto fatal; + map = &td->td_proc->p_vmspace->vm_map; } va = trunc_page(sbadaddr); @@ -239,7 +241,7 @@ data_abort(struct trapframe *frame, int lower) } if (error != KERN_SUCCESS) { - if (lower) { + if (usermode) { sig = SIGSEGV; if (error == KERN_PROTECTION_FAILURE) ucode = SEGV_ACCERR; @@ -247,21 +249,23 @@ data_abort(struct trapframe *frame, int lower) ucode = SEGV_MAPERR; call_trapsignal(td, sig, ucode, (void *)sbadaddr); } else { - if (td->td_intr_nesting_level == 0 && - pcb->pcb_onfault != 0) { + if (pcb->pcb_onfault != 0) { frame->tf_a[0] = error; frame->tf_sepc = pcb->pcb_onfault; return; } - dump_regs(frame); - panic("vm_fault failed: %lx, va 0x%016lx", - frame->tf_sepc, sbadaddr); + goto fatal; } } done: - if (lower) + if (usermode) userret(td, frame); + return; + +fatal: + dump_regs(frame); + panic("Fatal page fault at %#lx: %#016lx", frame->tf_sepc, sbadaddr); } void From owner-svn-src-all@freebsd.org Wed Jan 2 16:34:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1F321427675; Wed, 2 Jan 2019 16:34:37 +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 63BCC94AE9; Wed, 2 Jan 2019 16:34:37 +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 55110C521; Wed, 2 Jan 2019 16:34:37 +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 x02GYb5a087535; Wed, 2 Jan 2019 16:34:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02GYbhY087534; Wed, 2 Jan 2019 16:34:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021634.x02GYbhY087534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 16:34: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: r342694 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 342694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 63BCC94AE9 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.963,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Jan 2019 16:34:37 -0000 Author: markj Date: Wed Jan 2 16:34:36 2019 New Revision: 342694 URL: https://svnweb.freebsd.org/changeset/base/342694 Log: MFC r342099: Avoid needless TLB invalidations in pmap_remove_pages(). 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 Jan 2 16:33:49 2019 (r342693) +++ stable/12/sys/riscv/riscv/pmap.c Wed Jan 2 16:34:36 2019 (r342694) @@ -2754,9 +2754,10 @@ pmap_remove_pages(pmap_t pmap) l3 = pmap_l2_to_l3(l2, pv->pv_va); tl3 = pmap_load(l3); -/* - * We cannot remove wired pages from a process' mapping at this time - */ + /* + * We cannot remove wired pages from a + * process' mapping at this time. + */ if (tl3 & PTE_SW_WIRED) { allfree = 0; continue; @@ -2775,7 +2776,6 @@ pmap_remove_pages(pmap_t pmap) (uintmax_t)tl3)); pmap_load_clear(l3); - pmap_invalidate_page(pmap, pv->pv_va); /* * Update the vm_page_t clean/reference bits. @@ -2804,9 +2804,9 @@ pmap_remove_pages(pmap_t pmap) free_pv_chunk(pc); } } - pmap_invalidate_all(pmap); if (lock != NULL) rw_wunlock(lock); + pmap_invalidate_all(pmap); rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); vm_page_free_pages_toq(&free, false); From owner-svn-src-all@freebsd.org Wed Jan 2 16:36:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10DFD1427934; Wed, 2 Jan 2019 16:36:47 +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 CE51094DCE; Wed, 2 Jan 2019 16:36:46 +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 C2065C524; Wed, 2 Jan 2019 16:36:46 +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 x02GakHn087817; Wed, 2 Jan 2019 16:36:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02GakKj087816; Wed, 2 Jan 2019 16:36:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021636.x02GakKj087816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 16:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342695 - stable/12/sys/riscv/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/conf X-SVN-Commit-Revision: 342695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE51094DCE 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.963,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Jan 2019 16:36:47 -0000 Author: markj Date: Wed Jan 2 16:36:46 2019 New Revision: 342695 URL: https://svnweb.freebsd.org/changeset/base/342695 Log: MFC r342097: Add a QEMU config for RISC-V. Added: stable/12/sys/riscv/conf/QEMU - copied unchanged from r342097, head/sys/riscv/conf/QEMU Modified: Directory Properties: stable/12/ (props changed) Copied: stable/12/sys/riscv/conf/QEMU (from r342097, head/sys/riscv/conf/QEMU) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/riscv/conf/QEMU Wed Jan 2 16:36:46 2019 (r342695, copy of r342097, head/sys/riscv/conf/QEMU) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +#NO_UNIVERSE + +include "GENERIC" + +ident QEMU + +options ROOTDEVNAME=\"ufs:/dev/vtbd0\" From owner-svn-src-all@freebsd.org Wed Jan 2 16:40:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B9571427D73; Wed, 2 Jan 2019 16:40:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2EDD95311; Wed, 2 Jan 2019 16:40:55 +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 429BFC64D; Wed, 2 Jan 2019 16:40:55 +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 x02Get0F088286; Wed, 2 Jan 2019 16:40:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02GetAa088285; Wed, 2 Jan 2019 16:40:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021640.x02GetAa088285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 16:40:55 +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: r342696 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 342696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2EDD95311 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)[-0.998,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: Wed, 02 Jan 2019 16:40:56 -0000 Author: markj Date: Wed Jan 2 16:40:54 2019 New Revision: 342696 URL: https://svnweb.freebsd.org/changeset/base/342696 Log: MFC r342093: Clean up the riscv pmap_bootstrap() implementation. PR: 231515 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 Jan 2 16:36:46 2019 (r342695) +++ stable/12/sys/riscv/riscv/pmap.c Wed Jan 2 16:40:54 2019 (r342696) @@ -211,7 +211,7 @@ __FBSDID("$FreeBSD$"); /* The list of all the user pmaps */ LIST_HEAD(pmaplist, pmap); -static struct pmaplist allpmaps; +static struct pmaplist allpmaps = LIST_HEAD_INITIALIZER(); struct pmap kernel_pmap_store; @@ -506,17 +506,12 @@ pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm void pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) { - u_int l1_slot, l2_slot, avail_slot, map_slot, used_map_slot; - uint64_t kern_delta; - pt_entry_t *l2; - vm_offset_t va, freemempos; + u_int l1_slot, l2_slot, avail_slot, map_slot; + vm_offset_t freemempos; vm_offset_t dpcpu, msgbufpv; - vm_paddr_t pa, min_pa, max_pa; + vm_paddr_t end, max_pa, min_pa, pa, start; int i; - kern_delta = KERNBASE - kernstart; - physmem = 0; - printf("pmap_bootstrap %lx %lx %lx\n", l1pt, kernstart, kernlen); printf("%lx\n", l1pt); printf("%lx\n", (KERNBASE >> L1_SHIFT) & Ln_ADDR_MASK); @@ -525,21 +520,16 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, kernel_pmap_store.pm_l1 = (pd_entry_t *)l1pt; PMAP_LOCK_INIT(kernel_pmap); - /* - * Initialize the global pv list lock. - */ rw_init(&pvh_global_lock, "pmap pv global"); - LIST_INIT(&allpmaps); + /* Assume the address we were loaded to is a valid physical address. */ + min_pa = max_pa = kernstart; - /* Assume the address we were loaded to is a valid physical address */ - min_pa = max_pa = KERNBASE - kern_delta; - /* * Find the minimum physical address. physmap is sorted, * but may contain empty ranges. */ - for (i = 0; i < (physmap_idx * 2); i += 2) { + for (i = 0; i < physmap_idx * 2; i += 2) { if (physmap[i] == physmap[i + 1]) continue; if (physmap[i] <= min_pa) @@ -554,67 +544,18 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, /* Create a direct map region early so we can use it for pa -> va */ pmap_bootstrap_dmap(l1pt, min_pa, max_pa); - va = KERNBASE; - pa = KERNBASE - kern_delta; - /* - * Start to initialize phys_avail by copying from physmap - * up to the physical address KERNBASE points at. - */ - map_slot = avail_slot = 0; - for (; map_slot < (physmap_idx * 2); map_slot += 2) { - if (physmap[map_slot] == physmap[map_slot + 1]) - continue; - - if (physmap[map_slot] <= pa && - physmap[map_slot + 1] > pa) - break; - - phys_avail[avail_slot] = physmap[map_slot]; - phys_avail[avail_slot + 1] = physmap[map_slot + 1]; - physmem += (phys_avail[avail_slot + 1] - - phys_avail[avail_slot]) >> PAGE_SHIFT; - avail_slot += 2; - } - - /* Add the memory before the kernel */ - if (physmap[avail_slot] < pa) { - phys_avail[avail_slot] = physmap[map_slot]; - phys_avail[avail_slot + 1] = pa; - physmem += (phys_avail[avail_slot + 1] - - phys_avail[avail_slot]) >> PAGE_SHIFT; - avail_slot += 2; - } - used_map_slot = map_slot; - - /* * Read the page table to find out what is already mapped. * This assumes we have mapped a block of memory from KERNBASE * using a single L1 entry. */ - l2 = pmap_early_page_idx(l1pt, KERNBASE, &l1_slot, &l2_slot); + (void)pmap_early_page_idx(l1pt, KERNBASE, &l1_slot, &l2_slot); /* Sanity check the index, KERNBASE should be the first VA */ KASSERT(l2_slot == 0, ("The L2 index is non-zero")); - /* Find how many pages we have mapped */ - for (; l2_slot < Ln_ENTRIES; l2_slot++) { - if ((l2[l2_slot] & PTE_V) == 0) - break; + freemempos = roundup2(KERNBASE + kernlen, PAGE_SIZE); - /* Check locore used L2 superpages */ - KASSERT((l2[l2_slot] & PTE_RX) != 0, - ("Invalid bootstrap L2 table")); - - va += L2_SIZE; - pa += L2_SIZE; - } - - va = roundup2(va, L2_SIZE); - - freemempos = KERNBASE + kernlen; - freemempos = roundup2(freemempos, PAGE_SIZE); - /* Create the l3 tables for the early devmap */ freemempos = pmap_bootstrap_l3(l1pt, VM_MAX_KERNEL_ADDRESS - L2_SIZE, freemempos); @@ -640,31 +581,32 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, pa = pmap_early_vtophys(l1pt, freemempos); - /* Finish initialising physmap */ - map_slot = used_map_slot; - for (; avail_slot < (PHYS_AVAIL_SIZE - 2) && - map_slot < (physmap_idx * 2); map_slot += 2) { - if (physmap[map_slot] == physmap[map_slot + 1]) { - continue; - } + /* Initialize phys_avail. */ + for (avail_slot = map_slot = physmem = 0; map_slot < physmap_idx * 2; + map_slot += 2) { + start = physmap[map_slot]; + end = physmap[map_slot + 1]; - /* Have we used the current range? */ - if (physmap[map_slot + 1] <= pa) { + if (start == end) continue; - } + if (start >= kernstart && end <= pa) + continue; - /* Do we need to split the entry? */ - if (physmap[map_slot] < pa) { + if (start < kernstart && end > kernstart) + end = kernstart; + else if (start < pa && end > pa) + start = pa; + phys_avail[avail_slot] = start; + phys_avail[avail_slot + 1] = end; + physmem += (end - start) >> PAGE_SHIFT; + avail_slot += 2; + + if (end != physmap[map_slot + 1] && end > pa) { phys_avail[avail_slot] = pa; phys_avail[avail_slot + 1] = physmap[map_slot + 1]; - } else { - phys_avail[avail_slot] = physmap[map_slot]; - phys_avail[avail_slot + 1] = physmap[map_slot + 1]; + physmem += (physmap[map_slot + 1] - pa) >> PAGE_SHIFT; + avail_slot += 2; } - physmem += (phys_avail[avail_slot + 1] - - phys_avail[avail_slot]) >> PAGE_SHIFT; - - avail_slot += 2; } phys_avail[avail_slot] = 0; phys_avail[avail_slot + 1] = 0; From owner-svn-src-all@freebsd.org Wed Jan 2 16:41:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79BE31427E4A; Wed, 2 Jan 2019 16:41:41 +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 D16BC954FA; Wed, 2 Jan 2019 16:41:40 +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 A9FF5C68A; Wed, 2 Jan 2019 16:41:40 +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 x02GfeXZ089914; Wed, 2 Jan 2019 16:41:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02GfdEE089908; Wed, 2 Jan 2019 16:41:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021641.x02GfdEE089908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 16:41: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: r342697 - in stable/12/sys/riscv: include riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys/riscv: include riscv X-SVN-Commit-Revision: 342697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D16BC954FA 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)[-0.998,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: Wed, 02 Jan 2019 16:41:41 -0000 Author: markj Date: Wed Jan 2 16:41:39 2019 New Revision: 342697 URL: https://svnweb.freebsd.org/changeset/base/342697 Log: MFC r342223: Replace uses of sbadaddr with stval. Modified: stable/12/sys/riscv/include/frame.h stable/12/sys/riscv/riscv/db_interface.c stable/12/sys/riscv/riscv/exception.S stable/12/sys/riscv/riscv/genassym.c stable/12/sys/riscv/riscv/trap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/include/frame.h ============================================================================== --- stable/12/sys/riscv/include/frame.h Wed Jan 2 16:40:54 2019 (r342696) +++ stable/12/sys/riscv/include/frame.h Wed Jan 2 16:41:39 2019 (r342697) @@ -55,7 +55,7 @@ struct trapframe { uint64_t tf_a[8]; uint64_t tf_sepc; uint64_t tf_sstatus; - uint64_t tf_sbadaddr; + uint64_t tf_stval; uint64_t tf_scause; }; Modified: stable/12/sys/riscv/riscv/db_interface.c ============================================================================== --- stable/12/sys/riscv/riscv/db_interface.c Wed Jan 2 16:40:54 2019 (r342696) +++ stable/12/sys/riscv/riscv/db_interface.c Wed Jan 2 16:41:39 2019 (r342697) @@ -98,7 +98,7 @@ struct db_variable db_regs[] = { { "a7", DB_OFFSET(tf_a[7]), db_frame }, { "sepc", DB_OFFSET(tf_sepc), db_frame }, { "sstatus", DB_OFFSET(tf_sstatus), db_frame }, - { "sbadaddr", DB_OFFSET(tf_sbadaddr), db_frame }, + { "stval", DB_OFFSET(tf_stval), db_frame }, { "scause", DB_OFFSET(tf_scause), db_frame }, }; Modified: stable/12/sys/riscv/riscv/exception.S ============================================================================== --- stable/12/sys/riscv/riscv/exception.S Wed Jan 2 16:40:54 2019 (r342696) +++ stable/12/sys/riscv/riscv/exception.S Wed Jan 2 16:41:39 2019 (r342697) @@ -107,8 +107,8 @@ __FBSDID("$FreeBSD$"); sd t0, (TF_SEPC)(sp) csrr t0, sstatus sd t0, (TF_SSTATUS)(sp) - csrr t0, sbadaddr - sd t0, (TF_SBADADDR)(sp) + csrr t0, stval + sd t0, (TF_STVAL)(sp) csrr t0, scause sd t0, (TF_SCAUSE)(sp) .endm Modified: stable/12/sys/riscv/riscv/genassym.c ============================================================================== --- stable/12/sys/riscv/riscv/genassym.c Wed Jan 2 16:40:54 2019 (r342696) +++ stable/12/sys/riscv/riscv/genassym.c Wed Jan 2 16:41:39 2019 (r342697) @@ -96,6 +96,6 @@ ASSYM(TF_T, offsetof(struct trapframe, tf_t)); ASSYM(TF_S, offsetof(struct trapframe, tf_s)); ASSYM(TF_A, offsetof(struct trapframe, tf_a)); ASSYM(TF_SEPC, offsetof(struct trapframe, tf_sepc)); -ASSYM(TF_SBADADDR, offsetof(struct trapframe, tf_sbadaddr)); +ASSYM(TF_STVAL, offsetof(struct trapframe, tf_stval)); ASSYM(TF_SCAUSE, offsetof(struct trapframe, tf_scause)); ASSYM(TF_SSTATUS, offsetof(struct trapframe, tf_sstatus)); Modified: stable/12/sys/riscv/riscv/trap.c ============================================================================== --- stable/12/sys/riscv/riscv/trap.c Wed Jan 2 16:40:54 2019 (r342696) +++ stable/12/sys/riscv/riscv/trap.c Wed Jan 2 16:41:39 2019 (r342697) @@ -170,7 +170,7 @@ static void data_abort(struct trapframe *frame, int usermode) { struct vm_map *map; - uint64_t sbadaddr; + uint64_t stval; struct thread *td; struct pcb *pcb; vm_prot_t ftype; @@ -188,7 +188,7 @@ data_abort(struct trapframe *frame, int usermode) td = curthread; p = td->td_proc; pcb = td->td_pcb; - sbadaddr = frame->tf_sbadaddr; + stval = frame->tf_stval; if (td->td_critnest != 0 || td->td_intr_nesting_level != 0 || WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL, @@ -197,7 +197,7 @@ data_abort(struct trapframe *frame, int usermode) if (usermode) map = &td->td_proc->p_vmspace->vm_map; - else if (sbadaddr >= VM_MAX_USER_ADDRESS) + else if (stval >= VM_MAX_USER_ADDRESS) map = kernel_map; else { if (pcb->pcb_onfault == 0) @@ -205,7 +205,7 @@ data_abort(struct trapframe *frame, int usermode) map = &td->td_proc->p_vmspace->vm_map; } - va = trunc_page(sbadaddr); + va = trunc_page(stval); if ((frame->tf_scause == EXCP_FAULT_STORE) || (frame->tf_scause == EXCP_STORE_PAGE_FAULT)) { @@ -247,7 +247,7 @@ data_abort(struct trapframe *frame, int usermode) ucode = SEGV_ACCERR; else ucode = SEGV_MAPERR; - call_trapsignal(td, sig, ucode, (void *)sbadaddr); + call_trapsignal(td, sig, ucode, (void *)stval); } else { if (pcb->pcb_onfault != 0) { frame->tf_a[0] = error; @@ -265,7 +265,7 @@ done: fatal: dump_regs(frame); - panic("Fatal page fault at %#lx: %#016lx", frame->tf_sepc, sbadaddr); + panic("Fatal page fault at %#lx: %#016lx", frame->tf_sepc, stval); } void @@ -322,8 +322,8 @@ do_trap_supervisor(struct trapframe *frame) break; default: dump_regs(frame); - panic("Unknown kernel exception %x badaddr %lx\n", - exception, frame->tf_sbadaddr); + panic("Unknown kernel exception %x trap value %lx\n", + exception, frame->tf_stval); } } @@ -390,7 +390,7 @@ do_trap_user(struct trapframe *frame) break; default: dump_regs(frame); - panic("Unknown userland exception %x, badaddr %lx\n", - exception, frame->tf_sbadaddr); + panic("Unknown userland exception %x, trap value %lx\n", + exception, frame->tf_stval); } } From owner-svn-src-all@freebsd.org Wed Jan 2 16:42:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4561F1429049; Wed, 2 Jan 2019 16:42: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 E0E9995696; Wed, 2 Jan 2019 16:42:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C533FC6B0; Wed, 2 Jan 2019 16:42: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 x02Gg7UV090947; Wed, 2 Jan 2019 16:42:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02Gg7ts090946; Wed, 2 Jan 2019 16:42:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021642.x02Gg7ts090946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 16:42: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: r342698 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 342698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E0E9995696 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.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 16:42:08 -0000 Author: markj Date: Wed Jan 2 16:42:07 2019 New Revision: 342698 URL: https://svnweb.freebsd.org/changeset/base/342698 Log: MFC r342221: Implement cpu_halt() for RISC-V. Modified: stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Wed Jan 2 16:41:39 2019 (r342697) +++ stable/12/sys/riscv/riscv/machdep.c Wed Jan 2 16:42:07 2019 (r342698) @@ -427,7 +427,9 @@ void cpu_halt(void) { - panic("cpu_halt"); + intr_disable(); + for (;;) + __asm __volatile("wfi"); } /* From owner-svn-src-all@freebsd.org Wed Jan 2 17:09:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E1971429AA1; Wed, 2 Jan 2019 17:09:36 +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 E2383964A5; Wed, 2 Jan 2019 17:09: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 D5A9ECA88; Wed, 2 Jan 2019 17:09: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 x02H9ZLk004187; Wed, 2 Jan 2019 17:09:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02H9ZPM004185; Wed, 2 Jan 2019 17:09:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021709.x02H9ZPM004185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 17:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342699 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 342699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2383964A5 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)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 17:09:36 -0000 Author: markj Date: Wed Jan 2 17:09:35 2019 New Revision: 342699 URL: https://svnweb.freebsd.org/changeset/base/342699 Log: Capsicumize savecore(8). - Use cap_fileargs(3) to open dump devices after entering capability mode, and use cap_syslog(3) to log messages. - Use a relative directory fd to open output files. - Use zdopen(3) to compress kernel dumps in capability mode. Reviewed by: cem, oshogbo MFC after: 2 months Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18458 Modified: head/sbin/savecore/Makefile head/sbin/savecore/savecore.c Modified: head/sbin/savecore/Makefile ============================================================================== --- head/sbin/savecore/Makefile Wed Jan 2 16:42:07 2019 (r342698) +++ head/sbin/savecore/Makefile Wed Jan 2 17:09:35 2019 (r342699) @@ -6,7 +6,14 @@ VAR_CRASH= /var/crash VAR_CRASH_MODE= 0750 CONFSDIR= VAR_CRASH PROG= savecore -LIBADD= z xo +LIBADD= xo z MAN= savecore.8 + +.include + +.if ${MK_CASPER} != "no" && !defined(RESCUE) +CFLAGS+= -DWITH_CASPER +LIBADD+= casper cap_fileargs cap_syslog +.endif .include Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Wed Jan 2 16:42:07 2019 (r342698) +++ head/sbin/savecore/savecore.c Wed Jan 2 17:09:35 2019 (r342699) @@ -70,6 +70,8 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include #include #include #include @@ -84,6 +86,11 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include +#include +#include + #include /* The size of the buffer used for I/O. */ @@ -93,16 +100,58 @@ __FBSDID("$FreeBSD$"); #define STATUS_GOOD 1 #define STATUS_UNKNOWN 2 +static cap_channel_t *capsyslog; +static fileargs_t *capfa; static int checkfor, compress, clear, force, keep, verbose; /* flags */ static int nfound, nsaved, nerr; /* statistics */ static int maxdumps; -extern FILE *zopen(const char *, const char *); +extern FILE *zdopen(int, const char *); static sig_atomic_t got_siginfo; static void infohandler(int); static void +logmsg(int pri, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + if (capsyslog != NULL) + cap_vsyslog(capsyslog, pri, fmt, ap); + else + vsyslog(pri, fmt, ap); + va_end(ap); +} + +static FILE * +xfopenat(int dirfd, const char *path, int flags, const char *modestr, ...) +{ + va_list ap; + FILE *fp; + mode_t mode; + int error, fd; + + if ((flags & O_CREAT) == O_CREAT) { + va_start(ap, modestr); + mode = (mode_t)va_arg(ap, int); + va_end(ap); + } else + mode = 0; + + fd = openat(dirfd, path, flags, mode); + if (fd < 0) + return (NULL); + fp = fdopen(fd, modestr); + if (fp == NULL) { + error = errno; + (void)close(fd); + errno = error; + } + return (fp); +} + +static void printheader(xo_handle_t *xo, const struct kerneldumpheader *h, const char *device, int bounds, const int status) { @@ -166,7 +215,7 @@ printheader(xo_handle_t *xo, const struct kerneldumphe } static int -getbounds(void) +getbounds(int savedirfd) { FILE *fp; char buf[6]; @@ -181,17 +230,16 @@ getbounds(void) ret = 0; - if ((fp = fopen("bounds", "r")) == NULL) { + if ((fp = xfopenat(savedirfd, "bounds", O_RDONLY, "r")) == NULL) { if (verbose) printf("unable to open bounds file, using 0\n"); return (ret); } - - if (fgets(buf, sizeof buf, fp) == NULL) { + if (fgets(buf, sizeof(buf), fp) == NULL) { if (feof(fp)) - syslog(LOG_WARNING, "bounds file is empty, using 0"); + logmsg(LOG_WARNING, "bounds file is empty, using 0"); else - syslog(LOG_WARNING, "bounds file: %s", strerror(errno)); + logmsg(LOG_WARNING, "bounds file: %s", strerror(errno)); fclose(fp); return (ret); } @@ -199,18 +247,19 @@ getbounds(void) errno = 0; ret = (int)strtol(buf, NULL, 10); if (ret == 0 && (errno == EINVAL || errno == ERANGE)) - syslog(LOG_WARNING, "invalid value found in bounds, using 0"); + logmsg(LOG_WARNING, "invalid value found in bounds, using 0"); fclose(fp); return (ret); } static void -writebounds(int bounds) +writebounds(int savedirfd, int bounds) { FILE *fp; - if ((fp = fopen("bounds", "w")) == NULL) { - syslog(LOG_WARNING, "unable to write to bounds file: %m"); + if ((fp = xfopenat(savedirfd, "bounds", O_WRONLY | O_CREAT | O_TRUNC, + "w", 0644)) < 0) { + logmsg(LOG_WARNING, "unable to write to bounds file: %m"); return; } @@ -222,19 +271,20 @@ writebounds(int bounds) } static bool -writekey(const char *keyname, uint8_t *dumpkey, uint32_t dumpkeysize) +writekey(int savedirfd, const char *keyname, uint8_t *dumpkey, + uint32_t dumpkeysize) { int fd; - fd = open(keyname, O_WRONLY | O_CREAT | O_TRUNC, 0600); + fd = openat(savedirfd, keyname, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (fd == -1) { - syslog(LOG_ERR, "Unable to open %s to write the key: %m.", + logmsg(LOG_ERR, "Unable to open %s to write the key: %m.", keyname); return (false); } if (write(fd, dumpkey, dumpkeysize) != (ssize_t)dumpkeysize) { - syslog(LOG_ERR, "Unable to write the key to %s: %m.", keyname); + logmsg(LOG_ERR, "Unable to write the key to %s: %m.", keyname); close(fd); return (false); } @@ -244,18 +294,18 @@ writekey(const char *keyname, uint8_t *dumpkey, uint32 } static off_t -file_size(const char *path) +file_size(int savedirfd, const char *path) { struct stat sb; - /* Ignore all errors, those file may not exists. */ - if (stat(path, &sb) == -1) + /* Ignore all errors, this file may not exist. */ + if (fstatat(savedirfd, path, &sb, 0) == -1) return (0); return (sb.st_size); } static off_t -saved_dump_size(int bounds) +saved_dump_size(int savedirfd, int bounds) { static char path[PATH_MAX]; off_t dumpsize; @@ -263,53 +313,53 @@ saved_dump_size(int bounds) dumpsize = 0; (void)snprintf(path, sizeof(path), "info.%d", bounds); - dumpsize += file_size(path); + dumpsize += file_size(savedirfd, path); (void)snprintf(path, sizeof(path), "vmcore.%d", bounds); - dumpsize += file_size(path); + dumpsize += file_size(savedirfd, path); (void)snprintf(path, sizeof(path), "vmcore.%d.gz", bounds); - dumpsize += file_size(path); + dumpsize += file_size(savedirfd, path); (void)snprintf(path, sizeof(path), "vmcore.%d.zst", bounds); - dumpsize += file_size(path); + dumpsize += file_size(savedirfd, path); (void)snprintf(path, sizeof(path), "textdump.tar.%d", bounds); - dumpsize += file_size(path); + dumpsize += file_size(savedirfd, path); (void)snprintf(path, sizeof(path), "textdump.tar.%d.gz", bounds); - dumpsize += file_size(path); + dumpsize += file_size(savedirfd, path); return (dumpsize); } static void -saved_dump_remove(int bounds) +saved_dump_remove(int savedirfd, int bounds) { static char path[PATH_MAX]; (void)snprintf(path, sizeof(path), "info.%d", bounds); - (void)unlink(path); + (void)unlinkat(savedirfd, path, 0); (void)snprintf(path, sizeof(path), "vmcore.%d", bounds); - (void)unlink(path); + (void)unlinkat(savedirfd, path, 0); (void)snprintf(path, sizeof(path), "vmcore.%d.gz", bounds); - (void)unlink(path); + (void)unlinkat(savedirfd, path, 0); (void)snprintf(path, sizeof(path), "vmcore.%d.zst", bounds); - (void)unlink(path); + (void)unlinkat(savedirfd, path, 0); (void)snprintf(path, sizeof(path), "textdump.tar.%d", bounds); - (void)unlink(path); + (void)unlinkat(savedirfd, path, 0); (void)snprintf(path, sizeof(path), "textdump.tar.%d.gz", bounds); - (void)unlink(path); + (void)unlinkat(savedirfd, path, 0); } static void -symlinks_remove(void) +symlinks_remove(int savedirfd) { - (void)unlink("info.last"); - (void)unlink("key.last"); - (void)unlink("vmcore.last"); - (void)unlink("vmcore.last.gz"); - (void)unlink("vmcore.last.zst"); - (void)unlink("vmcore_encrypted.last"); - (void)unlink("vmcore_encrypted.last.gz"); - (void)unlink("textdump.tar.last"); - (void)unlink("textdump.tar.last.gz"); + (void)unlinkat(savedirfd, "info.last", 0); + (void)unlinkat(savedirfd, "key.last", 0); + (void)unlinkat(savedirfd, "vmcore.last", 0); + (void)unlinkat(savedirfd, "vmcore.last.gz", 0); + (void)unlinkat(savedirfd, "vmcore.last.zst", 0); + (void)unlinkat(savedirfd, "vmcore_encrypted.last", 0); + (void)unlinkat(savedirfd, "vmcore_encrypted.last.gz", 0); + (void)unlinkat(savedirfd, "textdump.tar.last", 0); + (void)unlinkat(savedirfd, "textdump.tar.last.gz", 0); } /* @@ -317,21 +367,21 @@ symlinks_remove(void) * save directory. */ static int -check_space(const char *savedir, off_t dumpsize, int bounds) +check_space(const char *savedir, int savedirfd, off_t dumpsize, int bounds) { + char buf[100]; + struct statfs fsbuf; FILE *fp; off_t available, minfree, spacefree, totfree, needed; - struct statfs fsbuf; - char buf[100]; - if (statfs(".", &fsbuf) < 0) { - syslog(LOG_ERR, "%s: %m", savedir); + if (fstatfs(savedirfd, &fsbuf) < 0) { + logmsg(LOG_ERR, "%s: %m", savedir); exit(1); } spacefree = ((off_t) fsbuf.f_bavail * fsbuf.f_bsize) / 1024; totfree = ((off_t) fsbuf.f_bfree * fsbuf.f_bsize) / 1024; - if ((fp = fopen("minfree", "r")) == NULL) + if ((fp = xfopenat(savedirfd, "minfree", O_RDONLY, "r")) == NULL) minfree = 0; else { if (fgets(buf, sizeof(buf), fp) == NULL) @@ -350,7 +400,7 @@ check_space(const char *savedir, off_t dumpsize, int b minfree = -1; } if (minfree < 0) - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "`minfree` didn't contain a valid size " "(`%s`). Defaulting to 0", buf); } @@ -359,9 +409,9 @@ check_space(const char *savedir, off_t dumpsize, int b available = minfree > 0 ? spacefree - minfree : totfree; needed = dumpsize / 1024 + 2; /* 2 for info file */ - needed -= saved_dump_size(bounds); + needed -= saved_dump_size(savedirfd, bounds); if (available < needed) { - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "no dump: not enough free space on device (need at least " "%jdkB for dump; %jdkB available; %jdkB reserved)", (intmax_t)needed, @@ -370,7 +420,7 @@ check_space(const char *savedir, off_t dumpsize, int b return (0); } if (spacefree - needed < 0) - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "dump performed, but free space threshold crossed"); return (1); } @@ -402,10 +452,10 @@ DoRegularFile(int fd, off_t dumpsize, u_int sectorsize nr = read(fd, buf, roundup(wl, sectorsize)); if (nr != (int)roundup(wl, sectorsize)) { if (nr == 0) - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "WARNING: EOF on dump device"); else - syslog(LOG_ERR, "read error on %s: %m", device); + logmsg(LOG_ERR, "read error on %s: %m", device); nerr++; return (-1); } @@ -451,9 +501,9 @@ DoRegularFile(int fd, off_t dumpsize, u_int sectorsize } } if (nw != wl) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "write error on %s file: %m", filename); - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "WARNING: vmcore may be incomplete"); nerr++; return (-1); @@ -490,7 +540,7 @@ DoTextdumpFile(int fd, off_t dumpsize, off_t lasthd, c dmpcnt = 0; wl = 512; if ((dumpsize % wl) != 0) { - syslog(LOG_ERR, "textdump uneven multiple of 512 on %s", + logmsg(LOG_ERR, "textdump uneven multiple of 512 on %s", device); nerr++; return (-1); @@ -499,18 +549,18 @@ DoTextdumpFile(int fd, off_t dumpsize, off_t lasthd, c nr = pread(fd, buf, wl, lasthd - (totsize - dumpsize) - wl); if (nr != wl) { if (nr == 0) - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "WARNING: EOF on dump device"); else - syslog(LOG_ERR, "read error on %s: %m", device); + logmsg(LOG_ERR, "read error on %s: %m", device); nerr++; return (-1); } nw = fwrite(buf, 1, wl, fp); if (nw != wl) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "write error on %s file: %m", filename); - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "WARNING: textdump may be incomplete"); nerr++; return (-1); @@ -526,7 +576,7 @@ DoTextdumpFile(int fd, off_t dumpsize, off_t lasthd, c } static void -DoFile(const char *savedir, const char *device) +DoFile(const char *savedir, int savedirfd, const char *device) { xo_handle_t *xostdout, *xoinfo; static char infoname[PATH_MAX], corename[PATH_MAX], linkname[PATH_MAX]; @@ -536,22 +586,21 @@ DoFile(const char *savedir, const char *device) struct kerneldumpheader kdhf, kdhl; uint8_t *dumpkey; off_t mediasize, dumpextent, dumplength, firsthd, lasthd; - FILE *info, *fp; - mode_t oumask; - int fd, fdinfo, error; + FILE *core, *info; + int fdcore, fddev, error; int bounds, status; u_int sectorsize, xostyle; uint32_t dumpkeysize; bool iscompressed, isencrypted, istextdump, ret; - bounds = getbounds(); + bounds = getbounds(savedirfd); dumpkey = NULL; mediasize = 0; status = STATUS_UNKNOWN; xostdout = xo_create_to_file(stdout, XO_STYLE_TEXT, 0); if (xostdout == NULL) { - syslog(LOG_ERR, "%s: %m", infoname); + logmsg(LOG_ERR, "%s: %m", infoname); return; } @@ -561,7 +610,7 @@ DoFile(const char *savedir, const char *device) if (buf == NULL) { buf = malloc(BUFFERSIZE); if (buf == NULL) { - syslog(LOG_ERR, "%m"); + logmsg(LOG_ERR, "%m"); return; } } @@ -569,17 +618,17 @@ DoFile(const char *savedir, const char *device) if (verbose) printf("checking for kernel dump on device %s\n", device); - fd = open(device, (checkfor || keep) ? O_RDONLY : O_RDWR); - if (fd < 0) { - syslog(LOG_ERR, "%s: %m", device); + fddev = fileargs_open(capfa, device); + if (fddev < 0) { + logmsg(LOG_ERR, "%s: %m", device); return; } - error = ioctl(fd, DIOCGMEDIASIZE, &mediasize); + error = ioctl(fddev, DIOCGMEDIASIZE, &mediasize); if (!error) - error = ioctl(fd, DIOCGSECTORSIZE, §orsize); + error = ioctl(fddev, DIOCGSECTORSIZE, §orsize); if (error) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "couldn't find media and/or sector size of %s: %m", device); goto closefd; } @@ -590,7 +639,7 @@ DoFile(const char *savedir, const char *device) } if (sectorsize < sizeof(kdhl)) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "Sector size is less the kernel dump header %zu", sizeof(kdhl)); goto closefd; @@ -599,12 +648,12 @@ DoFile(const char *savedir, const char *device) lasthd = mediasize - sectorsize; temp = malloc(sectorsize); if (temp == NULL) { - syslog(LOG_ERR, "%m"); + logmsg(LOG_ERR, "%m"); goto closefd; } - if (lseek(fd, lasthd, SEEK_SET) != lasthd || - read(fd, temp, sectorsize) != (ssize_t)sectorsize) { - syslog(LOG_ERR, + if (lseek(fddev, lasthd, SEEK_SET) != lasthd || + read(fddev, temp, sectorsize) != (ssize_t)sectorsize) { + logmsg(LOG_ERR, "error reading last dump header at offset %lld in %s: %m", (long long)lasthd, device); goto closefd; @@ -617,7 +666,7 @@ DoFile(const char *savedir, const char *device) device); istextdump = true; if (dtoh32(kdhl.version) != KERNELDUMP_TEXT_VERSION) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "unknown version (%d) in last dump header on %s", dtoh32(kdhl.version), device); @@ -627,7 +676,7 @@ DoFile(const char *savedir, const char *device) } } else if (compare_magic(&kdhl, KERNELDUMPMAGIC)) { if (dtoh32(kdhl.version) != KERNELDUMPVERSION) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "unknown version (%d) in last dump header on %s", dtoh32(kdhl.version), device); @@ -646,7 +695,7 @@ DoFile(const char *savedir, const char *device) iscompressed = true; break; default: - syslog(LOG_ERR, "unknown compression type %d on %s", + logmsg(LOG_ERR, "unknown compression type %d on %s", kdhl.compression, device); break; } @@ -664,11 +713,11 @@ DoFile(const char *savedir, const char *device) printf("forcing magic on %s\n", device); memcpy(kdhl.magic, KERNELDUMPMAGIC, sizeof(kdhl.magic)); } else { - syslog(LOG_ERR, "unable to force dump - bad magic"); + logmsg(LOG_ERR, "unable to force dump - bad magic"); goto closefd; } if (dtoh32(kdhl.version) != KERNELDUMPVERSION) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "unknown version (%d) in last dump header on %s", dtoh32(kdhl.version), device); @@ -683,7 +732,7 @@ DoFile(const char *savedir, const char *device) goto nuke; if (kerneldump_parity(&kdhl)) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "parity error on last dump header on %s", device); nerr++; status = STATUS_BAD; @@ -694,9 +743,9 @@ DoFile(const char *savedir, const char *device) dumplength = dtoh64(kdhl.dumplength); dumpkeysize = dtoh32(kdhl.dumpkeysize); firsthd = lasthd - dumpextent - sectorsize - dumpkeysize; - if (lseek(fd, firsthd, SEEK_SET) != firsthd || - read(fd, temp, sectorsize) != (ssize_t)sectorsize) { - syslog(LOG_ERR, + if (lseek(fddev, firsthd, SEEK_SET) != firsthd || + read(fddev, temp, sectorsize) != (ssize_t)sectorsize) { + logmsg(LOG_ERR, "error reading first dump header at offset %lld in %s: %m", (long long)firsthd, device); nerr++; @@ -714,7 +763,7 @@ DoFile(const char *savedir, const char *device) } if (memcmp(&kdhl, &kdhf, sizeof(kdhl))) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "first and last dump headers disagree on %s", device); nerr++; status = STATUS_BAD; @@ -726,77 +775,79 @@ DoFile(const char *savedir, const char *device) if (checkfor) { printf("A dump exists on %s\n", device); - close(fd); + close(fddev); exit(0); } if (kdhl.panicstring[0] != '\0') - syslog(LOG_ALERT, "reboot after panic: %.*s", + logmsg(LOG_ALERT, "reboot after panic: %.*s", (int)sizeof(kdhl.panicstring), kdhl.panicstring); else - syslog(LOG_ALERT, "reboot"); + logmsg(LOG_ALERT, "reboot"); if (verbose) printf("Checking for available free space\n"); - if (!check_space(savedir, dumplength, bounds)) { + if (!check_space(savedir, savedirfd, dumplength, bounds)) { nerr++; goto closefd; } - writebounds(bounds + 1); + writebounds(savedirfd, bounds + 1); - saved_dump_remove(bounds); + saved_dump_remove(savedirfd, bounds); snprintf(infoname, sizeof(infoname), "info.%d", bounds); /* * Create or overwrite any existing dump header files. */ - fdinfo = open(infoname, O_WRONLY | O_CREAT | O_TRUNC, 0600); - if (fdinfo < 0) { - syslog(LOG_ERR, "%s: %m", infoname); + if ((info = xfopenat(savedirfd, infoname, + O_WRONLY | O_CREAT | O_TRUNC, "w", 0600)) == NULL) { + logmsg(LOG_ERR, "open(%s): %m", infoname); nerr++; goto closefd; } - oumask = umask(S_IRWXG|S_IRWXO); /* Restrict access to the core file. */ isencrypted = (dumpkeysize > 0); - if (compress) { + if (compress) snprintf(corename, sizeof(corename), "%s.%d.gz", istextdump ? "textdump.tar" : (isencrypted ? "vmcore_encrypted" : "vmcore"), bounds); - fp = zopen(corename, "w"); - } else if (iscompressed && !isencrypted) { + else if (iscompressed && !isencrypted) snprintf(corename, sizeof(corename), "vmcore.%d.%s", bounds, (kdhl.compression == KERNELDUMP_COMP_GZIP) ? "gz" : "zst"); - fp = fopen(corename, "w"); - } else { + else snprintf(corename, sizeof(corename), "%s.%d", istextdump ? "textdump.tar" : (isencrypted ? "vmcore_encrypted" : "vmcore"), bounds); - fp = fopen(corename, "w"); - } - if (fp == NULL) { - syslog(LOG_ERR, "%s: %m", corename); - close(fdinfo); + fdcore = openat(savedirfd, corename, O_WRONLY | O_CREAT | O_TRUNC, + 0600); + if (fdcore < 0) { + logmsg(LOG_ERR, "open(%s): %m", corename); + fclose(info); nerr++; goto closefd; } - (void)umask(oumask); - info = fdopen(fdinfo, "w"); - - if (info == NULL) { - syslog(LOG_ERR, "fdopen failed: %m"); + if (compress) + core = zdopen(fdcore, "w"); + else + core = fdopen(fdcore, "w"); + if (core == NULL) { + logmsg(LOG_ERR, "%s: %m", corename); + (void)close(fdcore); + (void)fclose(info); nerr++; - goto closeall; + goto closefd; } + fdcore = -1; xostyle = xo_get_style(NULL); xoinfo = xo_create_to_file(info, xostyle, 0); if (xoinfo == NULL) { - syslog(LOG_ERR, "%s: %m", infoname); + logmsg(LOG_ERR, "%s: %m", infoname); + fclose(info); nerr++; goto closeall; } @@ -814,19 +865,19 @@ DoFile(const char *savedir, const char *device) if (isencrypted) { dumpkey = calloc(1, dumpkeysize); if (dumpkey == NULL) { - syslog(LOG_ERR, "Unable to allocate kernel dump key."); + logmsg(LOG_ERR, "Unable to allocate kernel dump key."); nerr++; goto closeall; } - if (read(fd, dumpkey, dumpkeysize) != (ssize_t)dumpkeysize) { - syslog(LOG_ERR, "Unable to read kernel dump key: %m."); + if (read(fddev, dumpkey, dumpkeysize) != (ssize_t)dumpkeysize) { + logmsg(LOG_ERR, "Unable to read kernel dump key: %m."); nerr++; goto closeall; } snprintf(keyname, sizeof(keyname), "key.%d", bounds); - ret = writekey(keyname, dumpkey, dumpkeysize); + ret = writekey(savedirfd, keyname, dumpkey, dumpkeysize); explicit_bzero(dumpkey, dumpkeysize); if (!ret) { nerr++; @@ -834,38 +885,38 @@ DoFile(const char *savedir, const char *device) } } - syslog(LOG_NOTICE, "writing %s%score to %s/%s", + logmsg(LOG_NOTICE, "writing %s%score to %s/%s", isencrypted ? "encrypted " : "", compress ? "compressed " : "", savedir, corename); if (istextdump) { - if (DoTextdumpFile(fd, dumplength, lasthd, buf, device, - corename, fp) < 0) + if (DoTextdumpFile(fddev, dumplength, lasthd, buf, device, + corename, core) < 0) goto closeall; } else { - if (DoRegularFile(fd, dumplength, sectorsize, + if (DoRegularFile(fddev, dumplength, sectorsize, !(compress || iscompressed || isencrypted), buf, device, - corename, fp) < 0) { + corename, core) < 0) { goto closeall; } } if (verbose) printf("\n"); - if (fclose(fp) < 0) { - syslog(LOG_ERR, "error on %s: %m", corename); + if (fclose(core) < 0) { + logmsg(LOG_ERR, "error on %s: %m", corename); nerr++; goto closefd; } - symlinks_remove(); - if (symlink(infoname, "info.last") == -1) { - syslog(LOG_WARNING, "unable to create symlink %s/%s: %m", + symlinks_remove(savedirfd); + if (symlinkat(infoname, savedirfd, "info.last") == -1) { + logmsg(LOG_WARNING, "unable to create symlink %s/%s: %m", savedir, "info.last"); } if (isencrypted) { - if (symlink(keyname, "key.last") == -1) { - syslog(LOG_WARNING, + if (symlinkat(keyname, savedirfd, "key.last") == -1) { + logmsg(LOG_WARNING, "unable to create symlink %s/%s: %m", savedir, "key.last"); } @@ -880,8 +931,8 @@ DoFile(const char *savedir, const char *device) istextdump ? "textdump.tar" : (isencrypted ? "vmcore_encrypted" : "vmcore")); } - if (symlink(corename, linkname) == -1) { - syslog(LOG_WARNING, "unable to create symlink %s/%s: %m", + if (symlinkat(corename, savedirfd, linkname) == -1) { + logmsg(LOG_WARNING, "unable to create symlink %s/%s: %m", savedir, linkname); } @@ -896,28 +947,109 @@ nuke: printf("clearing dump header\n"); memcpy(kdhl.magic, KERNELDUMPMAGIC_CLEARED, sizeof(kdhl.magic)); memcpy(temp, &kdhl, sizeof(kdhl)); - if (lseek(fd, lasthd, SEEK_SET) != lasthd || - write(fd, temp, sectorsize) != (ssize_t)sectorsize) - syslog(LOG_ERR, + if (lseek(fddev, lasthd, SEEK_SET) != lasthd || + write(fddev, temp, sectorsize) != (ssize_t)sectorsize) + logmsg(LOG_ERR, "error while clearing the dump header: %m"); } xo_close_container_h(xostdout, "crashdump"); xo_finish_h(xostdout); free(dumpkey); free(temp); - close(fd); + close(fddev); return; closeall: - fclose(fp); + fclose(core); closefd: free(dumpkey); free(temp); - close(fd); + close(fddev); } +static char ** +enum_dumpdevs(int *argcp) +{ + struct fstab *fsp; + char **argv; + int argc, n; + + /* + * We cannot use getfsent(3) in capability mode, so we must + * scan /etc/fstab and build up a list of candidate devices + * before proceeding. + */ + argc = 0; + n = 8; + argv = malloc(n * sizeof(*argv)); + if (argv == NULL) { + logmsg(LOG_ERR, "malloc(): %m"); + exit(1); + } + for (;;) { + fsp = getfsent(); + if (fsp == NULL) + break; + if (strcmp(fsp->fs_vfstype, "swap") != 0 && + strcmp(fsp->fs_vfstype, "dump") != 0) + continue; + if (argc >= n) { + n *= 2; + argv = realloc(argv, n * sizeof(*argv)); + if (argv == NULL) { + logmsg(LOG_ERR, "realloc(): %m"); + exit(1); + } + } + argv[argc] = strdup(fsp->fs_spec); + if (argv[argc] == NULL) { + logmsg(LOG_ERR, "strdup(): %m"); + exit(1); + } + argc++; + } + *argcp = argc; + return (argv); +} + static void +init_caps(int argc, char **argv) +{ + cap_rights_t rights; + cap_channel_t *capcas; + + capcas = cap_init(); + if (capcas == NULL) { + logmsg(LOG_ERR, "cap_init(): %m"); + exit(1); + } + /* + * The fileargs capability does not currently provide a way to limit + * ioctls. + */ + (void)cap_rights_init(&rights, CAP_PREAD, CAP_WRITE, CAP_IOCTL); + capfa = fileargs_init(argc, argv, checkfor || keep ? O_RDONLY : O_RDWR, + 0, &rights); + if (capfa == NULL) { + logmsg(LOG_ERR, "fileargs_init(): %m"); + exit(1); + } + caph_cache_catpages(); + caph_cache_tzdata(); + if (caph_enter_casper() != 0) { + logmsg(LOG_ERR, "caph_enter_casper(): %m"); + exit(1); + } + capsyslog = cap_service_open(capcas, "system.syslog"); + if (capsyslog == NULL) { + logmsg(LOG_ERR, "cap_service_open(system.syslog): %m"); + exit(1); + } + cap_close(capcas); +} + +static void usage(void) { xo_error("%s\n%s\n%s\n", @@ -930,12 +1062,13 @@ usage(void) int main(int argc, char **argv) { - const char *savedir = "."; - struct fstab *fsp; - int i, ch, error; + cap_rights_t rights; + const char *savedir; + int i, ch, error, savedirfd; checkfor = compress = clear = force = keep = verbose = 0; nfound = nsaved = nerr = 0; + savedir = "."; openlog("savecore", LOG_PERROR, LOG_DAEMON); signal(SIGINFO, infohandler); @@ -961,7 +1094,7 @@ main(int argc, char **argv) case 'm': maxdumps = atoi(optarg); if (maxdumps <= 0) { - syslog(LOG_ERR, "Invalid maxdump value"); + logmsg(LOG_ERR, "Invalid maxdump value"); exit(1); } break; @@ -986,29 +1119,35 @@ main(int argc, char **argv) if (argc >= 1 && !checkfor && !clear) { error = chdir(argv[0]); if (error) { - syslog(LOG_ERR, "chdir(%s): %m", argv[0]); + logmsg(LOG_ERR, "chdir(%s): %m", argv[0]); exit(1); } savedir = argv[0]; argc--; argv++; } - if (argc == 0) { - for (;;) { - fsp = getfsent(); - if (fsp == NULL) - break; - if (strcmp(fsp->fs_vfstype, "swap") && - strcmp(fsp->fs_vfstype, "dump")) - continue; - DoFile(savedir, fsp->fs_spec); - } - endfsent(); - } else { - for (i = 0; i < argc; i++) - DoFile(savedir, argv[i]); + if (argc == 0) + argv = enum_dumpdevs(&argc); + + savedirfd = open(savedir, O_RDONLY | O_DIRECTORY); + if (savedirfd < 0) { + logmsg(LOG_ERR, "open(%s): %m", savedir); + exit(1); } + (void)cap_rights_init(&rights, CAP_CREATE, CAP_FCNTL, CAP_FSTATAT, + CAP_FSTATFS, CAP_PREAD, CAP_SYMLINKAT, CAP_FTRUNCATE, CAP_UNLINKAT, + CAP_WRITE); + if (caph_rights_limit(savedirfd, &rights) < 0) { + logmsg(LOG_ERR, "cap_rights_limit(): %m"); + exit(1); + } + /* Enter capability mode. */ + init_caps(argc, argv); + + for (i = 0; i < argc; i++) + DoFile(savedir, savedirfd, argv[i]); + /* Emit minimal output. */ if (nfound == 0) { if (checkfor) { @@ -1017,15 +1156,15 @@ main(int argc, char **argv) exit(1); } if (verbose) - syslog(LOG_WARNING, "no dumps found"); + logmsg(LOG_WARNING, "no dumps found"); } else if (nsaved == 0) { if (nerr != 0) { if (verbose) - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "unsaved dumps found but not saved"); exit(1); } else if (verbose) - syslog(LOG_WARNING, "no unsaved dumps found"); + logmsg(LOG_WARNING, "no unsaved dumps found"); } return (0); From owner-svn-src-all@freebsd.org Wed Jan 2 17:13:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1702C1429DD9; Wed, 2 Jan 2019 17:13:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A692F969F5; Wed, 2 Jan 2019 17:13:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9FE5CC43; Wed, 2 Jan 2019 17:13:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02HDt1l008919; Wed, 2 Jan 2019 17:13:55 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02HDtV5008918; Wed, 2 Jan 2019 17:13:55 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901021713.x02HDtV5008918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 17:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342700 - head/sys/dev/rtwn/pci X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/rtwn/pci X-SVN-Commit-Revision: 342700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A692F969F5 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)[-0.998,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, 02 Jan 2019 17:13:57 -0000 Author: avos Date: Wed Jan 2 17:13:55 2019 New Revision: 342700 URL: https://svnweb.freebsd.org/changeset/base/342700 Log: rtwn_pci(4): fix panic with INVARIANTS (due to inverted assertion logic) MFC after: 4 days Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_rx.c Wed Jan 2 17:09:35 2019 (r342699) +++ head/sys/dev/rtwn/pci/rtwn_pci_rx.c Wed Jan 2 17:13:55 2019 (r342700) @@ -193,7 +193,7 @@ rtwn_pci_rx_buf_copy(struct rtwn_pci_softc *pc) * descriptor - same as for PCIe, but without rxbufaddr* fields. */ desc_size = sizeof(struct rtwn_rx_stat_common); - KASSERT(sizeof(pc->pc_rx_buf) < desc_size, + KASSERT(sizeof(pc->pc_rx_buf) >= desc_size, ("adjust size for PCIe Rx buffer!")); memcpy(pc->pc_rx_buf, rx_desc, desc_size); From owner-svn-src-all@freebsd.org Wed Jan 2 17:34:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A4FC142A58C; Wed, 2 Jan 2019 17:34:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B567C97403; Wed, 2 Jan 2019 17:34:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A83C2CFB7; Wed, 2 Jan 2019 17:34:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02HYP7s019563; Wed, 2 Jan 2019 17:34:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02HYPHI019562; Wed, 2 Jan 2019 17:34:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021734.x02HYPHI019562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 17:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342701 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 342701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B567C97403 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.970,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)[-0.998,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, 02 Jan 2019 17:34:26 -0000 Author: markj Date: Wed Jan 2 17:34:25 2019 New Revision: 342701 URL: https://svnweb.freebsd.org/changeset/base/342701 Log: Fix an error check after r342699. Reported by: gcc MFC with: r342699 Sponsored by: The FreeBSD Foundation Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Wed Jan 2 17:13:55 2019 (r342700) +++ head/sbin/savecore/savecore.c Wed Jan 2 17:34:25 2019 (r342701) @@ -258,7 +258,7 @@ writebounds(int savedirfd, int bounds) FILE *fp; if ((fp = xfopenat(savedirfd, "bounds", O_WRONLY | O_CREAT | O_TRUNC, - "w", 0644)) < 0) { + "w", 0644)) == NULL) { logmsg(LOG_WARNING, "unable to write to bounds file: %m"); return; } From owner-svn-src-all@freebsd.org Wed Jan 2 18:30:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03193142BF79; Wed, 2 Jan 2019 18:30:24 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C7F56A744; Wed, 2 Jan 2019 18:30:23 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F466D89C; Wed, 2 Jan 2019 18:30:23 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02IUNcL045275; Wed, 2 Jan 2019 18:30:23 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02IUMhb045272; Wed, 2 Jan 2019 18:30:22 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901021830.x02IUMhb045272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 18:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342702 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 342702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C7F56A744 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)[-0.998,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: Wed, 02 Jan 2019 18:30:24 -0000 Author: avos Date: Wed Jan 2 18:30:22 2019 New Revision: 342702 URL: https://svnweb.freebsd.org/changeset/base/342702 Log: rtwn(4): refresh manpages. - Add 'device rtwn' to rtwn_pci(4) and rtwn_usb(4) config sample; kernel will not compile otherwise. - Refresh devices list in rtwn_usb(4); add 'chipset' column. - Bump Dd after this commit and r342682. MFC after: 4 days Modified: head/share/man/man4/rtwn.4 head/share/man/man4/rtwn_pci.4 head/share/man/man4/rtwn_usb.4 Modified: head/share/man/man4/rtwn.4 ============================================================================== --- head/share/man/man4/rtwn.4 Wed Jan 2 17:34:25 2019 (r342701) +++ head/share/man/man4/rtwn.4 Wed Jan 2 18:30:22 2019 (r342702) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2017 +.Dd January 2, 2019 .Dt RTWN 4 .Os .Sh NAME Modified: head/share/man/man4/rtwn_pci.4 ============================================================================== --- head/share/man/man4/rtwn_pci.4 Wed Jan 2 17:34:25 2019 (r342701) +++ head/share/man/man4/rtwn_pci.4 Wed Jan 2 18:30:22 2019 (r342702) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd November 12, 2016 +.Dd January 2, 2019 .Dt RTWN_PCI 4 .Os .Sh NAME @@ -40,6 +40,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device rtwn" .Cd "device rtwn_pci" .Cd "device pci" .Cd "device wlan" Modified: head/share/man/man4/rtwn_usb.4 ============================================================================== --- head/share/man/man4/rtwn_usb.4 Wed Jan 2 17:34:25 2019 (r342701) +++ head/share/man/man4/rtwn_usb.4 Wed Jan 2 18:30:22 2019 (r342702) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd October 9, 2017 +.Dd January 2, 2019 .Dt RTWN_USB 4 .Os .Sh NAME @@ -45,6 +45,7 @@ kernel configuration file: .Cd "device uhci" .Cd "device ohci" .Cd "device usb" +.Cd "device rtwn" .Cd "device rtwn_usb" .Cd "device wlan" .Ed @@ -56,52 +57,56 @@ driver. .Sh HARDWARE The .Nm -driver supports Realtek RTL8188CU/RTL8188RU/RTL8188EU/RTL8192CU/RTL8192EU/RTL8812AU/RTL8821AU +driver supports Realtek RTL8188CUS/RTL8188RU/RTL8188EU/RTL8192CU/RTL8192EU/RTL8812AU/RTL8821AU based USB wireless network adapters, including: .Pp -.Bl -column -compact "Belkin F7D1102 Surf Wireless Micro" "Bus" -.It Em Card Ta Em Bus -.It "Alfa AWUS036NHR v2" Ta USB 2.0 -.It "ASUS USB-AC56" Ta USB 3.0 -.It "ASUS USB-N10 NANO" Ta USB 2.0 -.It "Asus USB-N13, rev. B1" Ta USB 2.0 -.It "Belkin F7D1102 Surf Wireless Micro" Ta USB 2.0 -.It "Buffalo WI-U2-433DM" Ta USB 2.0 -.It "Buffalo WI-U3-866D" Ta USB 3.0 -.It "D-Link DWA-123 rev D1" Ta USB 2.0 -.It "D-Link DWA-125 rev D1" Ta USB 2.0 -.It "D-Link DWA-131" Ta USB 2.0 -.It "D-Link DWA-131 rev E1" Ta USB 2.0 -.It "D-Link DWA-171 rev A1" Ta USB 2.0 -.It "D-Link DWA-172 rev A1" Ta USB 2.0 -.It "D-Link DWA-180 rev A1" Ta USB 2.0 -.It "D-Link DWA-182 rev C1" Ta USB 3.0 -.It "Edimax EW-7811Un" Ta USB 2.0 -.It "Edimax EW-7811UTC" Ta USB 2.0 -.It "Edimax EW-7822UAC" Ta USB 3.0 -.It "Elecom WDC-150SU2M" Ta USB 2.0 -.It "EnGenius EUB1200AC" Ta USB 3.0 -.It "Hawking HD65U" Ta USB 2.0 -.It "Hercules Wireless N USB Pico" Ta USB 2.0 -.It "I-O Data WN-AC867U" Ta USB 3.0 -.It "Linksys WUSB6300" Ta USB 3.0 -.It "NEC AtermWL900U PA-WL900U" Ta USB 3.0 -.It "Netgear A6100" Ta USB 2.0 -.It "Netgear WNA1000M" Ta USB 2.0 -.It "Planex GW-900D" Ta USB 3.0 -.It "Realtek RTL8192CU" Ta USB 2.0 -.It "Realtek RTL8188CUS" Ta USB 2.0 -.It "Sitecom WLA-7100" Ta USB 3.0 -.It "TP-Link Archer T4U" Ta USB 3.0 -.It "TP-LINK TL-WN723N v3" Ta USB 2.0 -.It "TP-LINK TL-WN725N v2" Ta USB 2.0 -.It "TP-LINK TL-WN821N v4" Ta USB 2.0 -.It "TP-LINK TL-WN821N v5" Ta USB 2.0 -.It "TP-LINK TL-WN822N v4" Ta USB 2.0 -.It "TP-LINK TL-WN823N v1" Ta USB 2.0 -.It "TP-LINK TL-WN823N v2" Ta USB 2.0 -.It "TRENDnet TEW-805UB" Ta USB 3.0 -.It "ZyXEL NWD6605" Ta USB 3.0 +.Bl -column -compact "Belkin F7D1102 Surf Wireless Micro" "RTL8188CUS" "Bus" +.It Em Card Ta Em Chip Ta Em Bus +.It "Alfa AWUS036NHR v2" Ta RTL8188RU Ta USB 2.0 +.It "ASUS USB-AC56" Ta RTL8812AU Ta USB 3.0 +.It "ASUS USB-N10 NANO" Ta RTL8188CUS Ta USB 2.0 +.It "Asus USB-N13, rev. B1" Ta RTL8192CU Ta USB 2.0 +.It "Belkin F7D1102 Surf Wireless Micro" Ta RTL8188CUS Ta USB 2.0 +.It "Buffalo WI-U2-433DM" Ta RTL8821AU Ta USB 2.0 +.It "Buffalo WI-U3-866D" Ta RTL8812AU Ta USB 3.0 +.It "D-Link DWA-123 rev D1" Ta RTL8188EU Ta USB 2.0 +.It "D-Link DWA-125 rev D1" Ta RTL8188EU Ta USB 2.0 +.It "D-Link DWA-131" Ta RTL8192CU Ta USB 2.0 +.It "D-Link DWA-131 rev E1" Ta RTL8192EU Ta USB 2.0 +.It "D-Link DWA-171 rev A1" Ta RTL8821AU Ta USB 2.0 +.It "D-Link DWA-172 rev A1" Ta RTL8821AU Ta USB 2.0 +.It "D-Link DWA-180 rev A1" Ta RTL8812AU Ta USB 2.0 +.It "D-Link DWA-182 rev C1" Ta RTL8812AU Ta USB 3.0 +.It "Edimax EW-7811Un" Ta RTL8188CUS Ta USB 2.0 +.It "Edimax EW-7811UTC" Ta RTL8821AU Ta USB 2.0 +.It "Edimax EW-7822UAC" Ta RTL8812AU Ta USB 3.0 +.It "Elecom WDC-150SU2M" Ta RTL8188EU Ta USB 2.0 +.It "EnGenius EUB1200AC" Ta RTL8812AU Ta USB 3.0 +.It "Hawking HD65U" Ta RTL8821AU Ta USB 2.0 +.It "Hercules Wireless N USB Pico" Ta RTL8188CUS Ta USB 2.0 +.It "I-O Data WN-AC867U" Ta RTL8812AU Ta USB 3.0 +.It "Linksys WUSB6300" Ta RTL8812AU Ta USB 3.0 +.It "NEC AtermWL900U PA-WL900U" Ta RTL8812AU Ta USB 3.0 +.It "Netgear A6100" Ta RTL8821AU Ta USB 2.0 +.It "Netgear WNA1000M" Ta RTL8188CUS Ta USB 2.0 +.It "Planex GW-900D" Ta RTL8812AU Ta USB 3.0 +.It "Realtek RTL8192CU" Ta RTL8192CU Ta USB 2.0 +.It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0 +.It "Sitecom WLA-7100" Ta RTL8812AU Ta USB 3.0 +.It "TP-Link Archer T4U" Ta RTL8812AU Ta USB 3.0 +.It "TP-Link Archer T4U v2" Ta RTL8812AU Ta USB 3.0 +.It "TP-Link Archer T4UH v1" Ta RTL8812AU Ta USB 3.0 +.It "TP-Link Archer T4UH v2" Ta RTL8812AU Ta USB 3.0 +.It "TP-Link TL-WN722N v2" Ta RTL8188EU Ta USB 2.0 +.It "TP-LINK TL-WN723N v3" Ta RTL8188EU Ta USB 2.0 +.It "TP-LINK TL-WN725N v2" Ta RTL8188EU Ta USB 2.0 +.It "TP-LINK TL-WN821N v4" Ta RTL8192CU Ta USB 2.0 +.It "TP-LINK TL-WN821N v5" Ta RTL8192EU Ta USB 2.0 +.It "TP-LINK TL-WN822N v4" Ta RTL8192EU Ta USB 2.0 +.It "TP-LINK TL-WN823N v1" Ta RTL8192CU Ta USB 2.0 +.It "TP-LINK TL-WN823N v2" Ta RTL8192EU Ta USB 2.0 +.It "TRENDnet TEW-805UB" Ta RTL8812AU Ta USB 3.0 +.It "ZyXEL NWD6605" Ta RTL8812AU Ta USB 3.0 .El .Sh SEE ALSO .Xr rtwn 4 , From owner-svn-src-all@freebsd.org Wed Jan 2 18:35:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 665C2142C328; Wed, 2 Jan 2019 18:35:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B6716AC8B; Wed, 2 Jan 2019 18:35:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3496DA3E; Wed, 2 Jan 2019 18:35:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02IZeIT050506; Wed, 2 Jan 2019 18:35:40 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02IZe8n050504; Wed, 2 Jan 2019 18:35:40 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901021835.x02IZe8n050504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 18:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342703 - in head/sys/dev: rtwn/usb usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev: rtwn/usb usb X-SVN-Commit-Revision: 342703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B6716AC8B 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)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 18:35:41 -0000 Author: avos Date: Wed Jan 2 18:35:40 2019 New Revision: 342703 URL: https://svnweb.freebsd.org/changeset/base/342703 Log: rtwn_usb(4): add USB id for TP-LINK TL-WN821N v5. It is already mentioned in manpage, but was missing from the driver. MFC after: 4 days Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h head/sys/dev/usb/usbdevs Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.h Wed Jan 2 18:30:22 2019 (r342702) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.h Wed Jan 2 18:35:40 2019 (r342703) @@ -107,6 +107,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, RTWN_CHIP_RTL8192EU) } RTWN_RTL8192EU_DEV(DLINK, DWA131E1), RTWN_RTL8192EU_DEV(REALTEK, RTL8192EU), + RTWN_RTL8192EU_DEV(TPLINK, WN821NV5), RTWN_RTL8192EU_DEV(TPLINK, WN822NV4), RTWN_RTL8192EU_DEV(TPLINK, WN823NV2), #undef RTWN_RTL8192EU_DEV Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Jan 2 18:30:22 2019 (r342702) +++ head/sys/dev/usb/usbdevs Wed Jan 2 18:35:40 2019 (r342703) @@ -4614,6 +4614,7 @@ product TOSHIBA TRANSMEMORY 0x6545 USB ThumbDrive /* TP-Link products */ product TPLINK T4U 0x0101 Archer T4U +product TPLINK WN821NV5 0x0107 TL-WN821N v5 product TPLINK WN822NV4 0x0108 TL-WN822N v4 product TPLINK WN823NV2 0x0109 TL-WN823N v2 product TPLINK WN722NV2 0x010c TL-WN722N v2 From owner-svn-src-all@freebsd.org Wed Jan 2 19:11:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC88C142D58E; Wed, 2 Jan 2019 19:11:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 523BD6C08F; Wed, 2 Jan 2019 19:11:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44963E0D9; Wed, 2 Jan 2019 19:11:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02JBoS6070999; Wed, 2 Jan 2019 19:11:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02JBngH070997; Wed, 2 Jan 2019 19:11:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901021911.x02JBngH070997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 19:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342704 - in stable: 10/sys/kern 10/tests/sys/kern 11/sys/kern 11/tests/sys/kern 12/sys/kern 12/tests/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/kern 10/tests/sys/kern 11/sys/kern 11/tests/sys/kern 12/sys/kern 12/tests/sys/kern X-SVN-Commit-Revision: 342704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 523BD6C08F 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)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 19:11:51 -0000 Author: jhb Date: Wed Jan 2 19:11:49 2019 New Revision: 342704 URL: https://svnweb.freebsd.org/changeset/base/342704 Log: MFC 341800: Don't report stale signal information in ptrace_lwpinfo. Once a signal's siginfo was copied to 'td_si' as part of the signal exchange in issignal(), it was never cleared. This caused future thread events that are reported as SIGTRAP events without signal information to report the stale siginfo in 'td_si'. For example, if a debugger created a new process and used SIGSTOP to stop it after PT_ATTACH, future system call entry / exit events would set PL_FLAG_SI with the SIGSTOP siginfo in pl_siginfo. This broke 'catch syscall' in current versions of gdb as it assumed PL_FLAG_SI with SIGTRAP indicates a breakpoint or single step trap. Modified: stable/10/sys/kern/kern_sig.c stable/10/tests/sys/kern/ptrace_test.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/kern/kern_sig.c stable/11/tests/sys/kern/ptrace_test.c stable/12/sys/kern/kern_sig.c stable/12/tests/sys/kern/ptrace_test.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/kern/kern_sig.c ============================================================================== --- stable/10/sys/kern/kern_sig.c Wed Jan 2 18:35:40 2019 (r342703) +++ stable/10/sys/kern/kern_sig.c Wed Jan 2 19:11:49 2019 (r342704) @@ -2803,6 +2803,8 @@ issignal(struct thread *td) sig = ptracestop(td, sig, &td->td_dbgksi); mtx_lock(&ps->ps_mtx); + td->td_dbgksi.ksi_signo = 0; + /* * Keep looking if the debugger discarded the signal * or replaced it with a masked signal. Modified: stable/10/tests/sys/kern/ptrace_test.c ============================================================================== --- stable/10/tests/sys/kern/ptrace_test.c Wed Jan 2 18:35:40 2019 (r342703) +++ stable/10/tests/sys/kern/ptrace_test.c Wed Jan 2 19:11:49 2019 (r342704) @@ -3112,6 +3112,78 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_different_thread, tc) } #endif +/* + * Verify that PT_LWPINFO doesn't return stale siginfo. + */ +ATF_TC_WITHOUT_HEAD(ptrace__PT_LWPINFO_stale_siginfo); +ATF_TC_BODY(ptrace__PT_LWPINFO_stale_siginfo, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + raise(SIGABRT); + exit(1); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The next stop should report the SIGABRT in the child body. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGABRT); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SI); + ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGABRT); + + /* + * Continue the process ignoring the signal, but enabling + * syscall traps. + */ + ATF_REQUIRE(ptrace(PT_SYSCALL, fpid, (caddr_t)1, 0) == 0); + + /* + * The next stop should report a system call entry from + * exit(). PL_FLAGS_SI should not be set. + */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCE); + ATF_REQUIRE((pl.pl_flags & PL_FLAG_SI) == 0); + + /* Disable syscall tracing and continue the child to let it exit. */ + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + events &= ~PTRACE_SYSCALL; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The last event should be for the child process's exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + ATF_TP_ADD_TCS(tp) { @@ -3161,6 +3233,7 @@ ATF_TP_ADD_TCS(tp) #if defined(__amd64__) || defined(__i386__) ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_different_thread); #endif + ATF_TP_ADD_TC(tp, ptrace__PT_LWPINFO_stale_siginfo); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Wed Jan 2 19:11:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD5B3142D598; Wed, 2 Jan 2019 19:11:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 625BA6C099; Wed, 2 Jan 2019 19:11:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53CF7E0DB; Wed, 2 Jan 2019 19:11:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02JBp04071014; Wed, 2 Jan 2019 19:11:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02JBpAL071012; Wed, 2 Jan 2019 19:11:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901021911.x02JBpAL071012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 19:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342704 - in stable: 10/sys/kern 10/tests/sys/kern 11/sys/kern 11/tests/sys/kern 12/sys/kern 12/tests/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/kern 10/tests/sys/kern 11/sys/kern 11/tests/sys/kern 12/sys/kern 12/tests/sys/kern X-SVN-Commit-Revision: 342704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 625BA6C099 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)[-0.998,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, 02 Jan 2019 19:11:52 -0000 Author: jhb Date: Wed Jan 2 19:11:49 2019 New Revision: 342704 URL: https://svnweb.freebsd.org/changeset/base/342704 Log: MFC 341800: Don't report stale signal information in ptrace_lwpinfo. Once a signal's siginfo was copied to 'td_si' as part of the signal exchange in issignal(), it was never cleared. This caused future thread events that are reported as SIGTRAP events without signal information to report the stale siginfo in 'td_si'. For example, if a debugger created a new process and used SIGSTOP to stop it after PT_ATTACH, future system call entry / exit events would set PL_FLAG_SI with the SIGSTOP siginfo in pl_siginfo. This broke 'catch syscall' in current versions of gdb as it assumed PL_FLAG_SI with SIGTRAP indicates a breakpoint or single step trap. Modified: stable/11/sys/kern/kern_sig.c stable/11/tests/sys/kern/ptrace_test.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/kern/kern_sig.c stable/10/tests/sys/kern/ptrace_test.c stable/12/sys/kern/kern_sig.c stable/12/tests/sys/kern/ptrace_test.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/kern/kern_sig.c ============================================================================== --- stable/11/sys/kern/kern_sig.c Wed Jan 2 18:35:40 2019 (r342703) +++ stable/11/sys/kern/kern_sig.c Wed Jan 2 19:11:49 2019 (r342704) @@ -2858,6 +2858,8 @@ issignal(struct thread *td) sig = ptracestop(td, sig, &ksi); mtx_lock(&ps->ps_mtx); + td->td_si.si_signo = 0; + /* * Keep looking if the debugger discarded or * replaced the signal. Modified: stable/11/tests/sys/kern/ptrace_test.c ============================================================================== --- stable/11/tests/sys/kern/ptrace_test.c Wed Jan 2 18:35:40 2019 (r342703) +++ stable/11/tests/sys/kern/ptrace_test.c Wed Jan 2 19:11:49 2019 (r342704) @@ -3772,6 +3772,78 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_different_thread, tc) } #endif +/* + * Verify that PT_LWPINFO doesn't return stale siginfo. + */ +ATF_TC_WITHOUT_HEAD(ptrace__PT_LWPINFO_stale_siginfo); +ATF_TC_BODY(ptrace__PT_LWPINFO_stale_siginfo, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + raise(SIGABRT); + exit(1); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The next stop should report the SIGABRT in the child body. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGABRT); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SI); + ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGABRT); + + /* + * Continue the process ignoring the signal, but enabling + * syscall traps. + */ + ATF_REQUIRE(ptrace(PT_SYSCALL, fpid, (caddr_t)1, 0) == 0); + + /* + * The next stop should report a system call entry from + * exit(). PL_FLAGS_SI should not be set. + */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCE); + ATF_REQUIRE((pl.pl_flags & PL_FLAG_SI) == 0); + + /* Disable syscall tracing and continue the child to let it exit. */ + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + events &= ~PTRACE_SYSCALL; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The last event should be for the child process's exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + ATF_TP_ADD_TCS(tp) { @@ -3831,6 +3903,7 @@ ATF_TP_ADD_TCS(tp) #if defined(HAVE_BREAKPOINT) && defined(SKIP_BREAK) ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_different_thread); #endif + ATF_TP_ADD_TC(tp, ptrace__PT_LWPINFO_stale_siginfo); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Wed Jan 2 19:11:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B237142D592; Wed, 2 Jan 2019 19:11:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D44C66C092; Wed, 2 Jan 2019 19:11:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6835E0DA; Wed, 2 Jan 2019 19:11:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02JBoLF071007; Wed, 2 Jan 2019 19:11:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02JBolx071004; Wed, 2 Jan 2019 19:11:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901021911.x02JBolx071004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 19:11: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: r342704 - in stable: 10/sys/kern 10/tests/sys/kern 11/sys/kern 11/tests/sys/kern 12/sys/kern 12/tests/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/kern 10/tests/sys/kern 11/sys/kern 11/tests/sys/kern 12/sys/kern 12/tests/sys/kern X-SVN-Commit-Revision: 342704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D44C66C092 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)[-0.998,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, 02 Jan 2019 19:11:51 -0000 Author: jhb Date: Wed Jan 2 19:11:49 2019 New Revision: 342704 URL: https://svnweb.freebsd.org/changeset/base/342704 Log: MFC 341800: Don't report stale signal information in ptrace_lwpinfo. Once a signal's siginfo was copied to 'td_si' as part of the signal exchange in issignal(), it was never cleared. This caused future thread events that are reported as SIGTRAP events without signal information to report the stale siginfo in 'td_si'. For example, if a debugger created a new process and used SIGSTOP to stop it after PT_ATTACH, future system call entry / exit events would set PL_FLAG_SI with the SIGSTOP siginfo in pl_siginfo. This broke 'catch syscall' in current versions of gdb as it assumed PL_FLAG_SI with SIGTRAP indicates a breakpoint or single step trap. Modified: stable/12/sys/kern/kern_sig.c stable/12/tests/sys/kern/ptrace_test.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/kern/kern_sig.c stable/10/tests/sys/kern/ptrace_test.c stable/11/sys/kern/kern_sig.c stable/11/tests/sys/kern/ptrace_test.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/kern/kern_sig.c ============================================================================== --- stable/12/sys/kern/kern_sig.c Wed Jan 2 18:35:40 2019 (r342703) +++ stable/12/sys/kern/kern_sig.c Wed Jan 2 19:11:49 2019 (r342704) @@ -2847,6 +2847,8 @@ issignal(struct thread *td) sig = ptracestop(td, sig, &ksi); mtx_lock(&ps->ps_mtx); + td->td_si.si_signo = 0; + /* * Keep looking if the debugger discarded or * replaced the signal. Modified: stable/12/tests/sys/kern/ptrace_test.c ============================================================================== --- stable/12/tests/sys/kern/ptrace_test.c Wed Jan 2 18:35:40 2019 (r342703) +++ stable/12/tests/sys/kern/ptrace_test.c Wed Jan 2 19:11:49 2019 (r342704) @@ -3772,6 +3772,78 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_different_thread, tc) } #endif +/* + * Verify that PT_LWPINFO doesn't return stale siginfo. + */ +ATF_TC_WITHOUT_HEAD(ptrace__PT_LWPINFO_stale_siginfo); +ATF_TC_BODY(ptrace__PT_LWPINFO_stale_siginfo, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + raise(SIGABRT); + exit(1); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The next stop should report the SIGABRT in the child body. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGABRT); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SI); + ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGABRT); + + /* + * Continue the process ignoring the signal, but enabling + * syscall traps. + */ + ATF_REQUIRE(ptrace(PT_SYSCALL, fpid, (caddr_t)1, 0) == 0); + + /* + * The next stop should report a system call entry from + * exit(). PL_FLAGS_SI should not be set. + */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SCE); + ATF_REQUIRE((pl.pl_flags & PL_FLAG_SI) == 0); + + /* Disable syscall tracing and continue the child to let it exit. */ + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + events &= ~PTRACE_SYSCALL; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The last event should be for the child process's exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + ATF_TP_ADD_TCS(tp) { @@ -3831,6 +3903,7 @@ ATF_TP_ADD_TCS(tp) #if defined(HAVE_BREAKPOINT) && defined(SKIP_BREAK) ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_different_thread); #endif + ATF_TP_ADD_TC(tp, ptrace__PT_LWPINFO_stale_siginfo); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Wed Jan 2 19:46:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35F2C142E346; Wed, 2 Jan 2019 19:46:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB9F76D47B; Wed, 2 Jan 2019 19:46:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDF16E651; Wed, 2 Jan 2019 19:46:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02Jk1JP086829; Wed, 2 Jan 2019 19:46:01 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02Jk13v086828; Wed, 2 Jan 2019 19:46:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901021946.x02Jk13v086828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 19:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342705 - stable/12/usr.bin/ktrdump X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/usr.bin/ktrdump X-SVN-Commit-Revision: 342705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CB9F76D47B 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]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Jan 2019 19:46:02 -0000 Author: jhb Date: Wed Jan 2 19:46:01 2019 New Revision: 342705 URL: https://svnweb.freebsd.org/changeset/base/342705 Log: MFC 339620: Add a "live" mode to ktrdump. Support a "live" mode in ktrdump enabled via the -l flag. In this mode, ktrdump polls the kernel's trace buffer periodically (currently hardcoded as a 50 millisecond interval) and dumps any newly added entries. Fancier logic for the timeout (e.g. a command line option or some kind of backoff based on the time since the last entry) can be added later as the need arises. While here, fix some bugs from when this was Capsicum-ized: - Use caph_limit_stream() for the output stream so that isatty() works and the output can be line-buffered (especially useful for live mode). - Use caph_limit_stderr() to permit error messages to be displayed if an error occurs after cap_enter(). Modified: stable/12/usr.bin/ktrdump/ktrdump.8 stable/12/usr.bin/ktrdump/ktrdump.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/ktrdump/ktrdump.8 ============================================================================== --- stable/12/usr.bin/ktrdump/ktrdump.8 Wed Jan 2 19:11:49 2019 (r342704) +++ stable/12/usr.bin/ktrdump/ktrdump.8 Wed Jan 2 19:46:01 2019 (r342705) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2015 +.Dd October 22, 2018 .Dt KTRDUMP 8 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd print kernel ktr trace buffer .Sh SYNOPSIS .Nm -.Op Fl cfqrtH +.Op Fl cflqrtH .Op Fl i Ar ktrfile .Op Fl M Ar core .Op Fl N Ar system @@ -47,6 +47,9 @@ The following options are available: .Bl -tag -width ".Fl i Ar ktrfile" .It Fl c Print the CPU number that each entry was logged from. +.It Fl l +Poll the kernel ktr trace buffer periodically dumping any new events after +each poll. .It Fl f Print the file and line number that each entry was logged from. .It Fl q Modified: stable/12/usr.bin/ktrdump/ktrdump.c ============================================================================== --- stable/12/usr.bin/ktrdump/ktrdump.c Wed Jan 2 19:11:49 2019 (r342704) +++ stable/12/usr.bin/ktrdump/ktrdump.c Wed Jan 2 19:46:01 2019 (r342705) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #define SBUFLEN 128 #define USAGE \ - "usage: ktrdump [-cfqrtH] [-i ktrfile] [-M core] [-N system] [-o outfile]\n" + "usage: ktrdump [-cflqrtH] [-i ktrfile] [-M core] [-N system] [-o outfile]\n" static void usage(void); @@ -65,6 +65,7 @@ static struct nlist nl[] = { static int cflag; static int fflag; +static int lflag; static int Mflag; static int Nflag; static int qflag; @@ -111,7 +112,7 @@ main(int ac, char **av) * Parse commandline arguments. */ out = stdout; - while ((c = getopt(ac, av, "cfqrtHe:i:m:M:N:o:")) != -1) + while ((c = getopt(ac, av, "cflqrtHe:i:m:M:N:o:")) != -1) switch (c) { case 'c': cflag = 1; @@ -136,6 +137,9 @@ main(int ac, char **av) err(1, "unable to limit rights for %s", optarg); break; + case 'l': + lflag = 1; + break; case 'M': case 'm': if (strlcpy(corefile, optarg, sizeof(corefile)) @@ -169,9 +173,10 @@ main(int ac, char **av) if (ac != 0) usage(); - cap_rights_init(&rights, CAP_FSTAT, CAP_WRITE); - if (cap_rights_limit(fileno(out), &rights) < 0 && errno != ENOSYS) + if (caph_limit_stream(fileno(out), CAPH_WRITE) < 0) err(1, "unable to limit rights for %s", outfile); + if (caph_limit_stderr() < 0) + err(1, "unable to limit rights for stderr"); /* * Open our execfile and corefile, resolve needed symbols and read in @@ -258,15 +263,29 @@ main(int ac, char **av) fprintf(out, "\n"); } + tlast = -1; /* * Now tear through the trace buffer. + * + * In "live" mode, find the oldest entry (first non-NULL entry + * after index2) and walk forward. Otherwise, start with the + * most recent entry and walk backwards. */ if (!iflag) { - i = index - 1; - if (i < 0) - i = entries - 1; + if (lflag) { + i = index2 + 1 % entries; + while (buf[i].ktr_desc == NULL && i != index) { + i++; + if (i == entries) + i = 0; + } + } else { + i = index - 1; + if (i < 0) + i = entries - 1; + } } - tlast = -1; +dump_entries: for (;;) { if (buf[i].ktr_desc == NULL) break; @@ -338,14 +357,40 @@ next: if ((c = *p++) == '\0') * 'index2' were in flux while the KTR buffer was * being copied to userspace we don't dump them. */ - if (i == index2) - break; - if (--i < 0) - i = entries - 1; + if (lflag) { + if (++i == entries) + i = 0; + if (i == index) + break; + } else { + if (i == index2) + break; + if (--i < 0) + i = entries - 1; + } } else { if (++i == entries) break; } + } + + /* + * In "live" mode, poll 'ktr_idx' periodically and dump any + * new entries since our last pass through the ring. + */ + if (lflag && !iflag) { + while (index == index2) { + usleep(50 * 1000); + if (kvm_read(kd, nl[2].n_value, &index2, + sizeof(index2)) == -1) + errx(1, "%s", kvm_geterr(kd)); + } + i = index; + index = index2; + if (kvm_read(kd, bufptr, buf, sizeof(*buf) * entries) == -1 || + kvm_read(kd, nl[2].n_value, &index2, sizeof(index2)) == -1) + errx(1, "%s", kvm_geterr(kd)); + goto dump_entries; } return (0); From owner-svn-src-all@freebsd.org Wed Jan 2 19:48:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF545142E437; Wed, 2 Jan 2019 19:48:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9260A6D618; Wed, 2 Jan 2019 19:48:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78E5CE652; Wed, 2 Jan 2019 19:48:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02JmIeV086962; Wed, 2 Jan 2019 19:48:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02JmIaQ086960; Wed, 2 Jan 2019 19:48:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901021948.x02JmIaQ086960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 19:48:18 +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: r342706 - stable/11/usr.bin/ktrdump X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/usr.bin/ktrdump X-SVN-Commit-Revision: 342706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9260A6D618 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)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 19:48:19 -0000 Author: jhb Date: Wed Jan 2 19:48:17 2019 New Revision: 342706 URL: https://svnweb.freebsd.org/changeset/base/342706 Log: MFC 339620: Add a "live" mode to ktrdump. Support a "live" mode in ktrdump enabled via the -l flag. In this mode, ktrdump polls the kernel's trace buffer periodically (currently hardcoded as a 50 millisecond interval) and dumps any newly added entries. Fancier logic for the timeout (e.g. a command line option or some kind of backoff based on the time since the last entry) can be added later as the need arises. Note that this does not include the capsicum fixes from the original commit since ktrdump in stable/11 is not capsicum-ized. Modified: stable/11/usr.bin/ktrdump/ktrdump.8 stable/11/usr.bin/ktrdump/ktrdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/ktrdump/ktrdump.8 ============================================================================== --- stable/11/usr.bin/ktrdump/ktrdump.8 Wed Jan 2 19:46:01 2019 (r342705) +++ stable/11/usr.bin/ktrdump/ktrdump.8 Wed Jan 2 19:48:17 2019 (r342706) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2015 +.Dd October 22, 2018 .Dt KTRDUMP 8 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd print kernel ktr trace buffer .Sh SYNOPSIS .Nm -.Op Fl cfqrtH +.Op Fl cflqrtH .Op Fl i Ar ktrfile .Op Fl M Ar core .Op Fl N Ar system @@ -47,6 +47,9 @@ The following options are available: .Bl -tag -width ".Fl i Ar ktrfile" .It Fl c Print the CPU number that each entry was logged from. +.It Fl l +Poll the kernel ktr trace buffer periodically dumping any new events after +each poll. .It Fl f Print the file and line number that each entry was logged from. .It Fl q Modified: stable/11/usr.bin/ktrdump/ktrdump.c ============================================================================== --- stable/11/usr.bin/ktrdump/ktrdump.c Wed Jan 2 19:46:01 2019 (r342705) +++ stable/11/usr.bin/ktrdump/ktrdump.c Wed Jan 2 19:48:17 2019 (r342706) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #define SBUFLEN 128 #define USAGE \ - "usage: ktrdump [-cfqrtH] [-i ktrfile] [-M core] [-N system] [-o outfile]\n" + "usage: ktrdump [-cflqrtH] [-i ktrfile] [-M core] [-N system] [-o outfile]\n" static void usage(void); @@ -62,6 +62,7 @@ static struct nlist nl[] = { static int cflag; static int fflag; +static int lflag; static int Mflag; static int Nflag; static int qflag; @@ -106,7 +107,7 @@ main(int ac, char **av) * Parse commandline arguments. */ out = stdout; - while ((c = getopt(ac, av, "cfqrtHe:i:m:M:N:o:")) != -1) + while ((c = getopt(ac, av, "cflqrtHe:i:m:M:N:o:")) != -1) switch (c) { case 'c': cflag = 1; @@ -126,6 +127,9 @@ main(int ac, char **av) if ((in = open(optarg, O_RDONLY)) == -1) err(1, "%s", optarg); break; + case 'l': + lflag = 1; + break; case 'M': case 'm': if (strlcpy(corefile, optarg, sizeof(corefile)) @@ -226,15 +230,29 @@ main(int ac, char **av) fprintf(out, "\n"); } + tlast = -1; /* * Now tear through the trace buffer. + * + * In "live" mode, find the oldest entry (first non-NULL entry + * after index2) and walk forward. Otherwise, start with the + * most recent entry and walk backwards. */ if (!iflag) { - i = index - 1; - if (i < 0) - i = entries - 1; + if (lflag) { + i = index2 + 1 % entries; + while (buf[i].ktr_desc == NULL && i != index) { + i++; + if (i == entries) + i = 0; + } + } else { + i = index - 1; + if (i < 0) + i = entries - 1; + } } - tlast = -1; +dump_entries: for (;;) { if (buf[i].ktr_desc == NULL) break; @@ -306,14 +324,40 @@ next: if ((c = *p++) == '\0') * 'index2' were in flux while the KTR buffer was * being copied to userspace we don't dump them. */ - if (i == index2) - break; - if (--i < 0) - i = entries - 1; + if (lflag) { + if (++i == entries) + i = 0; + if (i == index) + break; + } else { + if (i == index2) + break; + if (--i < 0) + i = entries - 1; + } } else { if (++i == entries) break; } + } + + /* + * In "live" mode, poll 'ktr_idx' periodically and dump any + * new entries since our last pass through the ring. + */ + if (lflag && !iflag) { + while (index == index2) { + usleep(50 * 1000); + if (kvm_read(kd, nl[2].n_value, &index2, + sizeof(index2)) == -1) + errx(1, "%s", kvm_geterr(kd)); + } + i = index; + index = index2; + if (kvm_read(kd, bufptr, buf, sizeof(*buf) * entries) == -1 || + kvm_read(kd, nl[2].n_value, &index2, sizeof(index2)) == -1) + errx(1, "%s", kvm_geterr(kd)); + goto dump_entries; } return (0); From owner-svn-src-all@freebsd.org Wed Jan 2 20:31:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96683142F82C; Wed, 2 Jan 2019 20:31:16 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F62B6EECE; Wed, 2 Jan 2019 20:31:16 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 329B2EE88; Wed, 2 Jan 2019 20:31:16 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02KVGxw009469; Wed, 2 Jan 2019 20:31:16 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02KVGO6009468; Wed, 2 Jan 2019 20:31:16 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201901022031.x02KVGO6009468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 2 Jan 2019 20:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342707 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 342707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F62B6EECE 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 20:31:16 -0000 Author: tsoome Date: Wed Jan 2 20:31:15 2019 New Revision: 342707 URL: https://svnweb.freebsd.org/changeset/base/342707 Log: i386_parsedev() needs to support fd devices MFC after: 2 weeks Modified: head/stand/i386/libi386/devicename.c Modified: head/stand/i386/libi386/devicename.c ============================================================================== --- head/stand/i386/libi386/devicename.c Wed Jan 2 19:48:17 2019 (r342706) +++ head/stand/i386/libi386/devicename.c Wed Jan 2 20:31:15 2019 (r342707) @@ -103,23 +103,42 @@ i386_parsedev(struct i386_devdesc **dev, const char *d } if (dv == NULL) return(ENOENT); - idev = malloc(sizeof(struct i386_devdesc)); - err = 0; + np = (devspec + strlen(dv->dv_name)); + idev = NULL; + err = 0; switch(dv->dv_type) { - case DEVT_NONE: /* XXX what to do here? Do we care? */ + case DEVT_NONE: break; case DEVT_DISK: + idev = malloc(sizeof(struct i386_devdesc)); + if (idev == NULL) + return (ENOMEM); + err = disk_parsedev((struct disk_devdesc *)idev, np, path); if (err != 0) goto fail; break; - case DEVT_CD: - case DEVT_NET: + case DEVT_ZFS: + idev = malloc(sizeof (struct zfs_devdesc)); + if (idev == NULL) + return (ENOMEM); + + err = zfs_parsedev((struct zfs_devdesc *)idev, np, path); + if (err != 0) + goto fail; + break; + + default: + idev = malloc(sizeof (struct devdesc)); + if (idev == NULL) + return (ENOMEM); + unit = 0; + cp = (char *)np; if (*np && (*np != ':')) { unit = strtol(np, &cp, 0); /* get unit number if present */ @@ -127,9 +146,8 @@ i386_parsedev(struct i386_devdesc **dev, const char *d err = EUNIT; goto fail; } - } else { - cp = (char *)np; } + if (*cp && (*cp != ':')) { err = EINVAL; goto fail; @@ -139,21 +157,13 @@ i386_parsedev(struct i386_devdesc **dev, const char *d if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; break; - case DEVT_ZFS: - err = zfs_parsedev((struct zfs_devdesc *)idev, np, path); - if (err != 0) - goto fail; - break; - default: - err = EINVAL; - goto fail; } idev->dd.d_dev = dv; - if (dev == NULL) { - free(idev); - } else { + if (dev != NULL) *dev = idev; - } + else + free(idev); + return(0); fail: From owner-svn-src-all@freebsd.org Wed Jan 2 20:49:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D91714301BF; Wed, 2 Jan 2019 20:49:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 132816FB84; Wed, 2 Jan 2019 20:49:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 045ECF0CE; Wed, 2 Jan 2019 20:49:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02Knfk2018047; Wed, 2 Jan 2019 20:49:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02Knfn0018046; Wed, 2 Jan 2019 20:49:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901022049.x02Knfn0018046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 20:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342708 - in stable: 11/usr.bin/truss 12/usr.bin/truss X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.bin/truss 12/usr.bin/truss X-SVN-Commit-Revision: 342708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 132816FB84 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.948,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 20:49:42 -0000 Author: jhb Date: Wed Jan 2 20:49:41 2019 New Revision: 342708 URL: https://svnweb.freebsd.org/changeset/base/342708 Log: MFC 341802: Validate the string size parameter passed to -s. Use strtonum() to reject negative sizes instead of core dumping. PR: 232206 Modified: stable/12/usr.bin/truss/main.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.bin/truss/main.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.bin/truss/main.c ============================================================================== --- stable/12/usr.bin/truss/main.c Wed Jan 2 20:31:15 2019 (r342707) +++ stable/12/usr.bin/truss/main.c Wed Jan 2 20:49:41 2019 (r342708) @@ -71,6 +71,7 @@ main(int ac, char **av) struct trussinfo *trussinfo; char *fname; char **command; + const char *errstr; pid_t pid; int c; @@ -118,7 +119,9 @@ main(int ac, char **av) fname = optarg; break; case 's': /* Specified string size */ - trussinfo->strsize = atoi(optarg); + trussinfo->strsize = strtonum(optarg, 0, INT_MAX, &errstr); + if (errstr) + errx(1, "maximum string size is %s: %s", errstr, optarg); break; case 'S': /* Don't trace signals */ trussinfo->flags |= NOSIGS; From owner-svn-src-all@freebsd.org Wed Jan 2 20:49:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9BD914301C4; Wed, 2 Jan 2019 20:49:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D1696FB85; Wed, 2 Jan 2019 20:49:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F50EF0CF; Wed, 2 Jan 2019 20:49:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02Knggb018053; Wed, 2 Jan 2019 20:49:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02KngeN018052; Wed, 2 Jan 2019 20:49:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901022049.x02KngeN018052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 20:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342708 - in stable: 11/usr.bin/truss 12/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.bin/truss 12/usr.bin/truss X-SVN-Commit-Revision: 342708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7D1696FB85 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.948,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 02 Jan 2019 20:49:43 -0000 Author: jhb Date: Wed Jan 2 20:49:41 2019 New Revision: 342708 URL: https://svnweb.freebsd.org/changeset/base/342708 Log: MFC 341802: Validate the string size parameter passed to -s. Use strtonum() to reject negative sizes instead of core dumping. PR: 232206 Modified: stable/11/usr.bin/truss/main.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.bin/truss/main.c Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.bin/truss/main.c ============================================================================== --- stable/11/usr.bin/truss/main.c Wed Jan 2 20:31:15 2019 (r342707) +++ stable/11/usr.bin/truss/main.c Wed Jan 2 20:49:41 2019 (r342708) @@ -69,6 +69,7 @@ main(int ac, char **av) struct trussinfo *trussinfo; char *fname; char **command; + const char *errstr; pid_t pid; int c; @@ -116,7 +117,9 @@ main(int ac, char **av) fname = optarg; break; case 's': /* Specified string size */ - trussinfo->strsize = atoi(optarg); + trussinfo->strsize = strtonum(optarg, 0, INT_MAX, &errstr); + if (errstr) + errx(1, "maximum string size is %s: %s", errstr, optarg); break; case 'S': /* Don't trace signals */ trussinfo->flags |= NOSIGS; From owner-svn-src-all@freebsd.org Wed Jan 2 23:57:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24DCE14356B2; Wed, 2 Jan 2019 23:57:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0D9976201; Wed, 2 Jan 2019 23:57:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B23091913D; Wed, 2 Jan 2019 23:57:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02Nvc4H016774; Wed, 2 Jan 2019 23:57:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02NvcHU016773; Wed, 2 Jan 2019 23:57:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901022357.x02NvcHU016773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 23:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342709 - in stable: 11/usr.bin/procstat 12/usr.bin/procstat X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.bin/procstat 12/usr.bin/procstat X-SVN-Commit-Revision: 342709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0D9976201 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)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 02 Jan 2019 23:57:39 -0000 Author: jhb Date: Wed Jan 2 23:57:37 2019 New Revision: 342709 URL: https://svnweb.freebsd.org/changeset/base/342709 Log: MFC 339894: Teach procstat -x about the AT_EHDRFLAGS ELF auxiliary vector. Modified: stable/11/usr.bin/procstat/procstat_auxv.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.bin/procstat/procstat_auxv.c Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.bin/procstat/procstat_auxv.c ============================================================================== --- stable/11/usr.bin/procstat/procstat_auxv.c Wed Jan 2 20:49:41 2019 (r342708) +++ stable/11/usr.bin/procstat/procstat_auxv.c Wed Jan 2 23:57:37 2019 (r342709) @@ -179,6 +179,12 @@ procstat_auxv(struct procstat *procstat, struct kinfo_ prefix, "AT_TIMEKEEP", auxv[i].a_un.a_ptr); break; #endif +#ifdef AT_EHDRFLAGS + case AT_EHDRFLAGS: + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_EHDRFLAGS/%#lx}\n", + prefix, "AT_EHDRFLAGS", (u_long)auxv[i].a_un.a_val); + break; +#endif default: xo_emit("{dw:/%s}{Lw:/%16ld/%ld}{:UNKNOWN/%#lx}\n", prefix, auxv[i].a_type, auxv[i].a_un.a_val); From owner-svn-src-all@freebsd.org Wed Jan 2 23:57:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE25514356AC; Wed, 2 Jan 2019 23:57:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7436976200; Wed, 2 Jan 2019 23:57:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62B3F1913C; Wed, 2 Jan 2019 23:57:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02Nvcro016768; Wed, 2 Jan 2019 23:57:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02NvcGW016767; Wed, 2 Jan 2019 23:57:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901022357.x02NvcGW016767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 2 Jan 2019 23:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342709 - in stable: 11/usr.bin/procstat 12/usr.bin/procstat X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.bin/procstat 12/usr.bin/procstat X-SVN-Commit-Revision: 342709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7436976200 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)[-0.998,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: Wed, 02 Jan 2019 23:57:39 -0000 Author: jhb Date: Wed Jan 2 23:57:37 2019 New Revision: 342709 URL: https://svnweb.freebsd.org/changeset/base/342709 Log: MFC 339894: Teach procstat -x about the AT_EHDRFLAGS ELF auxiliary vector. Modified: stable/12/usr.bin/procstat/procstat_auxv.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.bin/procstat/procstat_auxv.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.bin/procstat/procstat_auxv.c ============================================================================== --- stable/12/usr.bin/procstat/procstat_auxv.c Wed Jan 2 20:49:41 2019 (r342708) +++ stable/12/usr.bin/procstat/procstat_auxv.c Wed Jan 2 23:57:37 2019 (r342709) @@ -179,6 +179,12 @@ procstat_auxv(struct procstat *procstat, struct kinfo_ prefix, "AT_TIMEKEEP", auxv[i].a_un.a_ptr); break; #endif +#ifdef AT_EHDRFLAGS + case AT_EHDRFLAGS: + xo_emit("{dw:/%s}{Lw:/%-16s/%s}{:AT_EHDRFLAGS/%#lx}\n", + prefix, "AT_EHDRFLAGS", (u_long)auxv[i].a_un.a_val); + break; +#endif default: xo_emit("{dw:/%s}{Lw:/%16ld/%ld}{:UNKNOWN/%#lx}\n", prefix, auxv[i].a_type, auxv[i].a_un.a_val); From owner-svn-src-all@freebsd.org Thu Jan 3 00:36:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2188143667C; Thu, 3 Jan 2019 00:36:34 +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 67A7880605; Thu, 3 Jan 2019 00:36:34 +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 5525719833; Thu, 3 Jan 2019 00:36:34 +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 x030aYPV039989; Thu, 3 Jan 2019 00:36:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x030aYAE039987; Thu, 3 Jan 2019 00:36:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901030036.x030aYAE039987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 3 Jan 2019 00:36: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: r342710 - in stable/12/sys/i386: i386 include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/i386: i386 include X-SVN-Commit-Revision: 342710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 67A7880605 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.955,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 00:36:35 -0000 Author: kib Date: Thu Jan 3 00:36:33 2019 New Revision: 342710 URL: https://svnweb.freebsd.org/changeset/base/342710 Log: MFC r342653, r342654: Update comments: paging is initialized in pmap_cold(). Modified: stable/12/sys/i386/i386/pmap.c stable/12/sys/i386/include/pmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/i386/i386/pmap.c ============================================================================== --- stable/12/sys/i386/i386/pmap.c Wed Jan 2 23:57:37 2019 (r342709) +++ stable/12/sys/i386/i386/pmap.c Thu Jan 3 00:36:33 2019 (r342710) @@ -569,9 +569,9 @@ pmap_cold(void) /* * Bootstrap the system enough to run with virtual memory. * - * On the i386 this is called after mapping has already been enabled - * in locore.s with the page table created in pmap_cold(), - * and just syncs the pmap module with what has already been done. + * On the i386 this is called after pmap_cold() created intial + * kernel page table and enabled paging, and just syncs the pmap + * module with what has already been done. */ void pmap_bootstrap(vm_paddr_t firstaddr) @@ -594,11 +594,12 @@ pmap_bootstrap(vm_paddr_t firstaddr) vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt)); /* - * Initialize the first available kernel virtual address. However, - * using "firstaddr" may waste a few pages of the kernel virtual - * address space, because locore may not have mapped every physical - * page that it allocated. Preferably, locore would provide a first - * unused virtual address in addition to "firstaddr". + * Initialize the first available kernel virtual address. + * However, using "firstaddr" may waste a few pages of the + * kernel virtual address space, because pmap_cold() may not + * have mapped every physical page that it allocated. + * Preferably, pmap_cold() would provide a first unused + * virtual address in addition to "firstaddr". */ virtual_avail = (vm_offset_t)firstaddr; virtual_end = VM_MAX_KERNEL_ADDRESS; @@ -665,7 +666,7 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* * KPTmap is used by pmap_kextract(). * - * KPTmap is first initialized by locore. However, that initial + * KPTmap is first initialized by pmap_cold(). However, that initial * KPTmap can only support NKPT page table pages. Here, a larger * KPTmap is created that can support KVA_PAGES page table pages. */ Modified: stable/12/sys/i386/include/pmap.h ============================================================================== --- stable/12/sys/i386/include/pmap.h Wed Jan 2 23:57:37 2019 (r342709) +++ stable/12/sys/i386/include/pmap.h Thu Jan 3 00:36:33 2019 (r342710) @@ -125,7 +125,7 @@ /* * The initial number of kernel page table pages that are constructed - * by locore must be sufficient to map vm_page_array. That number can + * by pmap_cold() must be sufficient to map vm_page_array[]. That number can * be calculated as follows: * max_phys / PAGE_SIZE * sizeof(struct vm_page) / NBPDR * PAE: max_phys 16G, sizeof(vm_page) 76, NBPDR 2M, 152 page table pages. @@ -228,7 +228,7 @@ extern pd_entry_t *IdlePTD; /* physical address of "Id * a kernel page table page after the corresponding virtual addresses have * been promoted to a 2/4MB page mapping. * - * KPTmap is first initialized by locore to support just NPKT page table + * KPTmap is first initialized by pmap_cold() to support just NPKT page table * pages. Later, it is reinitialized by pmap_bootstrap() to allow for * expansion of the kernel page table. */ From owner-svn-src-all@freebsd.org Thu Jan 3 01:01:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C6114373FA; Thu, 3 Jan 2019 01:01:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 270FA81269; Thu, 3 Jan 2019 01:01:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AD9919BC8; Thu, 3 Jan 2019 01:01:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03113TK054143; Thu, 3 Jan 2019 01:01:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03113ev054142; Thu, 3 Jan 2019 01:01:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901030101.x03113ev054142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 3 Jan 2019 01:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342711 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 342711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 270FA81269 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.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 01:01:04 -0000 Author: kib Date: Thu Jan 3 01:01:03 2019 New Revision: 342711 URL: https://svnweb.freebsd.org/changeset/base/342711 Log: Fix typo, use boolean operator instead of bit-wise. Reviewed by: marius, shurd MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Jan 3 00:36:33 2019 (r342710) +++ head/sys/net/iflib.c Thu Jan 3 01:01:03 2019 (r342711) @@ -1617,7 +1617,7 @@ iflib_txsd_alloc(iflib_txq_t txq) (uintmax_t)sctx->isc_tx_maxsize, nsegments, (uintmax_t)sctx->isc_tx_maxsegsize); goto fail; } - if ((if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) & + if ((if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) && (err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ From owner-svn-src-all@freebsd.org Thu Jan 3 01:39:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BED6D14386F9; Thu, 3 Jan 2019 01:39:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B5C782B28; Thu, 3 Jan 2019 01:39:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43F431A28C; Thu, 3 Jan 2019 01:39:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x031dNRG071176; Thu, 3 Jan 2019 01:39:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x031dNL9071175; Thu, 3 Jan 2019 01:39:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901030139.x031dNL9071175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Jan 2019 01:39: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: r342712 - in stable: 11/sys/dev/acpica 12/sys/dev/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/acpica 12/sys/dev/acpica X-SVN-Commit-Revision: 342712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5B5C782B28 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)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Jan 2019 01:39:23 -0000 Author: jhb Date: Thu Jan 3 01:39:22 2019 New Revision: 342712 URL: https://svnweb.freebsd.org/changeset/base/342712 Log: MFC 339899: Make battery emptying rate available as sysctl variable. Curiously, the in-kernel routines always use the design voltage to convert from mA to mW, but acpiconf in userland uses the current voltage. As a result, this can report a different mW rate than acpiconf. Modified: stable/12/sys/dev/acpica/acpi_battery.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/acpica/acpi_battery.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/acpica/acpi_battery.c ============================================================================== --- stable/12/sys/dev/acpica/acpi_battery.c Thu Jan 3 01:01:03 2019 (r342711) +++ stable/12/sys/dev/acpica/acpi_battery.c Thu Jan 3 01:39:22 2019 (r342712) @@ -487,6 +487,11 @@ acpi_battery_init(void) "remaining time in minutes"); SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, SYSCTL_CHILDREN(acpi_battery_sysctl_tree), + OID_AUTO, "rate", CTLTYPE_INT | CTLFLAG_RD, + &acpi_battery_battinfo.rate, 0, acpi_battery_sysctl, "I", + "present rate in mW"); + SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, + SYSCTL_CHILDREN(acpi_battery_sysctl_tree), OID_AUTO, "state", CTLTYPE_INT | CTLFLAG_RD, &acpi_battery_battinfo.state, 0, acpi_battery_sysctl, "I", "current status flags"); From owner-svn-src-all@freebsd.org Thu Jan 3 01:39:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22DCB14386FD; Thu, 3 Jan 2019 01:39:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA95582B29; Thu, 3 Jan 2019 01:39:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEA761A28D; Thu, 3 Jan 2019 01:39:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x031dNW6071182; Thu, 3 Jan 2019 01:39:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x031dNdN071181; Thu, 3 Jan 2019 01:39:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901030139.x031dNdN071181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Jan 2019 01:39: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: r342712 - in stable: 11/sys/dev/acpica 12/sys/dev/acpica X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/acpica 12/sys/dev/acpica X-SVN-Commit-Revision: 342712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA95582B29 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 01:39:24 -0000 Author: jhb Date: Thu Jan 3 01:39:22 2019 New Revision: 342712 URL: https://svnweb.freebsd.org/changeset/base/342712 Log: MFC 339899: Make battery emptying rate available as sysctl variable. Curiously, the in-kernel routines always use the design voltage to convert from mA to mW, but acpiconf in userland uses the current voltage. As a result, this can report a different mW rate than acpiconf. Modified: stable/11/sys/dev/acpica/acpi_battery.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/acpica/acpi_battery.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/acpica/acpi_battery.c ============================================================================== --- stable/11/sys/dev/acpica/acpi_battery.c Thu Jan 3 01:01:03 2019 (r342711) +++ stable/11/sys/dev/acpica/acpi_battery.c Thu Jan 3 01:39:22 2019 (r342712) @@ -487,6 +487,11 @@ acpi_battery_init(void) "remaining time in minutes"); SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, SYSCTL_CHILDREN(acpi_battery_sysctl_tree), + OID_AUTO, "rate", CTLTYPE_INT | CTLFLAG_RD, + &acpi_battery_battinfo.rate, 0, acpi_battery_sysctl, "I", + "present rate in mW"); + SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, + SYSCTL_CHILDREN(acpi_battery_sysctl_tree), OID_AUTO, "state", CTLTYPE_INT | CTLFLAG_RD, &acpi_battery_battinfo.state, 0, acpi_battery_sysctl, "I", "current status flags"); From owner-svn-src-all@freebsd.org Thu Jan 3 02:59:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D088143B02A; Thu, 3 Jan 2019 02:59:14 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2929E8553B; Thu, 3 Jan 2019 02:59:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E22B1B056; Thu, 3 Jan 2019 02:59:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x032xC1s012918; Thu, 3 Jan 2019 02:59:12 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x032xC8u012917; Thu, 3 Jan 2019 02:59:12 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901030259.x032xC8u012917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 3 Jan 2019 02:59: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: r342713 - stable/12/sys/net80211 X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/12/sys/net80211 X-SVN-Commit-Revision: 342713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2929E8553B 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)[-0.998,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, 03 Jan 2019 02:59:14 -0000 Author: avos Date: Thu Jan 3 02:59:12 2019 New Revision: 342713 URL: https://svnweb.freebsd.org/changeset/base/342713 Log: MFC r342604: net80211: fix duplicate sequence number bump for non-AMPDU QoS frames. This should be a part of r312972. Modified: stable/12/sys/net80211/ieee80211_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net80211/ieee80211_output.c ============================================================================== --- stable/12/sys/net80211/ieee80211_output.c Thu Jan 3 01:39:22 2019 (r342712) +++ stable/12/sys/net80211/ieee80211_output.c Thu Jan 3 02:59:12 2019 (r342713) @@ -1698,7 +1698,6 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee8 * capability; this may also change when we pull * aggregation up into net80211 */ - seqno = ni->ni_txseqs[tid]++; *(uint16_t *)wh->i_seq = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); M_SEQNO_SET(m, seqno); From owner-svn-src-all@freebsd.org Thu Jan 3 03:27:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C990143C501; Thu, 3 Jan 2019 03:27:38 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1171C869DD; Thu, 3 Jan 2019 03:27:38 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEB1F1B5B7; Thu, 3 Jan 2019 03:27:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x033RbxC029604; Thu, 3 Jan 2019 03:27:37 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x033Rbdk029603; Thu, 3 Jan 2019 03:27:37 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901030327.x033Rbdk029603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 3 Jan 2019 03:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342714 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 342714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1171C869DD 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]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Jan 2019 03:27:38 -0000 Author: avos Date: Thu Jan 3 03:27:37 2019 New Revision: 342714 URL: https://svnweb.freebsd.org/changeset/base/342714 Log: rtwnfw(4): refresh this manpage too (add rtwn-rtl8188eefw module). MFC after: 3 days Modified: head/share/man/man4/rtwnfw.4 Modified: head/share/man/man4/rtwnfw.4 ============================================================================== --- head/share/man/man4/rtwnfw.4 Thu Jan 3 02:59:12 2019 (r342713) +++ head/share/man/man4/rtwnfw.4 Thu Jan 3 03:27:37 2019 (r342714) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2017 +.Dd January 3, 2019 .Dt RTWNFW 4 .Os .Sh NAME @@ -41,6 +41,7 @@ This will include all firmware images inside the kerne If you want to pick only the firmware image for your network adapter choose one of the following: .Bd -ragged -offset indent +.Cd "device rtwn-rtl8188eefw" .Cd "device rtwn-rtl8188eufw" .Cd "device rtwn-rtl8192cfwE_B" .Cd "device rtwn-rtl8192cfwE" @@ -55,6 +56,7 @@ Alternatively, to load all firmware images as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent +rtwn-rtl8188eefw_load="YES" rtwn-rtl8188eufw_load="YES" rtwn-rtl8192cfwE_B_load="YES" rtwn-rtl8192cfwE_load="YES" @@ -67,6 +69,8 @@ rtwn-rtl8821aufw_load="YES" .Sh DESCRIPTION rtwn-rtl8192cfwE and rtl8192cfwE_B modules provide access to firmware sets for the Realtek RTL8188CE chip based PCIe adapters. +rtwn-rtl8188ee module provides access to firmware sets for the +Realtek RTL8188EE chip based PCIe adapters. Other modules provide access to firmware sets for the Realtek RTL8188CUS, RTL8188CE-VAU, RTL8188EUS, RTL8188RU, RTL8192CU, RTL8192EU, RTL8812AU and RTL8821AU chip based USB WiFi adapters. From owner-svn-src-all@freebsd.org Thu Jan 3 07:42:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF207141B750; Thu, 3 Jan 2019 07:42:33 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A24B8E609; Thu, 3 Jan 2019 07:42:33 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42F821E2E8; Thu, 3 Jan 2019 07:42:33 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x037gXSa064778; Thu, 3 Jan 2019 07:42:33 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x037gXrf064777; Thu, 3 Jan 2019 07:42:33 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201901030742.x037gXrf064777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Thu, 3 Jan 2019 07:42: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: r342715 - stable/12/sys/dev/mrsas X-SVN-Group: stable-12 X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: stable/12/sys/dev/mrsas X-SVN-Commit-Revision: 342715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A24B8E609 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 07:42:34 -0000 Author: kadesai Date: Thu Jan 3 07:42:32 2019 New Revision: 342715 URL: https://svnweb.freebsd.org/changeset/base/342715 Log: MFC r342059-r342069 r342059 This patch will add support for next generation(SAS3.5) of Tri mode(SAS, SATA, NVMe) MegaRAID adapters. r342060 This patch will add support for new Dynamic RaidMap to have different sizes for different number of supported VDs for SAS3.5 MegaRAID adapters. r342061 This patch will add support for divert bitmap in RAID map. Divert bitmap is supported for SAS3.5 adapters only. r342062 This patch will add new interface to support more than 256 JBODs. r342063 Detect sequential Write IOs and pass the hint that it is part of sequential stream to help HBA Firmware do the Full Stripe Writes. For read IOs on certain RAID volumes like Read Ahead volumes,this will help driver to send it to Firmware even if the IOs can potentially be sent to hardware directly (called fast path) bypassing firmware. Design: 8 streams are maintained per RAID volume as per the combined firmware/driver design. When there is no stream detected the LRU stream is used for next potential stream and LRU/MRU map is updated to make this as MRU stream. Every time a stream is detected the MRU map is updated to make the current stream as MRU stream. r342064 To improve RAID 1/10 Write performance, OS drivers need to issue the required Write IOs as Fast Path IOs (after the appropriate checks allowing Fast Path to be used) to the appropriate physical drives (translated from the OS logical IO) and wait for all Write IOs to complete. Design: A write IO on RAID volume will be examined if it can be sent in Fast Path based on IO size and starting LBA and ending LBA falling on to a Physical Drive boundary. If the underlying RAID volume is a RAID 1/10, driver issues two fast path write IOs one for each corresponding physical drive after computing the corresponding start LBA for each physical drive. Both write IOs will have the same payload and are posted to HW such that replies land in the same reply queue. If there are no resources available for sending two IOs, driver will send the original IO from upper layer to RAID volume through the Firmware. When both IOs are completed by HW, the resources will be released and SCSI IO completion handler will be called. r342065 This patch will add support for new DCMD to get PD information and a single data structure to specify LD and JBOD. r342066 This patch will add support for NVME PRPs creation by driver for fastpath capable IOs. NVME specification supports specific type of scatter gather list called as PRP (Physical Region Page) for IO data buffers. Since NVME drive is connected behind SAS3.5 tri-mode adapter, MegaRAID driver/firmware has to convert OS SGLs in native NVMe PRP format. For IOs sent to firmware, MegaRAID firmware does this job of OS SGLs to PRP translation and send PRPs to backend NVME device. For fastpath IOs, driver will do this OS SGLs to PRP translation. r342067 Change IOC INIT wait time to 180 secs to keep it inline with timeout used by internal DCMDs. r342068 This patch will increase debug level as current logging level has very minimal prints and even few important messages will not get logged. r342069 Driver version upgrade 07.708.02.00-fbsd Modified: stable/12/sys/dev/mrsas/mrsas.c stable/12/sys/dev/mrsas/mrsas.h stable/12/sys/dev/mrsas/mrsas_cam.c stable/12/sys/dev/mrsas/mrsas_fp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/12/sys/dev/mrsas/mrsas.c Thu Jan 3 03:27:37 2019 (r342714) +++ stable/12/sys/dev/mrsas/mrsas.c Thu Jan 3 07:42:32 2019 (r342715) @@ -90,6 +90,8 @@ static void mrsas_update_ext_vd_details(struct mrsas_s static int mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd_to_abort); +static void +mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id); static struct mrsas_softc * mrsas_get_softc_instance(struct cdev *dev, u_long cmd, caddr_t arg); @@ -141,9 +143,6 @@ void mrsas_free_ctlr_info_cmd(struct mrsas_softc *sc); void mrsas_complete_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd, u_int8_t status); -void -mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, - u_int8_t extStatus); struct mrsas_mfi_cmd *mrsas_get_mfi_cmd(struct mrsas_softc *sc); MRSAS_REQUEST_DESCRIPTOR_UNION *mrsas_build_mpt_cmd @@ -167,7 +166,13 @@ mrsas_get_request_desc(struct mrsas_softc *sc, extern int mrsas_bus_scan_sim(struct mrsas_softc *sc, struct cam_sim *sim); static int mrsas_alloc_evt_log_info_cmd(struct mrsas_softc *sc); static void mrsas_free_evt_log_info_cmd(struct mrsas_softc *sc); +void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); +void mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, + union ccb *ccb_ptr, u_int8_t status, u_int8_t extStatus, + u_int32_t data_length, u_int8_t *sense); + + SYSCTL_NODE(_hw, OID_AUTO, mrsas, CTLFLAG_RD, 0, "MRSAS Driver Parameters"); /* @@ -190,6 +195,12 @@ MRSAS_CTLR_ID device_table[] = { {0x1000, MRSAS_INTRUDER_24, 0xffff, 0xffff, "AVAGO Intruder_24 SAS Controller"}, {0x1000, MRSAS_CUTLASS_52, 0xffff, 0xffff, "AVAGO Cutlass_52 SAS Controller"}, {0x1000, MRSAS_CUTLASS_53, 0xffff, 0xffff, "AVAGO Cutlass_53 SAS Controller"}, + {0x1000, MRSAS_VENTURA, 0xffff, 0xffff, "AVAGO Ventura SAS Controller"}, + {0x1000, MRSAS_CRUSADER, 0xffff, 0xffff, "AVAGO Crusader SAS Controller"}, + {0x1000, MRSAS_HARPOON, 0xffff, 0xffff, "AVAGO Harpoon SAS Controller"}, + {0x1000, MRSAS_TOMCAT, 0xffff, 0xffff, "AVAGO Tomcat SAS Controller"}, + {0x1000, MRSAS_VENTURA_4PORT, 0xffff, 0xffff, "AVAGO Ventura_4Port SAS Controller"}, + {0x1000, MRSAS_CRUSADER_4PORT, 0xffff, 0xffff, "AVAGO Crusader_4Port SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -436,7 +447,16 @@ mrsas_setup_sysctl(struct mrsas_softc *sc) OID_AUTO, "block_sync_cache", CTLFLAG_RW, &sc->block_sync_cache, 0, "Block SYNC CACHE at driver. "); - + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "stream detection", CTLFLAG_RW, + &sc->drv_stream_detection, 0, + "Disable/Enable Stream detection. "); + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "prp_count", CTLFLAG_RD, + &sc->prp_count.val_rdonly, 0, "Number of IOs for which PRPs are built"); + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "SGE holes", CTLFLAG_RD, + &sc->sge_holes.val_rdonly, 0, "Number of IOs with holes in SGEs"); } /* @@ -451,12 +471,14 @@ mrsas_get_tunables(struct mrsas_softc *sc) char tmpstr[80]; /* XXX default to some debugging for now */ - sc->mrsas_debug = MRSAS_FAULT; + sc->mrsas_debug = + (MRSAS_FAULT | MRSAS_OCR | MRSAS_INFO | MRSAS_TRACE | MRSAS_AEN); sc->mrsas_io_timeout = MRSAS_IO_TIMEOUT; sc->mrsas_fw_fault_check_delay = 1; sc->reset_count = 0; sc->reset_in_progress = 0; sc->block_sync_cache = 0; + sc->drv_stream_detection = 1; /* * Grab the global variables. @@ -815,7 +837,7 @@ static int mrsas_attach(device_t dev) { struct mrsas_softc *sc = device_get_softc(dev); - uint32_t cmd, bar, error; + uint32_t cmd, error; memset(sc, 0, sizeof(struct mrsas_softc)); @@ -830,7 +852,14 @@ mrsas_attach(device_t dev) (sc->device_id == MRSAS_CUTLASS_52) || (sc->device_id == MRSAS_CUTLASS_53)) { sc->mrsas_gen3_ctrl = 1; - } + } else if ((sc->device_id == MRSAS_VENTURA) || + (sc->device_id == MRSAS_CRUSADER) || + (sc->device_id == MRSAS_HARPOON) || + (sc->device_id == MRSAS_TOMCAT) || + (sc->device_id == MRSAS_VENTURA_4PORT) || + (sc->device_id == MRSAS_CRUSADER_4PORT)) { + sc->is_ventura = true; + } mrsas_get_tunables(sc); @@ -845,9 +874,12 @@ mrsas_attach(device_t dev) cmd |= PCIM_CMD_BUSMASTEREN; pci_write_config(dev, PCIR_COMMAND, cmd, 2); - bar = pci_read_config(dev, MRSAS_PCI_BAR1, 4); + /* For Ventura system registers are mapped to BAR0 */ + if (sc->is_ventura) + sc->reg_res_id = PCIR_BAR(0); /* BAR0 offset */ + else + sc->reg_res_id = PCIR_BAR(1); /* BAR1 offset */ - sc->reg_res_id = MRSAS_PCI_BAR1;/* BAR1 offset */ if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &(sc->reg_res_id), RF_ACTIVE)) == NULL) { @@ -866,6 +898,7 @@ mrsas_attach(device_t dev) mtx_init(&sc->mpt_cmd_pool_lock, "mrsas_mpt_cmd_pool_lock", NULL, MTX_DEF); mtx_init(&sc->mfi_cmd_pool_lock, "mrsas_mfi_cmd_pool_lock", NULL, MTX_DEF); mtx_init(&sc->raidmap_lock, "mrsas_raidmap_lock", NULL, MTX_DEF); + mtx_init(&sc->stream_lock, "mrsas_stream_lock", NULL, MTX_DEF); /* Intialize linked list */ TAILQ_INIT(&sc->mrsas_mpt_cmd_list_head); @@ -873,6 +906,8 @@ mrsas_attach(device_t dev) mrsas_atomic_set(&sc->fw_outstanding, 0); mrsas_atomic_set(&sc->target_reset_outstanding, 0); + mrsas_atomic_set(&sc->prp_count, 0); + mrsas_atomic_set(&sc->sge_holes, 0); sc->io_cmds_highwater = 0; @@ -932,6 +967,7 @@ attach_fail_fw: mtx_destroy(&sc->mpt_cmd_pool_lock); mtx_destroy(&sc->mfi_cmd_pool_lock); mtx_destroy(&sc->raidmap_lock); + mtx_destroy(&sc->stream_lock); attach_fail: if (sc->reg_res) { bus_release_resource(sc->mrsas_dev, SYS_RES_MEMORY, @@ -946,6 +982,7 @@ attach_fail: static void mrsas_ich_startup(void *arg) { + int i = 0; struct mrsas_softc *sc = (struct mrsas_softc *)arg; /* @@ -981,6 +1018,13 @@ mrsas_ich_startup(void *arg) /* Enable Interrupts */ mrsas_enable_intr(sc); + /* Call DCMD get_pd_info for all system PDs */ + for (i = 0; i < MRSAS_MAX_PD; i++) { + if ((sc->target_list[i].target_id != 0xffff) && + sc->pd_info_mem) + mrsas_get_pd_info(sc, sc->target_list[i].target_id); + } + /* Initiate AEN (Asynchronous Event Notification) */ if (mrsas_start_aen(sc)) { device_printf(sc->mrsas_dev, "Error: AEN registration FAILED !!! " @@ -1054,6 +1098,14 @@ mrsas_detach(device_t dev) mrsas_flush_cache(sc); mrsas_shutdown_ctlr(sc, MR_DCMD_CTRL_SHUTDOWN); mrsas_disable_intr(sc); + + if (sc->is_ventura && sc->streamDetectByLD) { + for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) + free(sc->streamDetectByLD[i], M_MRSAS); + free(sc->streamDetectByLD, M_MRSAS); + sc->streamDetectByLD = NULL; + } + mrsas_cam_detach(sc); mrsas_teardown_intr(sc); mrsas_free_mem(sc); @@ -1065,6 +1117,7 @@ mrsas_detach(device_t dev) mtx_destroy(&sc->mpt_cmd_pool_lock); mtx_destroy(&sc->mfi_cmd_pool_lock); mtx_destroy(&sc->raidmap_lock); + mtx_destroy(&sc->stream_lock); /* Wait for all the semaphores to be released */ while (sema_value(&sc->ioctl_count_sema) != MRSAS_MAX_IOCTL_CMDS) @@ -1094,7 +1147,7 @@ void mrsas_free_mem(struct mrsas_softc *sc) { int i; - u_int32_t max_cmd; + u_int32_t max_fw_cmds; struct mrsas_mfi_cmd *mfi_cmd; struct mrsas_mpt_cmd *mpt_cmd; @@ -1182,6 +1235,16 @@ mrsas_free_mem(struct mrsas_softc *sc) bus_dma_tag_destroy(sc->evt_detail_tag); /* + * Free PD info memory + */ + if (sc->pd_info_phys_addr) + bus_dmamap_unload(sc->pd_info_tag, sc->pd_info_dmamap); + if (sc->pd_info_mem != NULL) + bus_dmamem_free(sc->pd_info_tag, sc->pd_info_mem, sc->pd_info_dmamap); + if (sc->pd_info_tag != NULL) + bus_dma_tag_destroy(sc->pd_info_tag); + + /* * Free MFI frames */ if (sc->mfi_cmd_list) { @@ -1196,9 +1259,9 @@ mrsas_free_mem(struct mrsas_softc *sc) /* * Free MPT internal command list */ - max_cmd = sc->max_fw_cmds; + max_fw_cmds = sc->max_fw_cmds; if (sc->mpt_cmd_list) { - for (i = 0; i < max_cmd; i++) { + for (i = 0; i < max_fw_cmds; i++) { mpt_cmd = sc->mpt_cmd_list[i]; bus_dmamap_destroy(sc->data_tag, mpt_cmd->data_dmamap); free(sc->mpt_cmd_list[i], M_MRSAS); @@ -1538,14 +1601,14 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M Mpi2ReplyDescriptorsUnion_t *desc; MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR *reply_desc; MRSAS_RAID_SCSI_IO_REQUEST *scsi_io_req; - struct mrsas_mpt_cmd *cmd_mpt; + struct mrsas_mpt_cmd *cmd_mpt, *r1_cmd = NULL; struct mrsas_mfi_cmd *cmd_mfi; - u_int8_t reply_descript_type; + u_int8_t reply_descript_type, *sense; u_int16_t smid, num_completed; u_int8_t status, extStatus; union desc_value desc_val; PLD_LOAD_BALANCE_INFO lbinfo; - u_int32_t device_id; + u_int32_t device_id, data_length; int threshold_reply_count = 0; #if TM_DEBUG MR_TASK_MANAGE_REQUEST *mr_tm_req; @@ -1573,8 +1636,10 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M cmd_mpt = sc->mpt_cmd_list[smid - 1]; scsi_io_req = (MRSAS_RAID_SCSI_IO_REQUEST *) cmd_mpt->io_request; - status = scsi_io_req->RaidContext.status; - extStatus = scsi_io_req->RaidContext.exStatus; + status = scsi_io_req->RaidContext.raid_context.status; + extStatus = scsi_io_req->RaidContext.raid_context.exStatus; + sense = cmd_mpt->sense; + data_length = scsi_io_req->DataLength; switch (scsi_io_req->Function) { case MPI2_FUNCTION_SCSI_TASK_MGMT: @@ -1590,16 +1655,45 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M case MPI2_FUNCTION_SCSI_IO_REQUEST: /* Fast Path IO. */ device_id = cmd_mpt->ccb_ptr->ccb_h.target_id; lbinfo = &sc->load_balance_info[device_id]; + /* R1 load balancing for READ */ if (cmd_mpt->load_balance == MRSAS_LOAD_BALANCE_FLAG) { mrsas_atomic_dec(&lbinfo->scsi_pending_cmds[cmd_mpt->pd_r1_lb]); cmd_mpt->load_balance &= ~MRSAS_LOAD_BALANCE_FLAG; } /* Fall thru and complete IO */ case MRSAS_MPI2_FUNCTION_LD_IO_REQUEST: - mrsas_map_mpt_cmd_status(cmd_mpt, status, extStatus); - mrsas_cmd_done(sc, cmd_mpt); - scsi_io_req->RaidContext.status = 0; - scsi_io_req->RaidContext.exStatus = 0; + if (cmd_mpt->r1_alt_dev_handle == MR_DEVHANDLE_INVALID) { + mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, + extStatus, data_length, sense); + mrsas_cmd_done(sc, cmd_mpt); + } else { + /* + * If the peer Raid 1/10 fast path failed, + * mark IO as failed to the scsi layer. + * Overwrite the current status by the failed status + * and make sure that if any command fails, + * driver returns fail status to CAM. + */ + cmd_mpt->cmd_completed = 1; + r1_cmd = cmd_mpt->peer_cmd; + if (r1_cmd->cmd_completed) { + if (r1_cmd->io_request->RaidContext.raid_context.status != MFI_STAT_OK) { + status = r1_cmd->io_request->RaidContext.raid_context.status; + extStatus = r1_cmd->io_request->RaidContext.raid_context.exStatus; + data_length = r1_cmd->io_request->DataLength; + sense = r1_cmd->sense; + } + r1_cmd->ccb_ptr = NULL; + if (r1_cmd->callout_owner) { + callout_stop(&r1_cmd->cm_callout); + r1_cmd->callout_owner = false; + } + mrsas_release_mpt_cmd(r1_cmd); + mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, + extStatus, data_length, sense); + mrsas_cmd_done(sc, cmd_mpt); + } + } mrsas_atomic_dec(&sc->fw_outstanding); break; case MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST: /* MFI command */ @@ -1648,7 +1742,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M */ if (threshold_reply_count >= THRESHOLD_REPLY_COUNT) { if (sc->msix_enable) { - if (sc->mrsas_gen3_ctrl) + if (sc->msix_combined) mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1669,7 +1763,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M /* Clear response interrupt */ if (sc->msix_enable) { - if (sc->mrsas_gen3_ctrl) { + if (sc->msix_combined) { mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1692,40 +1786,41 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M * CCB. */ void -mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, u_int8_t extStatus) +mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, union ccb *ccb_ptr, u_int8_t status, + u_int8_t extStatus, u_int32_t data_length, u_int8_t *sense) { struct mrsas_softc *sc = cmd->sc; u_int8_t *sense_data; switch (status) { case MFI_STAT_OK: - cmd->ccb_ptr->ccb_h.status = CAM_REQ_CMP; + ccb_ptr->ccb_h.status = CAM_REQ_CMP; break; case MFI_STAT_SCSI_IO_FAILED: case MFI_STAT_SCSI_DONE_WITH_ERROR: - cmd->ccb_ptr->ccb_h.status = CAM_SCSI_STATUS_ERROR; - sense_data = (u_int8_t *)&cmd->ccb_ptr->csio.sense_data; + ccb_ptr->ccb_h.status = CAM_SCSI_STATUS_ERROR; + sense_data = (u_int8_t *)&ccb_ptr->csio.sense_data; if (sense_data) { /* For now just copy 18 bytes back */ - memcpy(sense_data, cmd->sense, 18); - cmd->ccb_ptr->csio.sense_len = 18; - cmd->ccb_ptr->ccb_h.status |= CAM_AUTOSNS_VALID; + memcpy(sense_data, sense, 18); + ccb_ptr->csio.sense_len = 18; + ccb_ptr->ccb_h.status |= CAM_AUTOSNS_VALID; } break; case MFI_STAT_LD_OFFLINE: case MFI_STAT_DEVICE_NOT_FOUND: - if (cmd->ccb_ptr->ccb_h.target_lun) - cmd->ccb_ptr->ccb_h.status |= CAM_LUN_INVALID; + if (ccb_ptr->ccb_h.target_lun) + ccb_ptr->ccb_h.status |= CAM_LUN_INVALID; else - cmd->ccb_ptr->ccb_h.status |= CAM_DEV_NOT_THERE; + ccb_ptr->ccb_h.status |= CAM_DEV_NOT_THERE; break; case MFI_STAT_CONFIG_SEQ_MISMATCH: - cmd->ccb_ptr->ccb_h.status |= CAM_REQUEUE_REQ; + ccb_ptr->ccb_h.status |= CAM_REQUEUE_REQ; break; default: device_printf(sc->mrsas_dev, "FW cmd complete status %x\n", status); - cmd->ccb_ptr->ccb_h.status = CAM_REQ_CMP_ERR; - cmd->ccb_ptr->csio.scsi_status = status; + ccb_ptr->ccb_h.status = CAM_REQ_CMP_ERR; + ccb_ptr->csio.scsi_status = status; } return; } @@ -1741,8 +1836,8 @@ mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_ static int mrsas_alloc_mem(struct mrsas_softc *sc) { - u_int32_t verbuf_size, io_req_size, reply_desc_size, sense_size, - chain_frame_size, evt_detail_size, count; + u_int32_t verbuf_size, io_req_size, reply_desc_size, sense_size, chain_frame_size, + evt_detail_size, count, pd_info_size; /* * Allocate parent DMA tag @@ -1912,6 +2007,7 @@ mrsas_alloc_mem(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Cannot load sense buf memory\n"); return (ENOMEM); } + /* * Allocate for Event detail structure */ @@ -1942,7 +2038,39 @@ mrsas_alloc_mem(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Cannot load Event detail buffer memory\n"); return (ENOMEM); } + /* + * Allocate for PD INFO structure + */ + pd_info_size = sizeof(struct mrsas_pd_info); + if (bus_dma_tag_create(sc->mrsas_parent_tag, + 1, 0, + BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR, + NULL, NULL, + pd_info_size, + 1, + pd_info_size, + BUS_DMA_ALLOCNOW, + NULL, NULL, + &sc->pd_info_tag)) { + device_printf(sc->mrsas_dev, "Cannot create PD INFO tag\n"); + return (ENOMEM); + } + if (bus_dmamem_alloc(sc->pd_info_tag, (void **)&sc->pd_info_mem, + BUS_DMA_NOWAIT, &sc->pd_info_dmamap)) { + device_printf(sc->mrsas_dev, "Cannot alloc PD INFO buffer memory\n"); + return (ENOMEM); + } + bzero(sc->pd_info_mem, pd_info_size); + if (bus_dmamap_load(sc->pd_info_tag, sc->pd_info_dmamap, + sc->pd_info_mem, pd_info_size, mrsas_addr_cb, + &sc->pd_info_phys_addr, BUS_DMA_NOWAIT)) { + device_printf(sc->mrsas_dev, "Cannot load PD INFO buffer memory\n"); + return (ENOMEM); + } + + /* * Create a dma tag for data buffers; size will be the maximum * possible I/O size (280kB). */ @@ -2147,15 +2275,25 @@ mrsas_init_fw(struct mrsas_softc *sc) u_int32_t max_sectors_1; u_int32_t max_sectors_2; u_int32_t tmp_sectors; - u_int32_t scratch_pad_2; + u_int32_t scratch_pad_2, scratch_pad_3, scratch_pad_4; int msix_enable = 0; int fw_msix_count = 0; + int i, j; /* Make sure Firmware is ready */ ret = mrsas_transition_to_ready(sc, ocr); if (ret != SUCCESS) { return (ret); } + if (sc->is_ventura) { + scratch_pad_3 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_3)); +#if VD_EXT_DEBUG + device_printf(sc->mrsas_dev, "scratch_pad_3 0x%x\n", scratch_pad_3); +#endif + sc->maxRaidMapSize = ((scratch_pad_3 >> + MR_MAX_RAID_MAP_SIZE_OFFSET_SHIFT) & + MR_MAX_RAID_MAP_SIZE_MASK); + } /* MSI-x index 0- reply post host index register */ sc->msix_reg_offset[0] = MPI2_REPLY_POST_HOST_INDEX_OFFSET; /* Check if MSI-X is supported while in ready state */ @@ -2177,6 +2315,15 @@ mrsas_init_fw(struct mrsas_softc *sc) >> MR_MAX_REPLY_QUEUES_EXT_OFFSET_SHIFT) + 1; fw_msix_count = sc->msix_vectors; + if ((sc->mrsas_gen3_ctrl && (sc->msix_vectors > 8)) || + (sc->is_ventura && (sc->msix_vectors > 16))) + sc->msix_combined = true; + /* + * Save 1-15 reply post index + * address to local memory Index 0 + * is already saved from reg offset + * MPI2_REPLY_POST_HOST_INDEX_OFFSET + */ for (loop = 1; loop < MR_MAX_MSIX_REG_ARRAY; loop++) { sc->msix_reg_offset[loop] = @@ -2199,10 +2346,28 @@ mrsas_init_fw(struct mrsas_softc *sc) "Online CPU %d Current MSIX <%d>\n", fw_msix_count, mp_ncpus, sc->msix_vectors); } + /* + * MSI-X host index 0 is common for all adapter. + * It is used for all MPT based Adapters. + */ + if (sc->msix_combined) { + sc->msix_reg_offset[0] = + MPI2_SUP_REPLY_POST_HOST_INDEX_OFFSET; + } if (mrsas_init_adapter(sc) != SUCCESS) { device_printf(sc->mrsas_dev, "Adapter initialize Fail.\n"); return (1); } + + if (sc->is_ventura) { + scratch_pad_4 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + outbound_scratch_pad_4)); + if ((scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK) >= MR_DEFAULT_NVME_PAGE_SHIFT) + sc->nvme_page_size = 1 << (scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK); + + device_printf(sc->mrsas_dev, "NVME page size\t: (%d)\n", sc->nvme_page_size); + } + /* Allocate internal commands for pass-thru */ if (mrsas_alloc_mfi_cmds(sc) != SUCCESS) { device_printf(sc->mrsas_dev, "Allocate MFI cmd failed.\n"); @@ -2230,6 +2395,9 @@ mrsas_init_fw(struct mrsas_softc *sc) if (sc->use_seqnum_jbod_fp) device_printf(sc->mrsas_dev, "FW supports JBOD Map \n"); + if (sc->support_morethan256jbod) + device_printf(sc->mrsas_dev, "FW supports JBOD Map Ext \n"); + if (mrsas_setup_raidmap(sc) != SUCCESS) { device_printf(sc->mrsas_dev, "Error: RAID map setup FAILED !!! " "There seems to be some problem in the controller\n" @@ -2237,6 +2405,12 @@ mrsas_init_fw(struct mrsas_softc *sc) } megasas_setup_jbod_map(sc); + + memset(sc->target_list, 0, + MRSAS_MAX_TM_TARGETS * sizeof(struct mrsas_target)); + for (i = 0; i < MRSAS_MAX_TM_TARGETS; i++) + sc->target_list[i].target_id = 0xffff; + /* For pass-thru, get PD/LD list and controller info */ memset(sc->pd_list, 0, MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); @@ -2249,6 +2423,30 @@ mrsas_init_fw(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Get LD lsit failed.\n"); return (1); } + + if (sc->is_ventura && sc->drv_stream_detection) { + sc->streamDetectByLD = malloc(sizeof(PTR_LD_STREAM_DETECT) * + MAX_LOGICAL_DRIVES_EXT, M_MRSAS, M_NOWAIT); + if (!sc->streamDetectByLD) { + device_printf(sc->mrsas_dev, + "unable to allocate stream detection for pool of LDs\n"); + return (1); + } + for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) { + sc->streamDetectByLD[i] = malloc(sizeof(LD_STREAM_DETECT), M_MRSAS, M_NOWAIT); + if (!sc->streamDetectByLD[i]) { + device_printf(sc->mrsas_dev, "unable to allocate stream detect by LD\n"); + for (j = 0; j < i; ++j) + free(sc->streamDetectByLD[j], M_MRSAS); + free(sc->streamDetectByLD, M_MRSAS); + sc->streamDetectByLD = NULL; + return (1); + } + memset(sc->streamDetectByLD[i], 0, sizeof(LD_STREAM_DETECT)); + sc->streamDetectByLD[i]->mruBitMap = MR_STREAM_BITMAP; + } + } + /* * Compute the max allowed sectors per IO: The controller info has * two limits on max sectors. Driver should use the minimum of these @@ -2298,25 +2496,26 @@ int mrsas_init_adapter(struct mrsas_softc *sc) { uint32_t status; - u_int32_t max_cmd, scratch_pad_2; + u_int32_t scratch_pad_2; int ret; int i = 0; /* Read FW status register */ status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); - /* Get operational params from status register */ sc->max_fw_cmds = status & MRSAS_FWSTATE_MAXCMD_MASK; /* Decrement the max supported by 1, to correlate with FW */ sc->max_fw_cmds = sc->max_fw_cmds - 1; - max_cmd = sc->max_fw_cmds; + sc->max_scsi_cmds = sc->max_fw_cmds - + (MRSAS_FUSION_INT_CMDS + MRSAS_MAX_IOCTL_CMDS); /* Determine allocation size of command frames */ - sc->reply_q_depth = ((max_cmd + 1 + 15) / 16 * 16) * 2; - sc->request_alloc_sz = sizeof(MRSAS_REQUEST_DESCRIPTOR_UNION) * max_cmd; + sc->reply_q_depth = ((sc->max_fw_cmds + 1 + 15) / 16 * 16) * 2; + sc->request_alloc_sz = sizeof(MRSAS_REQUEST_DESCRIPTOR_UNION) * sc->max_fw_cmds; sc->reply_alloc_sz = sizeof(MPI2_REPLY_DESCRIPTORS_UNION) * (sc->reply_q_depth); - sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (max_cmd + 1)); + sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1)); scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); /* @@ -2334,15 +2533,17 @@ mrsas_init_adapter(struct mrsas_softc *sc) ((scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_MASK) >> 5) * MEGASAS_256K_IO; - sc->chain_frames_alloc_sz = sc->max_chain_frame_sz * max_cmd; + sc->chain_frames_alloc_sz = sc->max_chain_frame_sz * sc->max_fw_cmds; sc->max_sge_in_main_msg = (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE - offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL)) / 16; sc->max_sge_in_chain = sc->max_chain_frame_sz / sizeof(MPI2_SGE_IO_UNION); sc->max_num_sge = sc->max_sge_in_main_msg + sc->max_sge_in_chain - 2; - mrsas_dprint(sc, MRSAS_INFO, "Avago Debug: MAX sge 0x%X MAX chain frame size 0x%X \n", - sc->max_num_sge, sc->max_chain_frame_sz); + mrsas_dprint(sc, MRSAS_INFO, + "max sge: 0x%x, max chain frame size: 0x%x, " + "max fw cmd: 0x%x\n", sc->max_num_sge, + sc->max_chain_frame_sz, sc->max_fw_cmds); /* Used for pass thru MFI frame (DCMD) */ sc->chain_offset_mfi_pthru = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 16; @@ -2441,7 +2642,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) struct mrsas_init_frame *init_frame; pMpi2IOCInitRequest_t IOCInitMsg; MRSAS_REQUEST_DESCRIPTOR_UNION req_desc; - u_int8_t max_wait = MRSAS_IOC_INIT_WAIT_TIME; + u_int8_t max_wait = MRSAS_INTERNAL_CMD_WAIT_TIME; bus_addr_t phys_addr; int i, retcode = 0; u_int32_t scratch_pad_2; @@ -2469,6 +2670,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) IOCInitMsg->ReplyDescriptorPostQueueAddress = sc->reply_desc_phys_addr; IOCInitMsg->SystemRequestFrameBaseAddress = sc->io_request_phys_addr; IOCInitMsg->HostMSIxVectors = (sc->msix_vectors > 0 ? sc->msix_vectors : 0); + IOCInitMsg->HostPageSize = MR_DEFAULT_NVME_PAGE_SHIFT; init_frame = (struct mrsas_init_frame *)sc->ioc_init_mem; init_frame->cmd = MFI_CMD_INIT; @@ -2476,7 +2678,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; /* driver support Extended MSIX */ - if (sc->mrsas_gen3_ctrl) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -2545,14 +2747,14 @@ int mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) { int i, j; - u_int32_t max_cmd, count; + u_int32_t max_fw_cmds, count; struct mrsas_mpt_cmd *cmd; pMpi2ReplyDescriptorsUnion_t reply_desc; u_int32_t offset, chain_offset, sense_offset; bus_addr_t io_req_base_phys, chain_frame_base_phys, sense_base_phys; u_int8_t *io_req_base, *chain_frame_base, *sense_base; - max_cmd = sc->max_fw_cmds; + max_fw_cmds = sc->max_fw_cmds; sc->req_desc = malloc(sc->request_alloc_sz, M_MRSAS, M_NOWAIT); if (!sc->req_desc) { @@ -2566,13 +2768,14 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) * Allocate the dynamic array first and then allocate individual * commands. */ - sc->mpt_cmd_list = malloc(sizeof(struct mrsas_mpt_cmd *) * max_cmd, M_MRSAS, M_NOWAIT); + sc->mpt_cmd_list = malloc(sizeof(struct mrsas_mpt_cmd *) * max_fw_cmds, + M_MRSAS, M_NOWAIT); if (!sc->mpt_cmd_list) { device_printf(sc->mrsas_dev, "Cannot alloc memory for mpt_cmd_list.\n"); return (ENOMEM); } - memset(sc->mpt_cmd_list, 0, sizeof(struct mrsas_mpt_cmd *) * max_cmd); - for (i = 0; i < max_cmd; i++) { + memset(sc->mpt_cmd_list, 0, sizeof(struct mrsas_mpt_cmd *) * max_fw_cmds); + for (i = 0; i < max_fw_cmds; i++) { sc->mpt_cmd_list[i] = malloc(sizeof(struct mrsas_mpt_cmd), M_MRSAS, M_NOWAIT); if (!sc->mpt_cmd_list[i]) { @@ -2590,7 +2793,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) chain_frame_base_phys = (bus_addr_t)sc->chain_frame_phys_addr; sense_base = (u_int8_t *)sc->sense_mem; sense_base_phys = (bus_addr_t)sc->sense_phys_addr; - for (i = 0; i < max_cmd; i++) { + for (i = 0; i < max_fw_cmds; i++) { cmd = sc->mpt_cmd_list[i]; offset = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * i; chain_offset = sc->max_chain_frame_sz * i; @@ -2598,6 +2801,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) memset(cmd, 0, sizeof(struct mrsas_mpt_cmd)); cmd->index = i + 1; cmd->ccb_ptr = NULL; + cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; callout_init_mtx(&cmd->cm_callout, &sc->sim_lock, 0); cmd->sync_cmd_idx = (u_int32_t)MRSAS_ULONG_MAX; cmd->sc = sc; @@ -2949,13 +3153,27 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese mtx_unlock(&sc->sim_lock); for (i = 0; i < sc->max_fw_cmds; i++) { mpt_cmd = sc->mpt_cmd_list[i]; + + if (mpt_cmd->peer_cmd) { + mrsas_dprint(sc, MRSAS_OCR, + "R1 FP command [%d] - (mpt_cmd) %p, (peer_cmd) %p\n", + i, mpt_cmd, mpt_cmd->peer_cmd); + } + if (mpt_cmd->ccb_ptr) { - ccb = (union ccb *)(mpt_cmd->ccb_ptr); - ccb->ccb_h.status = CAM_SCSI_BUS_RESET; - mrsas_cmd_done(sc, mpt_cmd); - mrsas_atomic_dec(&sc->fw_outstanding); + if (mpt_cmd->callout_owner) { + ccb = (union ccb *)(mpt_cmd->ccb_ptr); + ccb->ccb_h.status = CAM_SCSI_BUS_RESET; + mrsas_cmd_done(sc, mpt_cmd); + } else { + mpt_cmd->ccb_ptr = NULL; + mrsas_release_mpt_cmd(mpt_cmd); + } } } + + mrsas_atomic_set(&sc->fw_outstanding, 0); + mtx_lock(&sc->sim_lock); status_reg = mrsas_read_reg(sc, offsetof(mrsas_reg_set, @@ -3088,6 +3306,13 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese megasas_setup_jbod_map(sc); + if (sc->is_ventura && sc->streamDetectByLD) { + for (j = 0; j < MAX_LOGICAL_DRIVES_EXT; ++j) { + memset(sc->streamDetectByLD[i], 0, sizeof(LD_STREAM_DETECT)); + sc->streamDetectByLD[i]->mruBitMap = MR_STREAM_BITMAP; + } + } + mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); mrsas_enable_intr(sc); sc->adprecovery = MRSAS_HBA_OPERATIONAL; @@ -3172,7 +3397,7 @@ mrsas_complete_outstanding_ioctls(struct mrsas_softc * if (cmd_mfi->sync_cmd && cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT) { for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) mrsas_complete_mptmfi_passthru(sc, cmd_mfi, - cmd_mpt->io_request->RaidContext.status); + cmd_mpt->io_request->RaidContext.raid_context.status); } } } @@ -3339,6 +3564,9 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) sc->use_seqnum_jbod_fp = sc->ctrl_info->adapterOperations3.useSeqNumJbodFP; + sc->support_morethan256jbod = + sc->ctrl_info->adapterOperations4.supportPdMapTargetId; + sc->disableOnlineCtrlReset = sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; @@ -3362,8 +3590,10 @@ dcmd_timeout: static void mrsas_update_ext_vd_details(struct mrsas_softc *sc) { + u_int32_t ventura_map_sz = 0; sc->max256vdSupport = - sc->ctrl_info->adapterOperations3.supportMaxExtLDs; + sc->ctrl_info->adapterOperations3.supportMaxExtLDs; + /* Below is additional check to address future FW enhancement */ if (sc->ctrl_info->max_lds > 64) sc->max256vdSupport = 1; @@ -3380,20 +3610,33 @@ mrsas_update_ext_vd_details(struct mrsas_softc *sc) sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; } - sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * - (sc->fw_supported_vd_count - 1)); - sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); - sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * - (sc->drv_supported_vd_count - 1)); + if (sc->maxRaidMapSize) { + ventura_map_sz = sc->maxRaidMapSize * + MR_MIN_MAP_SIZE; + sc->current_map_sz = ventura_map_sz; + sc->max_map_sz = ventura_map_sz; + } else { + sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * (sc->fw_supported_vd_count - 1)); + sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); + sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); + if (sc->max256vdSupport) + sc->current_map_sz = sc->new_map_sz; + else + sc->current_map_sz = sc->old_map_sz; + } - sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); - - if (sc->max256vdSupport) - sc->current_map_sz = sc->new_map_sz; - else - sc->current_map_sz = sc->old_map_sz; + sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP_ALL); +#if VD_EXT_DEBUG + device_printf(sc->mrsas_dev, "sc->maxRaidMapSize 0x%x \n", + sc->maxRaidMapSize); + device_printf(sc->mrsas_dev, + "new_map_sz = 0x%x, old_map_sz = 0x%x, " + "ventura_map_sz = 0x%x, current_map_sz = 0x%x " + "fusion->drv_map_sz =0x%x, size of driver raid map 0x%lx \n", + sc->new_map_sz, sc->old_map_sz, ventura_map_sz, + sc->current_map_sz, sc->drv_map_sz, sizeof(MR_DRV_RAID_MAP_ALL)); +#endif } /* @@ -3591,7 +3834,7 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, st io_req = mpt_cmd->io_request; - if (sc->mrsas_gen3_ctrl) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -4106,7 +4349,114 @@ mrsas_sync_map_info(struct mrsas_softc *sc) return (retcode); } +/* Input: dcmd.opcode - MR_DCMD_PD_GET_INFO + * dcmd.mbox.s[0] - deviceId for this physical drive + * dcmd.sge IN - ptr to returned MR_PD_INFO structure + * Desc: Firmware return the physical drive info structure + * + */ +static void +mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) +{ + int retcode; + u_int8_t do_ocr = 1; + struct mrsas_mfi_cmd *cmd; + struct mrsas_dcmd_frame *dcmd; + + cmd = mrsas_get_mfi_cmd(sc); + + if (!cmd) { + device_printf(sc->mrsas_dev, + "Cannot alloc for get PD info cmd\n"); + return; + } + dcmd = &cmd->frame->dcmd; + + memset(sc->pd_info_mem, 0, sizeof(struct mrsas_pd_info)); + memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); + + dcmd->mbox.s[0] = device_id; + dcmd->cmd = MFI_CMD_DCMD; + dcmd->cmd_status = 0xFF; + dcmd->sge_count = 1; + dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->timeout = 0; + dcmd->pad_0 = 0; + dcmd->data_xfer_len = sizeof(struct mrsas_pd_info); + dcmd->opcode = MR_DCMD_PD_GET_INFO; + dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->pd_info_phys_addr; + dcmd->sgl.sge32[0].length = sizeof(struct mrsas_pd_info); + + if (!sc->mask_interrupts) + retcode = mrsas_issue_blocked_cmd(sc, cmd); + else + retcode = mrsas_issue_polled(sc, cmd); + + if (retcode == ETIMEDOUT) + goto dcmd_timeout; + + sc->target_list[device_id].interface_type = + sc->pd_info_mem->state.ddf.pdType.intf; + + do_ocr = 0; + +dcmd_timeout: + + if (do_ocr) + sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; + + if (!sc->mask_interrupts) + mrsas_release_mfi_cmd(cmd); +} + /* + * mrsas_add_target: Add target ID of system PD/VD to driver's data structure. + * sc: Adapter's soft state + * target_id: Unique target id per controller(managed by driver) + * for system PDs- target ID ranges from 0 to (MRSAS_MAX_PD - 1) + * for VDs- target ID ranges from MRSAS_MAX_PD to MRSAS_MAX_TM_TARGETS + * return: void + * Descripton: This function will be called whenever system PD or VD is created. + */ +static void mrsas_add_target(struct mrsas_softc *sc, + u_int16_t target_id) +{ + sc->target_list[target_id].target_id = target_id; + + device_printf(sc->mrsas_dev, + "%s created target ID: 0x%x\n", + (target_id < MRSAS_MAX_PD ? "System PD" : "VD"), + (target_id < MRSAS_MAX_PD ? target_id : (target_id - MRSAS_MAX_PD))); + /* + * If interrupts are enabled, then only fire DCMD to get pd_info + * for system PDs + */ + if (!sc->mask_interrupts && sc->pd_info_mem && + (target_id < MRSAS_MAX_PD)) + mrsas_get_pd_info(sc, target_id); + +} + +/* + * mrsas_remove_target: Remove target ID of system PD/VD from driver's data structure. + * sc: Adapter's soft state + * target_id: Unique target id per controller(managed by driver) + * for system PDs- target ID ranges from 0 to (MRSAS_MAX_PD - 1) + * for VDs- target ID ranges from MRSAS_MAX_PD to MRSAS_MAX_TM_TARGETS + * return: void + * Descripton: This function will be called whenever system PD or VD is deleted + */ +static void mrsas_remove_target(struct mrsas_softc *sc, + u_int16_t target_id) +{ + sc->target_list[target_id].target_id = 0xffff; + device_printf(sc->mrsas_dev, + "%s deleted target ID: 0x%x\n", + (target_id < MRSAS_MAX_PD ? "System PD" : "VD"), + (target_id < MRSAS_MAX_PD ? target_id : (target_id - MRSAS_MAX_PD))); +} + +/* * mrsas_get_pd_list: Returns FW's PD list structure input: * Adapter soft state * @@ -4182,8 +4532,18 @@ mrsas_get_pd_list(struct mrsas_softc *sc) pd_addr->scsiDevType; sc->local_pd_list[pd_addr->deviceId].driveState = MR_PD_STATE_SYSTEM; + if (sc->target_list[pd_addr->deviceId].target_id == 0xffff) + mrsas_add_target(sc, pd_addr->deviceId); pd_addr++; } + for (pd_index = 0; pd_index < MRSAS_MAX_PD; pd_index++) { + if ((sc->local_pd_list[pd_index].driveState != + MR_PD_STATE_SYSTEM) && + (sc->target_list[pd_index].target_id != + 0xffff)) { + mrsas_remove_target(sc, pd_index); + } + } /* * Use mutext/spinlock if pd_list component size increase more than * 32 bit. @@ -4215,7 +4575,7 @@ dcmd_timeout: static int mrsas_get_ld_list(struct mrsas_softc *sc) { - int ld_list_size, retcode = 0, ld_index = 0, ids = 0; + int ld_list_size, retcode = 0, ld_index = 0, ids = 0, drv_tgt_id; u_int8_t do_ocr = 1; struct mrsas_mfi_cmd *cmd; struct mrsas_dcmd_frame *dcmd; @@ -4277,11 +4637,21 @@ mrsas_get_ld_list(struct mrsas_softc *sc) sc->CurLdCount = ld_list_mem->ldCount; memset(sc->ld_ids, 0xff, MAX_LOGICAL_DRIVES_EXT); for (ld_index = 0; ld_index < ld_list_mem->ldCount; ld_index++) { + ids = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; + drv_tgt_id = ids + MRSAS_MAX_PD; if (ld_list_mem->ldList[ld_index].state != 0) { - ids = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; sc->ld_ids[ids] = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; + if (sc->target_list[drv_tgt_id].target_id == + 0xffff) + mrsas_add_target(sc, drv_tgt_id); + } else { + if (sc->target_list[drv_tgt_id].target_id != + 0xffff) + mrsas_remove_target(sc, + drv_tgt_id); } } + do_ocr = 0; } dcmd_timeout: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jan 3 07:45:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E728C141B86B; Thu, 3 Jan 2019 07:45:52 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F7708E7A4; Thu, 3 Jan 2019 07:45:52 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 806A81E2EC; Thu, 3 Jan 2019 07:45:52 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x037jq0R065022; Thu, 3 Jan 2019 07:45:52 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x037jq3t065020; Thu, 3 Jan 2019 07:45:52 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201901030745.x037jq3t065020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Thu, 3 Jan 2019 07:45: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: r342716 - stable/11/sys/dev/mrsas X-SVN-Group: stable-11 X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: stable/11/sys/dev/mrsas X-SVN-Commit-Revision: 342716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F7708E7A4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 07:45:53 -0000 Author: kadesai Date: Thu Jan 3 07:45:52 2019 New Revision: 342716 URL: https://svnweb.freebsd.org/changeset/base/342716 Log: MFC r342059-r342069 r342059 This patch will add support for next generation(SAS3.5) of Tri mode(SAS, SATA, NVMe) MegaRAID adapters. r342060 This patch will add support for new Dynamic RaidMap to have different sizes for different number of supported VDs for SAS3.5 MegaRAID adapters. r342061 This patch will add support for divert bitmap in RAID map. Divert bitmap is supported for SAS3.5 adapters only. r342062 This patch will add new interface to support more than 256 JBODs. r342063 Detect sequential Write IOs and pass the hint that it is part of sequential stream to help HBA Firmware do the Full Stripe Writes. For read IOs on certain RAID volumes like Read Ahead volumes,this will help driver to send it to Firmware even if the IOs can potentially be sent to hardware directly (called fast path) bypassing firmware. Design: 8 streams are maintained per RAID volume as per the combined firmware/driver design. When there is no stream detected the LRU stream is used for next potential stream and LRU/MRU map is updated to make this as MRU stream. Every time a stream is detected the MRU map is updated to make the current stream as MRU stream. r342064 To improve RAID 1/10 Write performance, OS drivers need to issue the required Write IOs as Fast Path IOs (after the appropriate checks allowing Fast Path to be used) to the appropriate physical drives (translated from the OS logical IO) and wait for all Write IOs to complete. Design: A write IO on RAID volume will be examined if it can be sent in Fast Path based on IO size and starting LBA and ending LBA falling on to a Physical Drive boundary. If the underlying RAID volume is a RAID 1/10, driver issues two fast path write IOs one for each corresponding physical drive after computing the corresponding start LBA for each physical drive. Both write IOs will have the same payload and are posted to HW such that replies land in the same reply queue. If there are no resources available for sending two IOs, driver will send the original IO from upper layer to RAID volume through the Firmware. When both IOs are completed by HW, the resources will be released and SCSI IO completion handler will be called. r342065 This patch will add support for new DCMD to get PD information and a single data structure to specify LD and JBOD. r342066 This patch will add support for NVME PRPs creation by driver for fastpath capable IOs. NVME specification supports specific type of scatter gather list called as PRP (Physical Region Page) for IO data buffers. Since NVME drive is connected behind SAS3.5 tri-mode adapter, MegaRAID driver/firmware has to convert OS SGLs in native NVMe PRP format. For IOs sent to firmware, MegaRAID firmware does this job of OS SGLs to PRP translation and send PRPs to backend NVME device. For fastpath IOs, driver will do this OS SGLs to PRP translation. r342067 Change IOC INIT wait time to 180 secs to keep it inline with timeout used by internal DCMDs. r342068 This patch will increase debug level as current logging level has very minimal prints and even few important messages will not get logged. r342069 Driver version upgrade 07.708.02.00-fbsd Modified: stable/11/sys/dev/mrsas/mrsas.c stable/11/sys/dev/mrsas/mrsas.h stable/11/sys/dev/mrsas/mrsas_cam.c stable/11/sys/dev/mrsas/mrsas_fp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas.c Thu Jan 3 07:42:32 2019 (r342715) +++ stable/11/sys/dev/mrsas/mrsas.c Thu Jan 3 07:45:52 2019 (r342716) @@ -90,6 +90,8 @@ static void mrsas_update_ext_vd_details(struct mrsas_s static int mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd_to_abort); +static void +mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id); static struct mrsas_softc * mrsas_get_softc_instance(struct cdev *dev, u_long cmd, caddr_t arg); @@ -141,9 +143,6 @@ void mrsas_free_ctlr_info_cmd(struct mrsas_softc *sc); void mrsas_complete_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd, u_int8_t status); -void -mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, - u_int8_t extStatus); struct mrsas_mfi_cmd *mrsas_get_mfi_cmd(struct mrsas_softc *sc); MRSAS_REQUEST_DESCRIPTOR_UNION *mrsas_build_mpt_cmd @@ -167,7 +166,13 @@ mrsas_get_request_desc(struct mrsas_softc *sc, extern int mrsas_bus_scan_sim(struct mrsas_softc *sc, struct cam_sim *sim); static int mrsas_alloc_evt_log_info_cmd(struct mrsas_softc *sc); static void mrsas_free_evt_log_info_cmd(struct mrsas_softc *sc); +void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); +void mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, + union ccb *ccb_ptr, u_int8_t status, u_int8_t extStatus, + u_int32_t data_length, u_int8_t *sense); + + SYSCTL_NODE(_hw, OID_AUTO, mrsas, CTLFLAG_RD, 0, "MRSAS Driver Parameters"); /* @@ -190,6 +195,12 @@ MRSAS_CTLR_ID device_table[] = { {0x1000, MRSAS_INTRUDER_24, 0xffff, 0xffff, "AVAGO Intruder_24 SAS Controller"}, {0x1000, MRSAS_CUTLASS_52, 0xffff, 0xffff, "AVAGO Cutlass_52 SAS Controller"}, {0x1000, MRSAS_CUTLASS_53, 0xffff, 0xffff, "AVAGO Cutlass_53 SAS Controller"}, + {0x1000, MRSAS_VENTURA, 0xffff, 0xffff, "AVAGO Ventura SAS Controller"}, + {0x1000, MRSAS_CRUSADER, 0xffff, 0xffff, "AVAGO Crusader SAS Controller"}, + {0x1000, MRSAS_HARPOON, 0xffff, 0xffff, "AVAGO Harpoon SAS Controller"}, + {0x1000, MRSAS_TOMCAT, 0xffff, 0xffff, "AVAGO Tomcat SAS Controller"}, + {0x1000, MRSAS_VENTURA_4PORT, 0xffff, 0xffff, "AVAGO Ventura_4Port SAS Controller"}, + {0x1000, MRSAS_CRUSADER_4PORT, 0xffff, 0xffff, "AVAGO Crusader_4Port SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -436,7 +447,16 @@ mrsas_setup_sysctl(struct mrsas_softc *sc) OID_AUTO, "block_sync_cache", CTLFLAG_RW, &sc->block_sync_cache, 0, "Block SYNC CACHE at driver. "); - + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "stream detection", CTLFLAG_RW, + &sc->drv_stream_detection, 0, + "Disable/Enable Stream detection. "); + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "prp_count", CTLFLAG_RD, + &sc->prp_count.val_rdonly, 0, "Number of IOs for which PRPs are built"); + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "SGE holes", CTLFLAG_RD, + &sc->sge_holes.val_rdonly, 0, "Number of IOs with holes in SGEs"); } /* @@ -451,12 +471,14 @@ mrsas_get_tunables(struct mrsas_softc *sc) char tmpstr[80]; /* XXX default to some debugging for now */ - sc->mrsas_debug = MRSAS_FAULT; + sc->mrsas_debug = + (MRSAS_FAULT | MRSAS_OCR | MRSAS_INFO | MRSAS_TRACE | MRSAS_AEN); sc->mrsas_io_timeout = MRSAS_IO_TIMEOUT; sc->mrsas_fw_fault_check_delay = 1; sc->reset_count = 0; sc->reset_in_progress = 0; sc->block_sync_cache = 0; + sc->drv_stream_detection = 1; /* * Grab the global variables. @@ -815,7 +837,7 @@ static int mrsas_attach(device_t dev) { struct mrsas_softc *sc = device_get_softc(dev); - uint32_t cmd, bar, error; + uint32_t cmd, error; memset(sc, 0, sizeof(struct mrsas_softc)); @@ -830,7 +852,14 @@ mrsas_attach(device_t dev) (sc->device_id == MRSAS_CUTLASS_52) || (sc->device_id == MRSAS_CUTLASS_53)) { sc->mrsas_gen3_ctrl = 1; - } + } else if ((sc->device_id == MRSAS_VENTURA) || + (sc->device_id == MRSAS_CRUSADER) || + (sc->device_id == MRSAS_HARPOON) || + (sc->device_id == MRSAS_TOMCAT) || + (sc->device_id == MRSAS_VENTURA_4PORT) || + (sc->device_id == MRSAS_CRUSADER_4PORT)) { + sc->is_ventura = true; + } mrsas_get_tunables(sc); @@ -845,9 +874,12 @@ mrsas_attach(device_t dev) cmd |= PCIM_CMD_BUSMASTEREN; pci_write_config(dev, PCIR_COMMAND, cmd, 2); - bar = pci_read_config(dev, MRSAS_PCI_BAR1, 4); + /* For Ventura system registers are mapped to BAR0 */ + if (sc->is_ventura) + sc->reg_res_id = PCIR_BAR(0); /* BAR0 offset */ + else + sc->reg_res_id = PCIR_BAR(1); /* BAR1 offset */ - sc->reg_res_id = MRSAS_PCI_BAR1;/* BAR1 offset */ if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &(sc->reg_res_id), RF_ACTIVE)) == NULL) { @@ -866,6 +898,7 @@ mrsas_attach(device_t dev) mtx_init(&sc->mpt_cmd_pool_lock, "mrsas_mpt_cmd_pool_lock", NULL, MTX_DEF); mtx_init(&sc->mfi_cmd_pool_lock, "mrsas_mfi_cmd_pool_lock", NULL, MTX_DEF); mtx_init(&sc->raidmap_lock, "mrsas_raidmap_lock", NULL, MTX_DEF); + mtx_init(&sc->stream_lock, "mrsas_stream_lock", NULL, MTX_DEF); /* Intialize linked list */ TAILQ_INIT(&sc->mrsas_mpt_cmd_list_head); @@ -873,6 +906,8 @@ mrsas_attach(device_t dev) mrsas_atomic_set(&sc->fw_outstanding, 0); mrsas_atomic_set(&sc->target_reset_outstanding, 0); + mrsas_atomic_set(&sc->prp_count, 0); + mrsas_atomic_set(&sc->sge_holes, 0); sc->io_cmds_highwater = 0; @@ -932,6 +967,7 @@ attach_fail_fw: mtx_destroy(&sc->mpt_cmd_pool_lock); mtx_destroy(&sc->mfi_cmd_pool_lock); mtx_destroy(&sc->raidmap_lock); + mtx_destroy(&sc->stream_lock); attach_fail: if (sc->reg_res) { bus_release_resource(sc->mrsas_dev, SYS_RES_MEMORY, @@ -946,6 +982,7 @@ attach_fail: static void mrsas_ich_startup(void *arg) { + int i = 0; struct mrsas_softc *sc = (struct mrsas_softc *)arg; /* @@ -981,6 +1018,13 @@ mrsas_ich_startup(void *arg) /* Enable Interrupts */ mrsas_enable_intr(sc); + /* Call DCMD get_pd_info for all system PDs */ + for (i = 0; i < MRSAS_MAX_PD; i++) { + if ((sc->target_list[i].target_id != 0xffff) && + sc->pd_info_mem) + mrsas_get_pd_info(sc, sc->target_list[i].target_id); + } + /* Initiate AEN (Asynchronous Event Notification) */ if (mrsas_start_aen(sc)) { device_printf(sc->mrsas_dev, "Error: AEN registration FAILED !!! " @@ -1054,6 +1098,14 @@ mrsas_detach(device_t dev) mrsas_flush_cache(sc); mrsas_shutdown_ctlr(sc, MR_DCMD_CTRL_SHUTDOWN); mrsas_disable_intr(sc); + + if (sc->is_ventura && sc->streamDetectByLD) { + for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) + free(sc->streamDetectByLD[i], M_MRSAS); + free(sc->streamDetectByLD, M_MRSAS); + sc->streamDetectByLD = NULL; + } + mrsas_cam_detach(sc); mrsas_teardown_intr(sc); mrsas_free_mem(sc); @@ -1065,6 +1117,7 @@ mrsas_detach(device_t dev) mtx_destroy(&sc->mpt_cmd_pool_lock); mtx_destroy(&sc->mfi_cmd_pool_lock); mtx_destroy(&sc->raidmap_lock); + mtx_destroy(&sc->stream_lock); /* Wait for all the semaphores to be released */ while (sema_value(&sc->ioctl_count_sema) != MRSAS_MAX_IOCTL_CMDS) @@ -1094,7 +1147,7 @@ void mrsas_free_mem(struct mrsas_softc *sc) { int i; - u_int32_t max_cmd; + u_int32_t max_fw_cmds; struct mrsas_mfi_cmd *mfi_cmd; struct mrsas_mpt_cmd *mpt_cmd; @@ -1182,6 +1235,16 @@ mrsas_free_mem(struct mrsas_softc *sc) bus_dma_tag_destroy(sc->evt_detail_tag); /* + * Free PD info memory + */ + if (sc->pd_info_phys_addr) + bus_dmamap_unload(sc->pd_info_tag, sc->pd_info_dmamap); + if (sc->pd_info_mem != NULL) + bus_dmamem_free(sc->pd_info_tag, sc->pd_info_mem, sc->pd_info_dmamap); + if (sc->pd_info_tag != NULL) + bus_dma_tag_destroy(sc->pd_info_tag); + + /* * Free MFI frames */ if (sc->mfi_cmd_list) { @@ -1196,9 +1259,9 @@ mrsas_free_mem(struct mrsas_softc *sc) /* * Free MPT internal command list */ - max_cmd = sc->max_fw_cmds; + max_fw_cmds = sc->max_fw_cmds; if (sc->mpt_cmd_list) { - for (i = 0; i < max_cmd; i++) { + for (i = 0; i < max_fw_cmds; i++) { mpt_cmd = sc->mpt_cmd_list[i]; bus_dmamap_destroy(sc->data_tag, mpt_cmd->data_dmamap); free(sc->mpt_cmd_list[i], M_MRSAS); @@ -1538,14 +1601,14 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M Mpi2ReplyDescriptorsUnion_t *desc; MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR *reply_desc; MRSAS_RAID_SCSI_IO_REQUEST *scsi_io_req; - struct mrsas_mpt_cmd *cmd_mpt; + struct mrsas_mpt_cmd *cmd_mpt, *r1_cmd = NULL; struct mrsas_mfi_cmd *cmd_mfi; - u_int8_t reply_descript_type; + u_int8_t reply_descript_type, *sense; u_int16_t smid, num_completed; u_int8_t status, extStatus; union desc_value desc_val; PLD_LOAD_BALANCE_INFO lbinfo; - u_int32_t device_id; + u_int32_t device_id, data_length; int threshold_reply_count = 0; #if TM_DEBUG MR_TASK_MANAGE_REQUEST *mr_tm_req; @@ -1573,8 +1636,10 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M cmd_mpt = sc->mpt_cmd_list[smid - 1]; scsi_io_req = (MRSAS_RAID_SCSI_IO_REQUEST *) cmd_mpt->io_request; - status = scsi_io_req->RaidContext.status; - extStatus = scsi_io_req->RaidContext.exStatus; + status = scsi_io_req->RaidContext.raid_context.status; + extStatus = scsi_io_req->RaidContext.raid_context.exStatus; + sense = cmd_mpt->sense; + data_length = scsi_io_req->DataLength; switch (scsi_io_req->Function) { case MPI2_FUNCTION_SCSI_TASK_MGMT: @@ -1590,16 +1655,45 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M case MPI2_FUNCTION_SCSI_IO_REQUEST: /* Fast Path IO. */ device_id = cmd_mpt->ccb_ptr->ccb_h.target_id; lbinfo = &sc->load_balance_info[device_id]; + /* R1 load balancing for READ */ if (cmd_mpt->load_balance == MRSAS_LOAD_BALANCE_FLAG) { mrsas_atomic_dec(&lbinfo->scsi_pending_cmds[cmd_mpt->pd_r1_lb]); cmd_mpt->load_balance &= ~MRSAS_LOAD_BALANCE_FLAG; } /* Fall thru and complete IO */ case MRSAS_MPI2_FUNCTION_LD_IO_REQUEST: - mrsas_map_mpt_cmd_status(cmd_mpt, status, extStatus); - mrsas_cmd_done(sc, cmd_mpt); - scsi_io_req->RaidContext.status = 0; - scsi_io_req->RaidContext.exStatus = 0; + if (cmd_mpt->r1_alt_dev_handle == MR_DEVHANDLE_INVALID) { + mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, + extStatus, data_length, sense); + mrsas_cmd_done(sc, cmd_mpt); + } else { + /* + * If the peer Raid 1/10 fast path failed, + * mark IO as failed to the scsi layer. + * Overwrite the current status by the failed status + * and make sure that if any command fails, + * driver returns fail status to CAM. + */ + cmd_mpt->cmd_completed = 1; + r1_cmd = cmd_mpt->peer_cmd; + if (r1_cmd->cmd_completed) { + if (r1_cmd->io_request->RaidContext.raid_context.status != MFI_STAT_OK) { + status = r1_cmd->io_request->RaidContext.raid_context.status; + extStatus = r1_cmd->io_request->RaidContext.raid_context.exStatus; + data_length = r1_cmd->io_request->DataLength; + sense = r1_cmd->sense; + } + r1_cmd->ccb_ptr = NULL; + if (r1_cmd->callout_owner) { + callout_stop(&r1_cmd->cm_callout); + r1_cmd->callout_owner = false; + } + mrsas_release_mpt_cmd(r1_cmd); + mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, + extStatus, data_length, sense); + mrsas_cmd_done(sc, cmd_mpt); + } + } mrsas_atomic_dec(&sc->fw_outstanding); break; case MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST: /* MFI command */ @@ -1648,7 +1742,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M */ if (threshold_reply_count >= THRESHOLD_REPLY_COUNT) { if (sc->msix_enable) { - if (sc->mrsas_gen3_ctrl) + if (sc->msix_combined) mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1669,7 +1763,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M /* Clear response interrupt */ if (sc->msix_enable) { - if (sc->mrsas_gen3_ctrl) { + if (sc->msix_combined) { mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1692,40 +1786,41 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M * CCB. */ void -mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, u_int8_t extStatus) +mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, union ccb *ccb_ptr, u_int8_t status, + u_int8_t extStatus, u_int32_t data_length, u_int8_t *sense) { struct mrsas_softc *sc = cmd->sc; u_int8_t *sense_data; switch (status) { case MFI_STAT_OK: - cmd->ccb_ptr->ccb_h.status = CAM_REQ_CMP; + ccb_ptr->ccb_h.status = CAM_REQ_CMP; break; case MFI_STAT_SCSI_IO_FAILED: case MFI_STAT_SCSI_DONE_WITH_ERROR: - cmd->ccb_ptr->ccb_h.status = CAM_SCSI_STATUS_ERROR; - sense_data = (u_int8_t *)&cmd->ccb_ptr->csio.sense_data; + ccb_ptr->ccb_h.status = CAM_SCSI_STATUS_ERROR; + sense_data = (u_int8_t *)&ccb_ptr->csio.sense_data; if (sense_data) { /* For now just copy 18 bytes back */ - memcpy(sense_data, cmd->sense, 18); - cmd->ccb_ptr->csio.sense_len = 18; - cmd->ccb_ptr->ccb_h.status |= CAM_AUTOSNS_VALID; + memcpy(sense_data, sense, 18); + ccb_ptr->csio.sense_len = 18; + ccb_ptr->ccb_h.status |= CAM_AUTOSNS_VALID; } break; case MFI_STAT_LD_OFFLINE: case MFI_STAT_DEVICE_NOT_FOUND: - if (cmd->ccb_ptr->ccb_h.target_lun) - cmd->ccb_ptr->ccb_h.status |= CAM_LUN_INVALID; + if (ccb_ptr->ccb_h.target_lun) + ccb_ptr->ccb_h.status |= CAM_LUN_INVALID; else - cmd->ccb_ptr->ccb_h.status |= CAM_DEV_NOT_THERE; + ccb_ptr->ccb_h.status |= CAM_DEV_NOT_THERE; break; case MFI_STAT_CONFIG_SEQ_MISMATCH: - cmd->ccb_ptr->ccb_h.status |= CAM_REQUEUE_REQ; + ccb_ptr->ccb_h.status |= CAM_REQUEUE_REQ; break; default: device_printf(sc->mrsas_dev, "FW cmd complete status %x\n", status); - cmd->ccb_ptr->ccb_h.status = CAM_REQ_CMP_ERR; - cmd->ccb_ptr->csio.scsi_status = status; + ccb_ptr->ccb_h.status = CAM_REQ_CMP_ERR; + ccb_ptr->csio.scsi_status = status; } return; } @@ -1741,8 +1836,8 @@ mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_ static int mrsas_alloc_mem(struct mrsas_softc *sc) { - u_int32_t verbuf_size, io_req_size, reply_desc_size, sense_size, - chain_frame_size, evt_detail_size, count; + u_int32_t verbuf_size, io_req_size, reply_desc_size, sense_size, chain_frame_size, + evt_detail_size, count, pd_info_size; /* * Allocate parent DMA tag @@ -1912,6 +2007,7 @@ mrsas_alloc_mem(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Cannot load sense buf memory\n"); return (ENOMEM); } + /* * Allocate for Event detail structure */ @@ -1942,7 +2038,39 @@ mrsas_alloc_mem(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Cannot load Event detail buffer memory\n"); return (ENOMEM); } + /* + * Allocate for PD INFO structure + */ + pd_info_size = sizeof(struct mrsas_pd_info); + if (bus_dma_tag_create(sc->mrsas_parent_tag, + 1, 0, + BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR, + NULL, NULL, + pd_info_size, + 1, + pd_info_size, + BUS_DMA_ALLOCNOW, + NULL, NULL, + &sc->pd_info_tag)) { + device_printf(sc->mrsas_dev, "Cannot create PD INFO tag\n"); + return (ENOMEM); + } + if (bus_dmamem_alloc(sc->pd_info_tag, (void **)&sc->pd_info_mem, + BUS_DMA_NOWAIT, &sc->pd_info_dmamap)) { + device_printf(sc->mrsas_dev, "Cannot alloc PD INFO buffer memory\n"); + return (ENOMEM); + } + bzero(sc->pd_info_mem, pd_info_size); + if (bus_dmamap_load(sc->pd_info_tag, sc->pd_info_dmamap, + sc->pd_info_mem, pd_info_size, mrsas_addr_cb, + &sc->pd_info_phys_addr, BUS_DMA_NOWAIT)) { + device_printf(sc->mrsas_dev, "Cannot load PD INFO buffer memory\n"); + return (ENOMEM); + } + + /* * Create a dma tag for data buffers; size will be the maximum * possible I/O size (280kB). */ @@ -2147,15 +2275,25 @@ mrsas_init_fw(struct mrsas_softc *sc) u_int32_t max_sectors_1; u_int32_t max_sectors_2; u_int32_t tmp_sectors; - u_int32_t scratch_pad_2; + u_int32_t scratch_pad_2, scratch_pad_3, scratch_pad_4; int msix_enable = 0; int fw_msix_count = 0; + int i, j; /* Make sure Firmware is ready */ ret = mrsas_transition_to_ready(sc, ocr); if (ret != SUCCESS) { return (ret); } + if (sc->is_ventura) { + scratch_pad_3 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_3)); +#if VD_EXT_DEBUG + device_printf(sc->mrsas_dev, "scratch_pad_3 0x%x\n", scratch_pad_3); +#endif + sc->maxRaidMapSize = ((scratch_pad_3 >> + MR_MAX_RAID_MAP_SIZE_OFFSET_SHIFT) & + MR_MAX_RAID_MAP_SIZE_MASK); + } /* MSI-x index 0- reply post host index register */ sc->msix_reg_offset[0] = MPI2_REPLY_POST_HOST_INDEX_OFFSET; /* Check if MSI-X is supported while in ready state */ @@ -2177,6 +2315,15 @@ mrsas_init_fw(struct mrsas_softc *sc) >> MR_MAX_REPLY_QUEUES_EXT_OFFSET_SHIFT) + 1; fw_msix_count = sc->msix_vectors; + if ((sc->mrsas_gen3_ctrl && (sc->msix_vectors > 8)) || + (sc->is_ventura && (sc->msix_vectors > 16))) + sc->msix_combined = true; + /* + * Save 1-15 reply post index + * address to local memory Index 0 + * is already saved from reg offset + * MPI2_REPLY_POST_HOST_INDEX_OFFSET + */ for (loop = 1; loop < MR_MAX_MSIX_REG_ARRAY; loop++) { sc->msix_reg_offset[loop] = @@ -2199,10 +2346,28 @@ mrsas_init_fw(struct mrsas_softc *sc) "Online CPU %d Current MSIX <%d>\n", fw_msix_count, mp_ncpus, sc->msix_vectors); } + /* + * MSI-X host index 0 is common for all adapter. + * It is used for all MPT based Adapters. + */ + if (sc->msix_combined) { + sc->msix_reg_offset[0] = + MPI2_SUP_REPLY_POST_HOST_INDEX_OFFSET; + } if (mrsas_init_adapter(sc) != SUCCESS) { device_printf(sc->mrsas_dev, "Adapter initialize Fail.\n"); return (1); } + + if (sc->is_ventura) { + scratch_pad_4 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + outbound_scratch_pad_4)); + if ((scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK) >= MR_DEFAULT_NVME_PAGE_SHIFT) + sc->nvme_page_size = 1 << (scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK); + + device_printf(sc->mrsas_dev, "NVME page size\t: (%d)\n", sc->nvme_page_size); + } + /* Allocate internal commands for pass-thru */ if (mrsas_alloc_mfi_cmds(sc) != SUCCESS) { device_printf(sc->mrsas_dev, "Allocate MFI cmd failed.\n"); @@ -2230,6 +2395,9 @@ mrsas_init_fw(struct mrsas_softc *sc) if (sc->use_seqnum_jbod_fp) device_printf(sc->mrsas_dev, "FW supports JBOD Map \n"); + if (sc->support_morethan256jbod) + device_printf(sc->mrsas_dev, "FW supports JBOD Map Ext \n"); + if (mrsas_setup_raidmap(sc) != SUCCESS) { device_printf(sc->mrsas_dev, "Error: RAID map setup FAILED !!! " "There seems to be some problem in the controller\n" @@ -2237,6 +2405,12 @@ mrsas_init_fw(struct mrsas_softc *sc) } megasas_setup_jbod_map(sc); + + memset(sc->target_list, 0, + MRSAS_MAX_TM_TARGETS * sizeof(struct mrsas_target)); + for (i = 0; i < MRSAS_MAX_TM_TARGETS; i++) + sc->target_list[i].target_id = 0xffff; + /* For pass-thru, get PD/LD list and controller info */ memset(sc->pd_list, 0, MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); @@ -2249,6 +2423,30 @@ mrsas_init_fw(struct mrsas_softc *sc) device_printf(sc->mrsas_dev, "Get LD lsit failed.\n"); return (1); } + + if (sc->is_ventura && sc->drv_stream_detection) { + sc->streamDetectByLD = malloc(sizeof(PTR_LD_STREAM_DETECT) * + MAX_LOGICAL_DRIVES_EXT, M_MRSAS, M_NOWAIT); + if (!sc->streamDetectByLD) { + device_printf(sc->mrsas_dev, + "unable to allocate stream detection for pool of LDs\n"); + return (1); + } + for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) { + sc->streamDetectByLD[i] = malloc(sizeof(LD_STREAM_DETECT), M_MRSAS, M_NOWAIT); + if (!sc->streamDetectByLD[i]) { + device_printf(sc->mrsas_dev, "unable to allocate stream detect by LD\n"); + for (j = 0; j < i; ++j) + free(sc->streamDetectByLD[j], M_MRSAS); + free(sc->streamDetectByLD, M_MRSAS); + sc->streamDetectByLD = NULL; + return (1); + } + memset(sc->streamDetectByLD[i], 0, sizeof(LD_STREAM_DETECT)); + sc->streamDetectByLD[i]->mruBitMap = MR_STREAM_BITMAP; + } + } + /* * Compute the max allowed sectors per IO: The controller info has * two limits on max sectors. Driver should use the minimum of these @@ -2298,25 +2496,26 @@ int mrsas_init_adapter(struct mrsas_softc *sc) { uint32_t status; - u_int32_t max_cmd, scratch_pad_2; + u_int32_t scratch_pad_2; int ret; int i = 0; /* Read FW status register */ status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); - /* Get operational params from status register */ sc->max_fw_cmds = status & MRSAS_FWSTATE_MAXCMD_MASK; /* Decrement the max supported by 1, to correlate with FW */ sc->max_fw_cmds = sc->max_fw_cmds - 1; - max_cmd = sc->max_fw_cmds; + sc->max_scsi_cmds = sc->max_fw_cmds - + (MRSAS_FUSION_INT_CMDS + MRSAS_MAX_IOCTL_CMDS); /* Determine allocation size of command frames */ - sc->reply_q_depth = ((max_cmd + 1 + 15) / 16 * 16) * 2; - sc->request_alloc_sz = sizeof(MRSAS_REQUEST_DESCRIPTOR_UNION) * max_cmd; + sc->reply_q_depth = ((sc->max_fw_cmds + 1 + 15) / 16 * 16) * 2; + sc->request_alloc_sz = sizeof(MRSAS_REQUEST_DESCRIPTOR_UNION) * sc->max_fw_cmds; sc->reply_alloc_sz = sizeof(MPI2_REPLY_DESCRIPTORS_UNION) * (sc->reply_q_depth); - sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (max_cmd + 1)); + sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1)); scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); /* @@ -2334,15 +2533,17 @@ mrsas_init_adapter(struct mrsas_softc *sc) ((scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_MASK) >> 5) * MEGASAS_256K_IO; - sc->chain_frames_alloc_sz = sc->max_chain_frame_sz * max_cmd; + sc->chain_frames_alloc_sz = sc->max_chain_frame_sz * sc->max_fw_cmds; sc->max_sge_in_main_msg = (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE - offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL)) / 16; sc->max_sge_in_chain = sc->max_chain_frame_sz / sizeof(MPI2_SGE_IO_UNION); sc->max_num_sge = sc->max_sge_in_main_msg + sc->max_sge_in_chain - 2; - mrsas_dprint(sc, MRSAS_INFO, "Avago Debug: MAX sge 0x%X MAX chain frame size 0x%X \n", - sc->max_num_sge, sc->max_chain_frame_sz); + mrsas_dprint(sc, MRSAS_INFO, + "max sge: 0x%x, max chain frame size: 0x%x, " + "max fw cmd: 0x%x\n", sc->max_num_sge, + sc->max_chain_frame_sz, sc->max_fw_cmds); /* Used for pass thru MFI frame (DCMD) */ sc->chain_offset_mfi_pthru = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 16; @@ -2441,7 +2642,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) struct mrsas_init_frame *init_frame; pMpi2IOCInitRequest_t IOCInitMsg; MRSAS_REQUEST_DESCRIPTOR_UNION req_desc; - u_int8_t max_wait = MRSAS_IOC_INIT_WAIT_TIME; + u_int8_t max_wait = MRSAS_INTERNAL_CMD_WAIT_TIME; bus_addr_t phys_addr; int i, retcode = 0; u_int32_t scratch_pad_2; @@ -2469,6 +2670,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) IOCInitMsg->ReplyDescriptorPostQueueAddress = sc->reply_desc_phys_addr; IOCInitMsg->SystemRequestFrameBaseAddress = sc->io_request_phys_addr; IOCInitMsg->HostMSIxVectors = (sc->msix_vectors > 0 ? sc->msix_vectors : 0); + IOCInitMsg->HostPageSize = MR_DEFAULT_NVME_PAGE_SHIFT; init_frame = (struct mrsas_init_frame *)sc->ioc_init_mem; init_frame->cmd = MFI_CMD_INIT; @@ -2476,7 +2678,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; /* driver support Extended MSIX */ - if (sc->mrsas_gen3_ctrl) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -2545,14 +2747,14 @@ int mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) { int i, j; - u_int32_t max_cmd, count; + u_int32_t max_fw_cmds, count; struct mrsas_mpt_cmd *cmd; pMpi2ReplyDescriptorsUnion_t reply_desc; u_int32_t offset, chain_offset, sense_offset; bus_addr_t io_req_base_phys, chain_frame_base_phys, sense_base_phys; u_int8_t *io_req_base, *chain_frame_base, *sense_base; - max_cmd = sc->max_fw_cmds; + max_fw_cmds = sc->max_fw_cmds; sc->req_desc = malloc(sc->request_alloc_sz, M_MRSAS, M_NOWAIT); if (!sc->req_desc) { @@ -2566,13 +2768,14 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) * Allocate the dynamic array first and then allocate individual * commands. */ - sc->mpt_cmd_list = malloc(sizeof(struct mrsas_mpt_cmd *) * max_cmd, M_MRSAS, M_NOWAIT); + sc->mpt_cmd_list = malloc(sizeof(struct mrsas_mpt_cmd *) * max_fw_cmds, + M_MRSAS, M_NOWAIT); if (!sc->mpt_cmd_list) { device_printf(sc->mrsas_dev, "Cannot alloc memory for mpt_cmd_list.\n"); return (ENOMEM); } - memset(sc->mpt_cmd_list, 0, sizeof(struct mrsas_mpt_cmd *) * max_cmd); - for (i = 0; i < max_cmd; i++) { + memset(sc->mpt_cmd_list, 0, sizeof(struct mrsas_mpt_cmd *) * max_fw_cmds); + for (i = 0; i < max_fw_cmds; i++) { sc->mpt_cmd_list[i] = malloc(sizeof(struct mrsas_mpt_cmd), M_MRSAS, M_NOWAIT); if (!sc->mpt_cmd_list[i]) { @@ -2590,7 +2793,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) chain_frame_base_phys = (bus_addr_t)sc->chain_frame_phys_addr; sense_base = (u_int8_t *)sc->sense_mem; sense_base_phys = (bus_addr_t)sc->sense_phys_addr; - for (i = 0; i < max_cmd; i++) { + for (i = 0; i < max_fw_cmds; i++) { cmd = sc->mpt_cmd_list[i]; offset = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * i; chain_offset = sc->max_chain_frame_sz * i; @@ -2598,6 +2801,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) memset(cmd, 0, sizeof(struct mrsas_mpt_cmd)); cmd->index = i + 1; cmd->ccb_ptr = NULL; + cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; callout_init_mtx(&cmd->cm_callout, &sc->sim_lock, 0); cmd->sync_cmd_idx = (u_int32_t)MRSAS_ULONG_MAX; cmd->sc = sc; @@ -2949,13 +3153,27 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese mtx_unlock(&sc->sim_lock); for (i = 0; i < sc->max_fw_cmds; i++) { mpt_cmd = sc->mpt_cmd_list[i]; + + if (mpt_cmd->peer_cmd) { + mrsas_dprint(sc, MRSAS_OCR, + "R1 FP command [%d] - (mpt_cmd) %p, (peer_cmd) %p\n", + i, mpt_cmd, mpt_cmd->peer_cmd); + } + if (mpt_cmd->ccb_ptr) { - ccb = (union ccb *)(mpt_cmd->ccb_ptr); - ccb->ccb_h.status = CAM_SCSI_BUS_RESET; - mrsas_cmd_done(sc, mpt_cmd); - mrsas_atomic_dec(&sc->fw_outstanding); + if (mpt_cmd->callout_owner) { + ccb = (union ccb *)(mpt_cmd->ccb_ptr); + ccb->ccb_h.status = CAM_SCSI_BUS_RESET; + mrsas_cmd_done(sc, mpt_cmd); + } else { + mpt_cmd->ccb_ptr = NULL; + mrsas_release_mpt_cmd(mpt_cmd); + } } } + + mrsas_atomic_set(&sc->fw_outstanding, 0); + mtx_lock(&sc->sim_lock); status_reg = mrsas_read_reg(sc, offsetof(mrsas_reg_set, @@ -3088,6 +3306,13 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese megasas_setup_jbod_map(sc); + if (sc->is_ventura && sc->streamDetectByLD) { + for (j = 0; j < MAX_LOGICAL_DRIVES_EXT; ++j) { + memset(sc->streamDetectByLD[i], 0, sizeof(LD_STREAM_DETECT)); + sc->streamDetectByLD[i]->mruBitMap = MR_STREAM_BITMAP; + } + } + mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); mrsas_enable_intr(sc); sc->adprecovery = MRSAS_HBA_OPERATIONAL; @@ -3172,7 +3397,7 @@ mrsas_complete_outstanding_ioctls(struct mrsas_softc * if (cmd_mfi->sync_cmd && cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT) { for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) mrsas_complete_mptmfi_passthru(sc, cmd_mfi, - cmd_mpt->io_request->RaidContext.status); + cmd_mpt->io_request->RaidContext.raid_context.status); } } } @@ -3339,6 +3564,9 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) sc->use_seqnum_jbod_fp = sc->ctrl_info->adapterOperations3.useSeqNumJbodFP; + sc->support_morethan256jbod = + sc->ctrl_info->adapterOperations4.supportPdMapTargetId; + sc->disableOnlineCtrlReset = sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; @@ -3362,8 +3590,10 @@ dcmd_timeout: static void mrsas_update_ext_vd_details(struct mrsas_softc *sc) { + u_int32_t ventura_map_sz = 0; sc->max256vdSupport = - sc->ctrl_info->adapterOperations3.supportMaxExtLDs; + sc->ctrl_info->adapterOperations3.supportMaxExtLDs; + /* Below is additional check to address future FW enhancement */ if (sc->ctrl_info->max_lds > 64) sc->max256vdSupport = 1; @@ -3380,20 +3610,33 @@ mrsas_update_ext_vd_details(struct mrsas_softc *sc) sc->fw_supported_pd_count = MAX_PHYSICAL_DEVICES; } - sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * - (sc->fw_supported_vd_count - 1)); - sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); - sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP) + - (sizeof(MR_LD_SPAN_MAP) * - (sc->drv_supported_vd_count - 1)); + if (sc->maxRaidMapSize) { + ventura_map_sz = sc->maxRaidMapSize * + MR_MIN_MAP_SIZE; + sc->current_map_sz = ventura_map_sz; + sc->max_map_sz = ventura_map_sz; + } else { + sc->old_map_sz = sizeof(MR_FW_RAID_MAP) + + (sizeof(MR_LD_SPAN_MAP) * (sc->fw_supported_vd_count - 1)); + sc->new_map_sz = sizeof(MR_FW_RAID_MAP_EXT); + sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); + if (sc->max256vdSupport) + sc->current_map_sz = sc->new_map_sz; + else + sc->current_map_sz = sc->old_map_sz; + } - sc->max_map_sz = max(sc->old_map_sz, sc->new_map_sz); - - if (sc->max256vdSupport) - sc->current_map_sz = sc->new_map_sz; - else - sc->current_map_sz = sc->old_map_sz; + sc->drv_map_sz = sizeof(MR_DRV_RAID_MAP_ALL); +#if VD_EXT_DEBUG + device_printf(sc->mrsas_dev, "sc->maxRaidMapSize 0x%x \n", + sc->maxRaidMapSize); + device_printf(sc->mrsas_dev, + "new_map_sz = 0x%x, old_map_sz = 0x%x, " + "ventura_map_sz = 0x%x, current_map_sz = 0x%x " + "fusion->drv_map_sz =0x%x, size of driver raid map 0x%lx \n", + sc->new_map_sz, sc->old_map_sz, ventura_map_sz, + sc->current_map_sz, sc->drv_map_sz, sizeof(MR_DRV_RAID_MAP_ALL)); +#endif } /* @@ -3591,7 +3834,7 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, st io_req = mpt_cmd->io_request; - if (sc->mrsas_gen3_ctrl) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -4106,7 +4349,114 @@ mrsas_sync_map_info(struct mrsas_softc *sc) return (retcode); } +/* Input: dcmd.opcode - MR_DCMD_PD_GET_INFO + * dcmd.mbox.s[0] - deviceId for this physical drive + * dcmd.sge IN - ptr to returned MR_PD_INFO structure + * Desc: Firmware return the physical drive info structure + * + */ +static void +mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) +{ + int retcode; + u_int8_t do_ocr = 1; + struct mrsas_mfi_cmd *cmd; + struct mrsas_dcmd_frame *dcmd; + + cmd = mrsas_get_mfi_cmd(sc); + + if (!cmd) { + device_printf(sc->mrsas_dev, + "Cannot alloc for get PD info cmd\n"); + return; + } + dcmd = &cmd->frame->dcmd; + + memset(sc->pd_info_mem, 0, sizeof(struct mrsas_pd_info)); + memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); + + dcmd->mbox.s[0] = device_id; + dcmd->cmd = MFI_CMD_DCMD; + dcmd->cmd_status = 0xFF; + dcmd->sge_count = 1; + dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->timeout = 0; + dcmd->pad_0 = 0; + dcmd->data_xfer_len = sizeof(struct mrsas_pd_info); + dcmd->opcode = MR_DCMD_PD_GET_INFO; + dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->pd_info_phys_addr; + dcmd->sgl.sge32[0].length = sizeof(struct mrsas_pd_info); + + if (!sc->mask_interrupts) + retcode = mrsas_issue_blocked_cmd(sc, cmd); + else + retcode = mrsas_issue_polled(sc, cmd); + + if (retcode == ETIMEDOUT) + goto dcmd_timeout; + + sc->target_list[device_id].interface_type = + sc->pd_info_mem->state.ddf.pdType.intf; + + do_ocr = 0; + +dcmd_timeout: + + if (do_ocr) + sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; + + if (!sc->mask_interrupts) + mrsas_release_mfi_cmd(cmd); +} + /* + * mrsas_add_target: Add target ID of system PD/VD to driver's data structure. + * sc: Adapter's soft state + * target_id: Unique target id per controller(managed by driver) + * for system PDs- target ID ranges from 0 to (MRSAS_MAX_PD - 1) + * for VDs- target ID ranges from MRSAS_MAX_PD to MRSAS_MAX_TM_TARGETS + * return: void + * Descripton: This function will be called whenever system PD or VD is created. + */ +static void mrsas_add_target(struct mrsas_softc *sc, + u_int16_t target_id) +{ + sc->target_list[target_id].target_id = target_id; + + device_printf(sc->mrsas_dev, + "%s created target ID: 0x%x\n", + (target_id < MRSAS_MAX_PD ? "System PD" : "VD"), + (target_id < MRSAS_MAX_PD ? target_id : (target_id - MRSAS_MAX_PD))); + /* + * If interrupts are enabled, then only fire DCMD to get pd_info + * for system PDs + */ + if (!sc->mask_interrupts && sc->pd_info_mem && + (target_id < MRSAS_MAX_PD)) + mrsas_get_pd_info(sc, target_id); + +} + +/* + * mrsas_remove_target: Remove target ID of system PD/VD from driver's data structure. + * sc: Adapter's soft state + * target_id: Unique target id per controller(managed by driver) + * for system PDs- target ID ranges from 0 to (MRSAS_MAX_PD - 1) + * for VDs- target ID ranges from MRSAS_MAX_PD to MRSAS_MAX_TM_TARGETS + * return: void + * Descripton: This function will be called whenever system PD or VD is deleted + */ +static void mrsas_remove_target(struct mrsas_softc *sc, + u_int16_t target_id) +{ + sc->target_list[target_id].target_id = 0xffff; + device_printf(sc->mrsas_dev, + "%s deleted target ID: 0x%x\n", + (target_id < MRSAS_MAX_PD ? "System PD" : "VD"), + (target_id < MRSAS_MAX_PD ? target_id : (target_id - MRSAS_MAX_PD))); +} + +/* * mrsas_get_pd_list: Returns FW's PD list structure input: * Adapter soft state * @@ -4182,8 +4532,18 @@ mrsas_get_pd_list(struct mrsas_softc *sc) pd_addr->scsiDevType; sc->local_pd_list[pd_addr->deviceId].driveState = MR_PD_STATE_SYSTEM; + if (sc->target_list[pd_addr->deviceId].target_id == 0xffff) + mrsas_add_target(sc, pd_addr->deviceId); pd_addr++; } + for (pd_index = 0; pd_index < MRSAS_MAX_PD; pd_index++) { + if ((sc->local_pd_list[pd_index].driveState != + MR_PD_STATE_SYSTEM) && + (sc->target_list[pd_index].target_id != + 0xffff)) { + mrsas_remove_target(sc, pd_index); + } + } /* * Use mutext/spinlock if pd_list component size increase more than * 32 bit. @@ -4215,7 +4575,7 @@ dcmd_timeout: static int mrsas_get_ld_list(struct mrsas_softc *sc) { - int ld_list_size, retcode = 0, ld_index = 0, ids = 0; + int ld_list_size, retcode = 0, ld_index = 0, ids = 0, drv_tgt_id; u_int8_t do_ocr = 1; struct mrsas_mfi_cmd *cmd; struct mrsas_dcmd_frame *dcmd; @@ -4277,11 +4637,21 @@ mrsas_get_ld_list(struct mrsas_softc *sc) sc->CurLdCount = ld_list_mem->ldCount; memset(sc->ld_ids, 0xff, MAX_LOGICAL_DRIVES_EXT); for (ld_index = 0; ld_index < ld_list_mem->ldCount; ld_index++) { + ids = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; + drv_tgt_id = ids + MRSAS_MAX_PD; if (ld_list_mem->ldList[ld_index].state != 0) { - ids = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; sc->ld_ids[ids] = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; + if (sc->target_list[drv_tgt_id].target_id == + 0xffff) + mrsas_add_target(sc, drv_tgt_id); + } else { + if (sc->target_list[drv_tgt_id].target_id != + 0xffff) + mrsas_remove_target(sc, + drv_tgt_id); } } + do_ocr = 0; } dcmd_timeout: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jan 3 07:56:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 319EC141BE37; Thu, 3 Jan 2019 07:56:20 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF1C98ECC6; Thu, 3 Jan 2019 07:56:19 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACB861E49C; Thu, 3 Jan 2019 07:56:19 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x037uJ7q070289; Thu, 3 Jan 2019 07:56:19 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x037uJZm070288; Thu, 3 Jan 2019 07:56:19 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201901030756.x037uJZm070288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Thu, 3 Jan 2019 07:56: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: r342717 - stable/12/sys/dev/mrsas X-SVN-Group: stable-12 X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: stable/12/sys/dev/mrsas X-SVN-Commit-Revision: 342717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF1C98ECC6 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Jan 2019 07:56:20 -0000 Author: kadesai Date: Thu Jan 3 07:56:19 2019 New Revision: 342717 URL: https://svnweb.freebsd.org/changeset/base/342717 Log: Compilation failure on ppc and mips due to Revision 342066. Adding extra memset on chain frame. Modified: stable/12/sys/dev/mrsas/mrsas_cam.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- stable/12/sys/dev/mrsas/mrsas_cam.c Thu Jan 3 07:45:52 2019 (r342716) +++ stable/12/sys/dev/mrsas/mrsas_cam.c Thu Jan 3 07:56:19 2019 (r342717) @@ -1577,7 +1577,8 @@ static void mrsas_build_prp_nvme(struct mrsas_mpt_cmd struct mrsas_softc *sc = cmd->sc; int sge_len, offset, num_prp_in_chain = 0; pMpi25IeeeSgeChain64_t main_chain_element, ptr_first_sgl, sgl_ptr; - u_int64_t *ptr_sgl, *ptr_sgl_phys; + u_int64_t *ptr_sgl; + bus_addr_t ptr_sgl_phys; u_int64_t sge_addr; u_int32_t page_mask, page_mask_result, i = 0; u_int32_t first_prp_len; @@ -1600,14 +1601,15 @@ static void mrsas_build_prp_nvme(struct mrsas_mpt_cmd */ page_mask = mr_nvme_pg_size - 1; ptr_sgl = (u_int64_t *) cmd->chain_frame; - ptr_sgl_phys = (u_int64_t *) cmd->chain_frame_phys_addr;; + ptr_sgl_phys = cmd->chain_frame_phys_addr; + memset(ptr_sgl, 0, sc->max_chain_frame_sz); /* Build chain frame element which holds all PRPs except first*/ main_chain_element = (pMpi25IeeeSgeChain64_t) ((u_int8_t *)sgl_ptr + sizeof(MPI25_IEEE_SGE_CHAIN64)); - main_chain_element->Address = (u_int64_t) ptr_sgl_phys; + main_chain_element->Address = cmd->chain_frame_phys_addr; main_chain_element->NextChainOffset = 0; main_chain_element->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT | IEEE_SGE_FLAGS_SYSTEM_ADDR | From owner-svn-src-all@freebsd.org Thu Jan 3 07:59:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 023F0141BF4E; Thu, 3 Jan 2019 07:59:52 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B7E18EE70; Thu, 3 Jan 2019 07:59:51 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DDAF1E4A4; Thu, 3 Jan 2019 07:59:51 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x037xpmd070521; Thu, 3 Jan 2019 07:59:51 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x037xpPO070520; Thu, 3 Jan 2019 07:59:51 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201901030759.x037xpPO070520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Thu, 3 Jan 2019 07:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342718 - stable/11/sys/dev/mrsas X-SVN-Group: stable-11 X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: stable/11/sys/dev/mrsas X-SVN-Commit-Revision: 342718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B7E18EE70 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 07:59:52 -0000 Author: kadesai Date: Thu Jan 3 07:59:51 2019 New Revision: 342718 URL: https://svnweb.freebsd.org/changeset/base/342718 Log: MFC r342079 Compilation failure on ppc and mips due to Revision 342066. Adding extra memset on chain frame. Modified: stable/11/sys/dev/mrsas/mrsas_cam.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas_cam.c Thu Jan 3 07:56:19 2019 (r342717) +++ stable/11/sys/dev/mrsas/mrsas_cam.c Thu Jan 3 07:59:51 2019 (r342718) @@ -1578,7 +1578,8 @@ static void mrsas_build_prp_nvme(struct mrsas_mpt_cmd struct mrsas_softc *sc = cmd->sc; int sge_len, offset, num_prp_in_chain = 0; pMpi25IeeeSgeChain64_t main_chain_element, ptr_first_sgl, sgl_ptr; - u_int64_t *ptr_sgl, *ptr_sgl_phys; + u_int64_t *ptr_sgl; + bus_addr_t ptr_sgl_phys; u_int64_t sge_addr; u_int32_t page_mask, page_mask_result, i = 0; u_int32_t first_prp_len; @@ -1601,14 +1602,15 @@ static void mrsas_build_prp_nvme(struct mrsas_mpt_cmd */ page_mask = mr_nvme_pg_size - 1; ptr_sgl = (u_int64_t *) cmd->chain_frame; - ptr_sgl_phys = (u_int64_t *) cmd->chain_frame_phys_addr;; + ptr_sgl_phys = cmd->chain_frame_phys_addr; + memset(ptr_sgl, 0, sc->max_chain_frame_sz); /* Build chain frame element which holds all PRPs except first*/ main_chain_element = (pMpi25IeeeSgeChain64_t) ((u_int8_t *)sgl_ptr + sizeof(MPI25_IEEE_SGE_CHAIN64)); - main_chain_element->Address = (u_int64_t) ptr_sgl_phys; + main_chain_element->Address = cmd->chain_frame_phys_addr; main_chain_element->NextChainOffset = 0; main_chain_element->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT | IEEE_SGE_FLAGS_SYSTEM_ADDR | From owner-svn-src-all@freebsd.org Thu Jan 3 08:03:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBCCA141E4BA; Thu, 3 Jan 2019 08:03:44 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 668118F2A2; Thu, 3 Jan 2019 08:03:44 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 586551E65F; Thu, 3 Jan 2019 08:03:44 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0383i2a075549; Thu, 3 Jan 2019 08:03:44 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0383hN5075546; Thu, 3 Jan 2019 08:03:43 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201901030803.x0383hN5075546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Thu, 3 Jan 2019 08:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342719 - stable/12/sys/dev/mrsas X-SVN-Group: stable-12 X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: stable/12/sys/dev/mrsas X-SVN-Commit-Revision: 342719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 668118F2A2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Jan 2019 08:03:45 -0000 Author: kadesai Date: Thu Jan 3 08:03:43 2019 New Revision: 342719 URL: https://svnweb.freebsd.org/changeset/base/342719 Log: MFC r342537-r342540 r342537 This patch will add support for latest generation MegaRAID adapters- Aero(39xx). Driver will throw a warning message when a Configurable secure type controller is encountered. r342538 This patch will add support for 32 bit atomic request descriptor for Aero adapters. For Aero adapters- 1. Driver will use 32 bit atomic descriptor to fire IOs and DCMDs. 2. Driver will use 64 bit request descriptor to fire IOC INIT. 3. If Aero firmware supports 32 bit atomic descriptor, then only driver will use it otherwise driver will use 64 bit request descriptor. For rest of adapters(Ventura, Invader and Thunderbolt), driver will use 64 bit request descriptors only. r342539 Problem statement: Due to hardware errata in Aero controllers, reads to certain fusion registers could intermittently return all zeroes. This behavior is transient in nature and subsequent reads will return valid value. Fix: For Aero controllers, any read will retry the read operations from certain registers for maximum three times, if read returns zero. r342540 Driver version upgrade. Modified: stable/12/sys/dev/mrsas/mrsas.c stable/12/sys/dev/mrsas/mrsas.h stable/12/sys/dev/mrsas/mrsas_cam.c stable/12/sys/dev/mrsas/mrsas_fp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/12/sys/dev/mrsas/mrsas.c Thu Jan 3 07:59:51 2019 (r342718) +++ stable/12/sys/dev/mrsas/mrsas.c Thu Jan 3 08:03:43 2019 (r342719) @@ -95,6 +95,8 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t de static struct mrsas_softc * mrsas_get_softc_instance(struct cdev *dev, u_long cmd, caddr_t arg); +u_int32_t +mrsas_read_reg_with_retries(struct mrsas_softc *sc, int offset); u_int32_t mrsas_read_reg(struct mrsas_softc *sc, int offset); u_int8_t mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, @@ -171,6 +173,9 @@ void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); void mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, union ccb *ccb_ptr, u_int8_t status, u_int8_t extStatus, u_int32_t data_length, u_int8_t *sense); +void +mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, + u_int32_t req_desc_hi); SYSCTL_NODE(_hw, OID_AUTO, mrsas, CTLFLAG_RD, 0, "MRSAS Driver Parameters"); @@ -201,6 +206,14 @@ MRSAS_CTLR_ID device_table[] = { {0x1000, MRSAS_TOMCAT, 0xffff, 0xffff, "AVAGO Tomcat SAS Controller"}, {0x1000, MRSAS_VENTURA_4PORT, 0xffff, 0xffff, "AVAGO Ventura_4Port SAS Controller"}, {0x1000, MRSAS_CRUSADER_4PORT, 0xffff, 0xffff, "AVAGO Crusader_4Port SAS Controller"}, + {0x1000, MRSAS_AERO_10E0, 0xffff, 0xffff, "BROADCOM AERO-10E0 SAS Controller"}, + {0x1000, MRSAS_AERO_10E1, 0xffff, 0xffff, "BROADCOM AERO-10E1 SAS Controller"}, + {0x1000, MRSAS_AERO_10E2, 0xffff, 0xffff, "BROADCOM AERO-10E2 SAS Controller"}, + {0x1000, MRSAS_AERO_10E3, 0xffff, 0xffff, "BROADCOM AERO-10E3 SAS Controller"}, + {0x1000, MRSAS_AERO_10E4, 0xffff, 0xffff, "BROADCOM AERO-10E4 SAS Controller"}, + {0x1000, MRSAS_AERO_10E5, 0xffff, 0xffff, "BROADCOM AERO-10E5 SAS Controller"}, + {0x1000, MRSAS_AERO_10E6, 0xffff, 0xffff, "BROADCOM AERO-10E6 SAS Controller"}, + {0x1000, MRSAS_AERO_10E7, 0xffff, 0xffff, "BROADCOM AERO-10E7 SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -261,6 +274,22 @@ mrsas_write(struct cdev *dev, struct uio *uio, int iof return (0); } +u_int32_t +mrsas_read_reg_with_retries(struct mrsas_softc *sc, int offset) +{ + u_int32_t i = 0, ret_val; + + if (sc->is_aero) { + do { + ret_val = mrsas_read_reg(sc, offset); + i++; + } while(ret_val == 0 && i < 3); + } else + ret_val = mrsas_read_reg(sc, offset); + + return ret_val; +} + /* * Register Read/Write Functions * @@ -321,7 +350,7 @@ mrsas_clear_intr(struct mrsas_softc *sc) u_int32_t status; /* Read received interrupt */ - status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); + status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_intr_status)); /* Not our interrupt, so just return */ if (!(status & MFI_FUSION_ENABLE_INTERRUPT_MASK)) @@ -845,20 +874,37 @@ mrsas_attach(device_t dev) sc->mrsas_dev = dev; sc->device_id = pci_get_device(dev); - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + switch (sc->device_id) { + case MRSAS_INVADER: + case MRSAS_FURY: + case MRSAS_INTRUDER: + case MRSAS_INTRUDER_24: + case MRSAS_CUTLASS_52: + case MRSAS_CUTLASS_53: sc->mrsas_gen3_ctrl = 1; - } else if ((sc->device_id == MRSAS_VENTURA) || - (sc->device_id == MRSAS_CRUSADER) || - (sc->device_id == MRSAS_HARPOON) || - (sc->device_id == MRSAS_TOMCAT) || - (sc->device_id == MRSAS_VENTURA_4PORT) || - (sc->device_id == MRSAS_CRUSADER_4PORT)) { + break; + case MRSAS_VENTURA: + case MRSAS_CRUSADER: + case MRSAS_HARPOON: + case MRSAS_TOMCAT: + case MRSAS_VENTURA_4PORT: + case MRSAS_CRUSADER_4PORT: sc->is_ventura = true; + break; + case MRSAS_AERO_10E1: + case MRSAS_AERO_10E5: + device_printf(dev, "Adapter is in configurable secure mode\n"); + case MRSAS_AERO_10E2: + case MRSAS_AERO_10E6: + sc->is_aero = true; + break; + case MRSAS_AERO_10E0: + case MRSAS_AERO_10E3: + case MRSAS_AERO_10E4: + case MRSAS_AERO_10E7: + device_printf(dev, "Adapter is in non-secure mode\n"); + return SUCCESS; + } mrsas_get_tunables(sc); @@ -874,8 +920,8 @@ mrsas_attach(device_t dev) cmd |= PCIM_CMD_BUSMASTEREN; pci_write_config(dev, PCIR_COMMAND, cmd, 2); - /* For Ventura system registers are mapped to BAR0 */ - if (sc->is_ventura) + /* For Ventura/Aero system registers are mapped to BAR0 */ + if (sc->is_ventura || sc->is_aero) sc->reg_res_id = PCIR_BAR(0); /* BAR0 offset */ else sc->reg_res_id = PCIR_BAR(1); /* BAR1 offset */ @@ -1099,7 +1145,7 @@ mrsas_detach(device_t dev) mrsas_shutdown_ctlr(sc, MR_DCMD_CTRL_SHUTDOWN); mrsas_disable_intr(sc); - if (sc->is_ventura && sc->streamDetectByLD) { + if ((sc->is_ventura || sc->is_aero) && sc->streamDetectByLD) { for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) free(sc->streamDetectByLD[i], M_MRSAS); free(sc->streamDetectByLD, M_MRSAS); @@ -2285,8 +2331,8 @@ mrsas_init_fw(struct mrsas_softc *sc) if (ret != SUCCESS) { return (ret); } - if (sc->is_ventura) { - scratch_pad_3 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_3)); + if (sc->is_ventura || sc->is_aero) { + scratch_pad_3 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_3)); #if VD_EXT_DEBUG device_printf(sc->mrsas_dev, "scratch_pad_3 0x%x\n", scratch_pad_3); #endif @@ -2297,10 +2343,10 @@ mrsas_init_fw(struct mrsas_softc *sc) /* MSI-x index 0- reply post host index register */ sc->msix_reg_offset[0] = MPI2_REPLY_POST_HOST_INDEX_OFFSET; /* Check if MSI-X is supported while in ready state */ - msix_enable = (mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & 0x4000000) >> 0x1a; + msix_enable = (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & 0x4000000) >> 0x1a; if (msix_enable) { - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); /* Check max MSI-X vectors */ @@ -2316,7 +2362,7 @@ mrsas_init_fw(struct mrsas_softc *sc) fw_msix_count = sc->msix_vectors; if ((sc->mrsas_gen3_ctrl && (sc->msix_vectors > 8)) || - (sc->is_ventura && (sc->msix_vectors > 16))) + ((sc->is_ventura || sc->is_aero) && (sc->msix_vectors > 16))) sc->msix_combined = true; /* * Save 1-15 reply post index @@ -2359,8 +2405,8 @@ mrsas_init_fw(struct mrsas_softc *sc) return (1); } - if (sc->is_ventura) { - scratch_pad_4 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + if (sc->is_ventura || sc->is_aero) { + scratch_pad_4 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_4)); if ((scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK) >= MR_DEFAULT_NVME_PAGE_SHIFT) sc->nvme_page_size = 1 << (scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK); @@ -2424,7 +2470,7 @@ mrsas_init_fw(struct mrsas_softc *sc) return (1); } - if (sc->is_ventura && sc->drv_stream_detection) { + if ((sc->is_ventura || sc->is_aero) && sc->drv_stream_detection) { sc->streamDetectByLD = malloc(sizeof(PTR_LD_STREAM_DETECT) * MAX_LOGICAL_DRIVES_EXT, M_MRSAS, M_NOWAIT); if (!sc->streamDetectByLD) { @@ -2501,7 +2547,7 @@ mrsas_init_adapter(struct mrsas_softc *sc) int i = 0; /* Read FW status register */ - status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); + status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); sc->max_fw_cmds = status & MRSAS_FWSTATE_MAXCMD_MASK; @@ -2516,7 +2562,7 @@ mrsas_init_adapter(struct mrsas_softc *sc) sc->reply_alloc_sz = sizeof(MPI2_REPLY_DESCRIPTORS_UNION) * (sc->reply_q_depth); sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1)); - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); /* * If scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK is set, @@ -2654,7 +2700,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) } if (!sc->block_sync_cache) { - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); sc->fw_sync_cache_support = (scratch_pad_2 & MR_CAN_HANDLE_SYNC_CACHE_OFFSET) ? 1 : 0; @@ -2678,7 +2724,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; /* driver support Extended MSIX */ - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -2703,7 +2749,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) mrsas_disable_intr(sc); mrsas_dprint(sc, MRSAS_OCR, "Issuing IOC INIT command to FW.\n"); - mrsas_fire_cmd(sc, req_desc.addr.u.low, req_desc.addr.u.high); + mrsas_write_64bit_req_desc(sc, req_desc.addr.u.low, req_desc.addr.u.high); /* * Poll response timer to wait for Firmware response. While this @@ -2729,6 +2775,15 @@ mrsas_ioc_init(struct mrsas_softc *sc) retcode = 1; } + if (sc->is_aero) { + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, + outbound_scratch_pad_2)); + sc->atomic_desc_support = (scratch_pad_2 & + MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET) ? 1 : 0; + device_printf(sc->mrsas_dev, "FW supports atomic descriptor: %s\n", + sc->atomic_desc_support ? "Yes" : "No"); + } + mrsas_free_ioc_cmd(sc); return (retcode); } @@ -2828,16 +2883,13 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) } /* - * mrsas_fire_cmd: Sends command to FW + * mrsas_write_64bit_req_dsc: Writes 64 bit request descriptor to FW * input: Adapter softstate - * request descriptor address low - * request descriptor address high - * - * This functions fires the command to Firmware by writing to the - * inbound_low_queue_port and inbound_high_queue_port. + * request descriptor address low + * request descriptor address high */ void -mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, +mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi) { mtx_lock(&sc->pci_lock); @@ -2849,6 +2901,26 @@ mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_d } /* + * mrsas_fire_cmd: Sends command to FW + * input: Adapter softstate + * request descriptor address low + * request descriptor address high + * + * This functions fires the command to Firmware by writing to the + * inbound_low_queue_port and inbound_high_queue_port. + */ +void +mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, + u_int32_t req_desc_hi) +{ + if (sc->atomic_desc_support) + mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_single_queue_port), + req_desc_lo); + else + mrsas_write_64bit_req_desc(sc, req_desc_lo, req_desc_hi); +} + +/* * mrsas_transition_to_ready: Move FW to Ready state input: * Adapter instance soft state * @@ -2866,7 +2938,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int u_int32_t cur_state; u_int32_t abs_state, curr_abs_state; - val = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); + val = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); fw_state = val & MFI_STATE_MASK; max_wait = MRSAS_RESET_WAIT_TIME; @@ -2874,7 +2946,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int device_printf(sc->mrsas_dev, "Waiting for FW to come to ready state\n"); while (fw_state != MFI_STATE_READY) { - abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); + abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); switch (fw_state) { case MFI_STATE_FAULT: device_printf(sc->mrsas_dev, "FW is in FAULT state!!\n"); @@ -2902,7 +2974,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int mrsas_disable_intr(sc); mrsas_write_reg(sc, offsetof(mrsas_reg_set, doorbell), MFI_RESET_FLAGS); for (i = 0; i < max_wait * 1000; i++) { - if (mrsas_read_reg(sc, offsetof(mrsas_reg_set, doorbell)) & 1) + if (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, doorbell)) & 1) DELAY(1000); else break; @@ -2940,9 +3012,9 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int * The cur_state should not last for more than max_wait secs */ for (i = 0; i < (max_wait * 1000); i++) { - fw_state = (mrsas_read_reg(sc, offsetof(mrsas_reg_set, + fw_state = (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK); - curr_abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + curr_abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); if (abs_state == curr_abs_state) DELAY(1000); @@ -3017,7 +3089,7 @@ mrsas_ocr_thread(void *arg) "Hardware critical error", __func__); break; } - fw_status = mrsas_read_reg(sc, + fw_status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); fw_state = fw_status & MFI_STATE_MASK; if (fw_state == MFI_STATE_FAULT || sc->do_timedout_reset || @@ -3176,7 +3248,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese mtx_lock(&sc->sim_lock); - status_reg = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + status_reg = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); abs_state = status_reg & MFI_STATE_MASK; reset_adapter = status_reg & MFI_RESET_ADAPTER; @@ -3206,12 +3278,12 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese MPI2_WRSEQ_6TH_KEY_VALUE); /* Check that the diag write enable (DRWE) bit is on */ - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); retry = 0; while (!(host_diag & HOST_DIAG_WRITE_ENABLE)) { DELAY(100 * 1000); - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); if (retry++ == 100) { mrsas_dprint(sc, MRSAS_OCR, @@ -3228,12 +3300,12 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese DELAY(3000 * 1000); /* Make sure reset adapter bit is cleared */ - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); retry = 0; while (host_diag & HOST_DIAG_RESET_ADAPTER) { DELAY(100 * 1000); - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); if (retry++ == 1000) { mrsas_dprint(sc, MRSAS_OCR, @@ -3244,13 +3316,13 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese if (host_diag & HOST_DIAG_RESET_ADAPTER) continue; - abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK; retry = 0; while ((abs_state <= MFI_STATE_FW_INIT) && (retry++ < 1000)) { DELAY(100 * 1000); - abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK; } if (abs_state <= MFI_STATE_FW_INIT) { @@ -3306,7 +3378,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese megasas_setup_jbod_map(sc); - if (sc->is_ventura && sc->streamDetectByLD) { + if ((sc->is_ventura || sc->is_aero) && sc->streamDetectByLD) { for (j = 0; j < MAX_LOGICAL_DRIVES_EXT; ++j) { memset(sc->streamDetectByLD[i], 0, sizeof(LD_STREAM_DETECT)); sc->streamDetectByLD[i]->mruBitMap = MR_STREAM_BITMAP; @@ -3425,7 +3497,7 @@ mrsas_wait_for_outstanding(struct mrsas_softc *sc, u_i goto out; } /* Check if firmware is in fault state */ - fw_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + fw_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK; if (fw_state == MFI_STATE_FAULT) { mrsas_dprint(sc, MRSAS_OCR, @@ -3834,7 +3906,7 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, st io_req = mpt_cmd->io_request; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; Modified: stable/12/sys/dev/mrsas/mrsas.h ============================================================================== --- stable/12/sys/dev/mrsas/mrsas.h Thu Jan 3 07:59:51 2019 (r342718) +++ stable/12/sys/dev/mrsas/mrsas.h Thu Jan 3 08:03:43 2019 (r342719) @@ -91,7 +91,16 @@ __FBSDID("$FreeBSD$"); #define MRSAS_TOMCAT 0x0017 #define MRSAS_VENTURA_4PORT 0x001B #define MRSAS_CRUSADER_4PORT 0x001C +#define MRSAS_AERO_10E0 0x10E0 +#define MRSAS_AERO_10E1 0x10E1 +#define MRSAS_AERO_10E2 0x10E2 +#define MRSAS_AERO_10E3 0x10E3 +#define MRSAS_AERO_10E4 0x10E4 +#define MRSAS_AERO_10E5 0x10E5 +#define MRSAS_AERO_10E6 0x10E6 +#define MRSAS_AERO_10E7 0x10E7 + /* * Firmware State Defines */ @@ -110,7 +119,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "07.708.02.00-fbsd" +#define MRSAS_VERSION "07.709.01.00-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 @@ -1250,7 +1259,7 @@ typedef struct _mrsas_register_set { u_int32_t inbound_high_queue_port; /* 00C4h */ - u_int32_t reserved_5; /* 00C8h */ + u_int32_t inbound_single_queue_port; /* 00C8h */ u_int32_t res_6[11]; /* CCh */ u_int32_t host_diag; u_int32_t seq_offset; @@ -2307,6 +2316,8 @@ struct mrsas_ctrl_info { */ #define MR_CAN_HANDLE_SYNC_CACHE_OFFSET 0X01000000 +#define MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET (1 << 24) + /* * FW reports the maximum of number of commands that it can accept (maximum * commands that can be outstanding) at any time. The driver must report a @@ -3355,7 +3366,9 @@ struct mrsas_softc { u_int32_t nvme_page_size; boolean_t is_ventura; + boolean_t is_aero; boolean_t msix_combined; + boolean_t atomic_desc_support; u_int16_t maxRaidMapSize; /* Non dma-able memory. Driver local copy. */ Modified: stable/12/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- stable/12/sys/dev/mrsas/mrsas_cam.c Thu Jan 3 07:59:51 2019 (r342718) +++ stable/12/sys/dev/mrsas/mrsas_cam.c Thu Jan 3 08:03:43 2019 (r342719) @@ -867,7 +867,7 @@ mrsas_build_ldio_rw(struct mrsas_softc *sc, struct mrs "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (FAIL); } - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.numSGE = cmd->sge_count; else { /* @@ -1071,7 +1071,7 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp cmd->request_desc->SCSIIO.MSIxIndex = sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { if (sc->streamDetectByLD) { mtx_lock(&sc->stream_lock); mrsas_stream_detect(sc, cmd, &io_info); @@ -1121,7 +1121,7 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp io_request->RaidContext.raid_context.regLockFlags |= (MR_RL_FLAGS_GRANT_DESTINATION_CUDA | MR_RL_FLAGS_SEQ_NUM_ENABLE); - } else if (sc->is_ventura) { + } else if (sc->is_ventura || sc->is_aero) { io_request->RaidContext.raid_context_g35.Type = MPI2_TYPE_CUDA; io_request->RaidContext.raid_context_g35.nseg = 0x1; io_request->RaidContext.raid_context_g35.routingFlags.bits.sqn = 1; @@ -1139,14 +1139,14 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp &sc->load_balance_info[device_id], &io_info); cmd->load_balance = MRSAS_LOAD_BALANCE_FLAG; cmd->pd_r1_lb = io_info.pd_after_lb; - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.spanArm = io_info.span_arm; else io_request->RaidContext.raid_context.spanArm = io_info.span_arm; } else cmd->load_balance = 0; - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) cmd->r1_alt_dev_handle = io_info.r1_alt_dev_handle; else cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; @@ -1170,7 +1170,7 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp (MR_RL_FLAGS_GRANT_DESTINATION_CPU0 | MR_RL_FLAGS_SEQ_NUM_ENABLE); io_request->RaidContext.raid_context.nseg = 0x1; - } else if (sc->is_ventura) { + } else if (sc->is_ventura || sc->is_aero) { io_request->RaidContext.raid_context_g35.Type = MPI2_TYPE_CUDA; io_request->RaidContext.raid_context_g35.routingFlags.bits.sqn = 1; io_request->RaidContext.raid_context_g35.nseg = 0x1; @@ -1229,7 +1229,7 @@ mrsas_build_ldio_nonrw(struct mrsas_softc *sc, struct "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (1); } - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.numSGE = cmd->sge_count; else { /* @@ -1294,7 +1294,7 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrs device_id + 255; io_request->RaidContext.raid_context.configSeqNum = pd_sync->seq[device_id].seqNum; io_request->DevHandle = pd_sync->seq[device_id].devHandle; - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.routingFlags.bits.sqn = 1; else io_request->RaidContext.raid_context.regLockFlags |= @@ -1342,7 +1342,7 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrs * Because the NON RW cmds will now go via FW Queue * and not the Exception queue */ - if (sc->mrsas_gen3_ctrl || sc->is_ventura) + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; cmd->request_desc->SCSIIO.RequestFlags = @@ -1359,7 +1359,7 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrs "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (1); } - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.numSGE = cmd->sge_count; else { /* @@ -1522,7 +1522,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd io_request = cmd->io_request; sgl_ptr = (pMpi25IeeeSgeChain64_t)&io_request->SGL; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { pMpi25IeeeSgeChain64_t sgl_ptr_end = sgl_ptr; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -1533,7 +1533,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd sgl_ptr->Address = segs[i].ds_addr; sgl_ptr->Length = segs[i].ds_len; sgl_ptr->Flags = 0; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { if (i == nseg - 1) sgl_ptr->Flags = IEEE_SGE_FLAGS_END_OF_LIST; } @@ -1543,7 +1543,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd (nseg > sc->max_sge_in_main_msg)) { pMpi25IeeeSgeChain64_t sg_chain; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { if ((cmd->io_request->IoFlags & MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) != MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) cmd->io_request->ChainOffset = sc->chain_offset_io_request; @@ -1552,7 +1552,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd } else cmd->io_request->ChainOffset = sc->chain_offset_io_request; sg_chain = sgl_ptr; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) sg_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT; else sg_chain->Flags = (IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR); Modified: stable/12/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- stable/12/sys/dev/mrsas/mrsas_fp.c Thu Jan 3 07:59:51 2019 (r342718) +++ stable/12/sys/dev/mrsas/mrsas_fp.c Thu Jan 3 08:03:43 2019 (r342719) @@ -983,7 +983,7 @@ mr_spanset_get_phy_params(struct mrsas_softc *sc, u_in } *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { ((RAID_CONTEXT_G35 *) pRAID_Context)->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; io_info->span_arm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; @@ -1190,7 +1190,7 @@ MR_BuildRaidContext(struct mrsas_softc *sc, struct IO_ * if FP possible, set the SLUD bit in regLockFlags for * ventura */ - else if ((sc->is_ventura) && !isRead && + else if ((sc->is_ventura || sc->is_aero) && !isRead && (raid->writeMode == MR_RL_WRITE_BACK_MODE) && (raid->level <= 1) && raid->capability.fpCacheBypassCapable) { ((RAID_CONTEXT_G35 *) pRAID_Context)->routingFlags.bits.sld = 1; @@ -1729,7 +1729,7 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int32_t ld, } *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { ((RAID_CONTEXT_G35 *) pRAID_Context)->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; io_info->span_arm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; From owner-svn-src-all@freebsd.org Thu Jan 3 08:04:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CFA9141E556; Thu, 3 Jan 2019 08:04:16 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D39108F3E5; Thu, 3 Jan 2019 08:04:15 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C640C1E661; Thu, 3 Jan 2019 08:04:15 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0384F88075625; Thu, 3 Jan 2019 08:04:15 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0384FRr075621; Thu, 3 Jan 2019 08:04:15 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201901030804.x0384FRr075621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Thu, 3 Jan 2019 08:04:15 +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: r342720 - stable/11/sys/dev/mrsas X-SVN-Group: stable-11 X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: stable/11/sys/dev/mrsas X-SVN-Commit-Revision: 342720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D39108F3E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 08:04:16 -0000 Author: kadesai Date: Thu Jan 3 08:04:14 2019 New Revision: 342720 URL: https://svnweb.freebsd.org/changeset/base/342720 Log: MFC r342537-r342540 r342537 This patch will add support for latest generation MegaRAID adapters- Aero(39xx). Driver will throw a warning message when a Configurable secure type controller is encountered. r342538 This patch will add support for 32 bit atomic request descriptor for Aero adapters. For Aero adapters- 1. Driver will use 32 bit atomic descriptor to fire IOs and DCMDs. 2. Driver will use 64 bit request descriptor to fire IOC INIT. 3. If Aero firmware supports 32 bit atomic descriptor, then only driver will use it otherwise driver will use 64 bit request descriptor. For rest of adapters(Ventura, Invader and Thunderbolt), driver will use 64 bit request descriptors only. r342539 Problem statement: Due to hardware errata in Aero controllers, reads to certain fusion registers could intermittently return all zeroes. This behavior is transient in nature and subsequent reads will return valid value. Fix: For Aero controllers, any read will retry the read operations from certain registers for maximum three times, if read returns zero. r342540 Driver version upgrade. Modified: stable/11/sys/dev/mrsas/mrsas.c stable/11/sys/dev/mrsas/mrsas.h stable/11/sys/dev/mrsas/mrsas_cam.c stable/11/sys/dev/mrsas/mrsas_fp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas.c Thu Jan 3 08:03:43 2019 (r342719) +++ stable/11/sys/dev/mrsas/mrsas.c Thu Jan 3 08:04:14 2019 (r342720) @@ -95,6 +95,8 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t de static struct mrsas_softc * mrsas_get_softc_instance(struct cdev *dev, u_long cmd, caddr_t arg); +u_int32_t +mrsas_read_reg_with_retries(struct mrsas_softc *sc, int offset); u_int32_t mrsas_read_reg(struct mrsas_softc *sc, int offset); u_int8_t mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, @@ -171,6 +173,9 @@ void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); void mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, union ccb *ccb_ptr, u_int8_t status, u_int8_t extStatus, u_int32_t data_length, u_int8_t *sense); +void +mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, + u_int32_t req_desc_hi); SYSCTL_NODE(_hw, OID_AUTO, mrsas, CTLFLAG_RD, 0, "MRSAS Driver Parameters"); @@ -201,6 +206,14 @@ MRSAS_CTLR_ID device_table[] = { {0x1000, MRSAS_TOMCAT, 0xffff, 0xffff, "AVAGO Tomcat SAS Controller"}, {0x1000, MRSAS_VENTURA_4PORT, 0xffff, 0xffff, "AVAGO Ventura_4Port SAS Controller"}, {0x1000, MRSAS_CRUSADER_4PORT, 0xffff, 0xffff, "AVAGO Crusader_4Port SAS Controller"}, + {0x1000, MRSAS_AERO_10E0, 0xffff, 0xffff, "BROADCOM AERO-10E0 SAS Controller"}, + {0x1000, MRSAS_AERO_10E1, 0xffff, 0xffff, "BROADCOM AERO-10E1 SAS Controller"}, + {0x1000, MRSAS_AERO_10E2, 0xffff, 0xffff, "BROADCOM AERO-10E2 SAS Controller"}, + {0x1000, MRSAS_AERO_10E3, 0xffff, 0xffff, "BROADCOM AERO-10E3 SAS Controller"}, + {0x1000, MRSAS_AERO_10E4, 0xffff, 0xffff, "BROADCOM AERO-10E4 SAS Controller"}, + {0x1000, MRSAS_AERO_10E5, 0xffff, 0xffff, "BROADCOM AERO-10E5 SAS Controller"}, + {0x1000, MRSAS_AERO_10E6, 0xffff, 0xffff, "BROADCOM AERO-10E6 SAS Controller"}, + {0x1000, MRSAS_AERO_10E7, 0xffff, 0xffff, "BROADCOM AERO-10E7 SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -261,6 +274,22 @@ mrsas_write(struct cdev *dev, struct uio *uio, int iof return (0); } +u_int32_t +mrsas_read_reg_with_retries(struct mrsas_softc *sc, int offset) +{ + u_int32_t i = 0, ret_val; + + if (sc->is_aero) { + do { + ret_val = mrsas_read_reg(sc, offset); + i++; + } while(ret_val == 0 && i < 3); + } else + ret_val = mrsas_read_reg(sc, offset); + + return ret_val; +} + /* * Register Read/Write Functions * @@ -321,7 +350,7 @@ mrsas_clear_intr(struct mrsas_softc *sc) u_int32_t status; /* Read received interrupt */ - status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); + status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_intr_status)); /* Not our interrupt, so just return */ if (!(status & MFI_FUSION_ENABLE_INTERRUPT_MASK)) @@ -845,20 +874,37 @@ mrsas_attach(device_t dev) sc->mrsas_dev = dev; sc->device_id = pci_get_device(dev); - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + switch (sc->device_id) { + case MRSAS_INVADER: + case MRSAS_FURY: + case MRSAS_INTRUDER: + case MRSAS_INTRUDER_24: + case MRSAS_CUTLASS_52: + case MRSAS_CUTLASS_53: sc->mrsas_gen3_ctrl = 1; - } else if ((sc->device_id == MRSAS_VENTURA) || - (sc->device_id == MRSAS_CRUSADER) || - (sc->device_id == MRSAS_HARPOON) || - (sc->device_id == MRSAS_TOMCAT) || - (sc->device_id == MRSAS_VENTURA_4PORT) || - (sc->device_id == MRSAS_CRUSADER_4PORT)) { + break; + case MRSAS_VENTURA: + case MRSAS_CRUSADER: + case MRSAS_HARPOON: + case MRSAS_TOMCAT: + case MRSAS_VENTURA_4PORT: + case MRSAS_CRUSADER_4PORT: sc->is_ventura = true; + break; + case MRSAS_AERO_10E1: + case MRSAS_AERO_10E5: + device_printf(dev, "Adapter is in configurable secure mode\n"); + case MRSAS_AERO_10E2: + case MRSAS_AERO_10E6: + sc->is_aero = true; + break; + case MRSAS_AERO_10E0: + case MRSAS_AERO_10E3: + case MRSAS_AERO_10E4: + case MRSAS_AERO_10E7: + device_printf(dev, "Adapter is in non-secure mode\n"); + return SUCCESS; + } mrsas_get_tunables(sc); @@ -874,8 +920,8 @@ mrsas_attach(device_t dev) cmd |= PCIM_CMD_BUSMASTEREN; pci_write_config(dev, PCIR_COMMAND, cmd, 2); - /* For Ventura system registers are mapped to BAR0 */ - if (sc->is_ventura) + /* For Ventura/Aero system registers are mapped to BAR0 */ + if (sc->is_ventura || sc->is_aero) sc->reg_res_id = PCIR_BAR(0); /* BAR0 offset */ else sc->reg_res_id = PCIR_BAR(1); /* BAR1 offset */ @@ -1099,7 +1145,7 @@ mrsas_detach(device_t dev) mrsas_shutdown_ctlr(sc, MR_DCMD_CTRL_SHUTDOWN); mrsas_disable_intr(sc); - if (sc->is_ventura && sc->streamDetectByLD) { + if ((sc->is_ventura || sc->is_aero) && sc->streamDetectByLD) { for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) free(sc->streamDetectByLD[i], M_MRSAS); free(sc->streamDetectByLD, M_MRSAS); @@ -2285,8 +2331,8 @@ mrsas_init_fw(struct mrsas_softc *sc) if (ret != SUCCESS) { return (ret); } - if (sc->is_ventura) { - scratch_pad_3 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_3)); + if (sc->is_ventura || sc->is_aero) { + scratch_pad_3 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_3)); #if VD_EXT_DEBUG device_printf(sc->mrsas_dev, "scratch_pad_3 0x%x\n", scratch_pad_3); #endif @@ -2297,10 +2343,10 @@ mrsas_init_fw(struct mrsas_softc *sc) /* MSI-x index 0- reply post host index register */ sc->msix_reg_offset[0] = MPI2_REPLY_POST_HOST_INDEX_OFFSET; /* Check if MSI-X is supported while in ready state */ - msix_enable = (mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & 0x4000000) >> 0x1a; + msix_enable = (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & 0x4000000) >> 0x1a; if (msix_enable) { - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); /* Check max MSI-X vectors */ @@ -2316,7 +2362,7 @@ mrsas_init_fw(struct mrsas_softc *sc) fw_msix_count = sc->msix_vectors; if ((sc->mrsas_gen3_ctrl && (sc->msix_vectors > 8)) || - (sc->is_ventura && (sc->msix_vectors > 16))) + ((sc->is_ventura || sc->is_aero) && (sc->msix_vectors > 16))) sc->msix_combined = true; /* * Save 1-15 reply post index @@ -2359,8 +2405,8 @@ mrsas_init_fw(struct mrsas_softc *sc) return (1); } - if (sc->is_ventura) { - scratch_pad_4 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + if (sc->is_ventura || sc->is_aero) { + scratch_pad_4 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_4)); if ((scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK) >= MR_DEFAULT_NVME_PAGE_SHIFT) sc->nvme_page_size = 1 << (scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK); @@ -2424,7 +2470,7 @@ mrsas_init_fw(struct mrsas_softc *sc) return (1); } - if (sc->is_ventura && sc->drv_stream_detection) { + if ((sc->is_ventura || sc->is_aero) && sc->drv_stream_detection) { sc->streamDetectByLD = malloc(sizeof(PTR_LD_STREAM_DETECT) * MAX_LOGICAL_DRIVES_EXT, M_MRSAS, M_NOWAIT); if (!sc->streamDetectByLD) { @@ -2501,7 +2547,7 @@ mrsas_init_adapter(struct mrsas_softc *sc) int i = 0; /* Read FW status register */ - status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); + status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); sc->max_fw_cmds = status & MRSAS_FWSTATE_MAXCMD_MASK; @@ -2516,7 +2562,7 @@ mrsas_init_adapter(struct mrsas_softc *sc) sc->reply_alloc_sz = sizeof(MPI2_REPLY_DESCRIPTORS_UNION) * (sc->reply_q_depth); sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1)); - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); /* * If scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK is set, @@ -2654,7 +2700,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) } if (!sc->block_sync_cache) { - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); sc->fw_sync_cache_support = (scratch_pad_2 & MR_CAN_HANDLE_SYNC_CACHE_OFFSET) ? 1 : 0; @@ -2678,7 +2724,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; /* driver support Extended MSIX */ - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -2703,7 +2749,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) mrsas_disable_intr(sc); mrsas_dprint(sc, MRSAS_OCR, "Issuing IOC INIT command to FW.\n"); - mrsas_fire_cmd(sc, req_desc.addr.u.low, req_desc.addr.u.high); + mrsas_write_64bit_req_desc(sc, req_desc.addr.u.low, req_desc.addr.u.high); /* * Poll response timer to wait for Firmware response. While this @@ -2729,6 +2775,15 @@ mrsas_ioc_init(struct mrsas_softc *sc) retcode = 1; } + if (sc->is_aero) { + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, + outbound_scratch_pad_2)); + sc->atomic_desc_support = (scratch_pad_2 & + MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET) ? 1 : 0; + device_printf(sc->mrsas_dev, "FW supports atomic descriptor: %s\n", + sc->atomic_desc_support ? "Yes" : "No"); + } + mrsas_free_ioc_cmd(sc); return (retcode); } @@ -2828,16 +2883,13 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) } /* - * mrsas_fire_cmd: Sends command to FW + * mrsas_write_64bit_req_dsc: Writes 64 bit request descriptor to FW * input: Adapter softstate - * request descriptor address low - * request descriptor address high - * - * This functions fires the command to Firmware by writing to the - * inbound_low_queue_port and inbound_high_queue_port. + * request descriptor address low + * request descriptor address high */ void -mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, +mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi) { mtx_lock(&sc->pci_lock); @@ -2849,6 +2901,26 @@ mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_d } /* + * mrsas_fire_cmd: Sends command to FW + * input: Adapter softstate + * request descriptor address low + * request descriptor address high + * + * This functions fires the command to Firmware by writing to the + * inbound_low_queue_port and inbound_high_queue_port. + */ +void +mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, + u_int32_t req_desc_hi) +{ + if (sc->atomic_desc_support) + mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_single_queue_port), + req_desc_lo); + else + mrsas_write_64bit_req_desc(sc, req_desc_lo, req_desc_hi); +} + +/* * mrsas_transition_to_ready: Move FW to Ready state input: * Adapter instance soft state * @@ -2866,7 +2938,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int u_int32_t cur_state; u_int32_t abs_state, curr_abs_state; - val = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); + val = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); fw_state = val & MFI_STATE_MASK; max_wait = MRSAS_RESET_WAIT_TIME; @@ -2874,7 +2946,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int device_printf(sc->mrsas_dev, "Waiting for FW to come to ready state\n"); while (fw_state != MFI_STATE_READY) { - abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); + abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); switch (fw_state) { case MFI_STATE_FAULT: device_printf(sc->mrsas_dev, "FW is in FAULT state!!\n"); @@ -2902,7 +2974,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int mrsas_disable_intr(sc); mrsas_write_reg(sc, offsetof(mrsas_reg_set, doorbell), MFI_RESET_FLAGS); for (i = 0; i < max_wait * 1000; i++) { - if (mrsas_read_reg(sc, offsetof(mrsas_reg_set, doorbell)) & 1) + if (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, doorbell)) & 1) DELAY(1000); else break; @@ -2940,9 +3012,9 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int * The cur_state should not last for more than max_wait secs */ for (i = 0; i < (max_wait * 1000); i++) { - fw_state = (mrsas_read_reg(sc, offsetof(mrsas_reg_set, + fw_state = (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK); - curr_abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + curr_abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); if (abs_state == curr_abs_state) DELAY(1000); @@ -3017,7 +3089,7 @@ mrsas_ocr_thread(void *arg) "Hardware critical error", __func__); break; } - fw_status = mrsas_read_reg(sc, + fw_status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); fw_state = fw_status & MFI_STATE_MASK; if (fw_state == MFI_STATE_FAULT || sc->do_timedout_reset || @@ -3176,7 +3248,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese mtx_lock(&sc->sim_lock); - status_reg = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + status_reg = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); abs_state = status_reg & MFI_STATE_MASK; reset_adapter = status_reg & MFI_RESET_ADAPTER; @@ -3206,12 +3278,12 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese MPI2_WRSEQ_6TH_KEY_VALUE); /* Check that the diag write enable (DRWE) bit is on */ - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); retry = 0; while (!(host_diag & HOST_DIAG_WRITE_ENABLE)) { DELAY(100 * 1000); - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); if (retry++ == 100) { mrsas_dprint(sc, MRSAS_OCR, @@ -3228,12 +3300,12 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese DELAY(3000 * 1000); /* Make sure reset adapter bit is cleared */ - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); retry = 0; while (host_diag & HOST_DIAG_RESET_ADAPTER) { DELAY(100 * 1000); - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); if (retry++ == 1000) { mrsas_dprint(sc, MRSAS_OCR, @@ -3244,13 +3316,13 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese if (host_diag & HOST_DIAG_RESET_ADAPTER) continue; - abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK; retry = 0; while ((abs_state <= MFI_STATE_FW_INIT) && (retry++ < 1000)) { DELAY(100 * 1000); - abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK; } if (abs_state <= MFI_STATE_FW_INIT) { @@ -3306,7 +3378,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese megasas_setup_jbod_map(sc); - if (sc->is_ventura && sc->streamDetectByLD) { + if ((sc->is_ventura || sc->is_aero) && sc->streamDetectByLD) { for (j = 0; j < MAX_LOGICAL_DRIVES_EXT; ++j) { memset(sc->streamDetectByLD[i], 0, sizeof(LD_STREAM_DETECT)); sc->streamDetectByLD[i]->mruBitMap = MR_STREAM_BITMAP; @@ -3425,7 +3497,7 @@ mrsas_wait_for_outstanding(struct mrsas_softc *sc, u_i goto out; } /* Check if firmware is in fault state */ - fw_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + fw_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK; if (fw_state == MFI_STATE_FAULT) { mrsas_dprint(sc, MRSAS_OCR, @@ -3834,7 +3906,7 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, st io_req = mpt_cmd->io_request; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; Modified: stable/11/sys/dev/mrsas/mrsas.h ============================================================================== --- stable/11/sys/dev/mrsas/mrsas.h Thu Jan 3 08:03:43 2019 (r342719) +++ stable/11/sys/dev/mrsas/mrsas.h Thu Jan 3 08:04:14 2019 (r342720) @@ -91,7 +91,16 @@ __FBSDID("$FreeBSD$"); #define MRSAS_TOMCAT 0x0017 #define MRSAS_VENTURA_4PORT 0x001B #define MRSAS_CRUSADER_4PORT 0x001C +#define MRSAS_AERO_10E0 0x10E0 +#define MRSAS_AERO_10E1 0x10E1 +#define MRSAS_AERO_10E2 0x10E2 +#define MRSAS_AERO_10E3 0x10E3 +#define MRSAS_AERO_10E4 0x10E4 +#define MRSAS_AERO_10E5 0x10E5 +#define MRSAS_AERO_10E6 0x10E6 +#define MRSAS_AERO_10E7 0x10E7 + /* * Firmware State Defines */ @@ -110,7 +119,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "07.708.02.00-fbsd" +#define MRSAS_VERSION "07.709.01.00-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 @@ -1250,7 +1259,7 @@ typedef struct _mrsas_register_set { u_int32_t inbound_high_queue_port; /* 00C4h */ - u_int32_t reserved_5; /* 00C8h */ + u_int32_t inbound_single_queue_port; /* 00C8h */ u_int32_t res_6[11]; /* CCh */ u_int32_t host_diag; u_int32_t seq_offset; @@ -2307,6 +2316,8 @@ struct mrsas_ctrl_info { */ #define MR_CAN_HANDLE_SYNC_CACHE_OFFSET 0X01000000 +#define MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET (1 << 24) + /* * FW reports the maximum of number of commands that it can accept (maximum * commands that can be outstanding) at any time. The driver must report a @@ -3355,7 +3366,9 @@ struct mrsas_softc { u_int32_t nvme_page_size; boolean_t is_ventura; + boolean_t is_aero; boolean_t msix_combined; + boolean_t atomic_desc_support; u_int16_t maxRaidMapSize; /* Non dma-able memory. Driver local copy. */ Modified: stable/11/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas_cam.c Thu Jan 3 08:03:43 2019 (r342719) +++ stable/11/sys/dev/mrsas/mrsas_cam.c Thu Jan 3 08:04:14 2019 (r342720) @@ -868,7 +868,7 @@ mrsas_build_ldio_rw(struct mrsas_softc *sc, struct mrs "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (FAIL); } - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.numSGE = cmd->sge_count; else { /* @@ -1072,7 +1072,7 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp cmd->request_desc->SCSIIO.MSIxIndex = sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { if (sc->streamDetectByLD) { mtx_lock(&sc->stream_lock); mrsas_stream_detect(sc, cmd, &io_info); @@ -1122,7 +1122,7 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp io_request->RaidContext.raid_context.regLockFlags |= (MR_RL_FLAGS_GRANT_DESTINATION_CUDA | MR_RL_FLAGS_SEQ_NUM_ENABLE); - } else if (sc->is_ventura) { + } else if (sc->is_ventura || sc->is_aero) { io_request->RaidContext.raid_context_g35.Type = MPI2_TYPE_CUDA; io_request->RaidContext.raid_context_g35.nseg = 0x1; io_request->RaidContext.raid_context_g35.routingFlags.bits.sqn = 1; @@ -1140,14 +1140,14 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp &sc->load_balance_info[device_id], &io_info); cmd->load_balance = MRSAS_LOAD_BALANCE_FLAG; cmd->pd_r1_lb = io_info.pd_after_lb; - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.spanArm = io_info.span_arm; else io_request->RaidContext.raid_context.spanArm = io_info.span_arm; } else cmd->load_balance = 0; - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) cmd->r1_alt_dev_handle = io_info.r1_alt_dev_handle; else cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; @@ -1171,7 +1171,7 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp (MR_RL_FLAGS_GRANT_DESTINATION_CPU0 | MR_RL_FLAGS_SEQ_NUM_ENABLE); io_request->RaidContext.raid_context.nseg = 0x1; - } else if (sc->is_ventura) { + } else if (sc->is_ventura || sc->is_aero) { io_request->RaidContext.raid_context_g35.Type = MPI2_TYPE_CUDA; io_request->RaidContext.raid_context_g35.routingFlags.bits.sqn = 1; io_request->RaidContext.raid_context_g35.nseg = 0x1; @@ -1230,7 +1230,7 @@ mrsas_build_ldio_nonrw(struct mrsas_softc *sc, struct "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (1); } - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.numSGE = cmd->sge_count; else { /* @@ -1295,7 +1295,7 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrs device_id + 255; io_request->RaidContext.raid_context.configSeqNum = pd_sync->seq[device_id].seqNum; io_request->DevHandle = pd_sync->seq[device_id].devHandle; - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.routingFlags.bits.sqn = 1; else io_request->RaidContext.raid_context.regLockFlags |= @@ -1343,7 +1343,7 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrs * Because the NON RW cmds will now go via FW Queue * and not the Exception queue */ - if (sc->mrsas_gen3_ctrl || sc->is_ventura) + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; cmd->request_desc->SCSIIO.RequestFlags = @@ -1360,7 +1360,7 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrs "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (1); } - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.numSGE = cmd->sge_count; else { /* @@ -1523,7 +1523,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd io_request = cmd->io_request; sgl_ptr = (pMpi25IeeeSgeChain64_t)&io_request->SGL; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { pMpi25IeeeSgeChain64_t sgl_ptr_end = sgl_ptr; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -1534,7 +1534,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd sgl_ptr->Address = segs[i].ds_addr; sgl_ptr->Length = segs[i].ds_len; sgl_ptr->Flags = 0; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { if (i == nseg - 1) sgl_ptr->Flags = IEEE_SGE_FLAGS_END_OF_LIST; } @@ -1544,7 +1544,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd (nseg > sc->max_sge_in_main_msg)) { pMpi25IeeeSgeChain64_t sg_chain; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { if ((cmd->io_request->IoFlags & MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) != MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) cmd->io_request->ChainOffset = sc->chain_offset_io_request; @@ -1553,7 +1553,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd } else cmd->io_request->ChainOffset = sc->chain_offset_io_request; sg_chain = sgl_ptr; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) sg_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT; else sg_chain->Flags = (IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR); Modified: stable/11/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas_fp.c Thu Jan 3 08:03:43 2019 (r342719) +++ stable/11/sys/dev/mrsas/mrsas_fp.c Thu Jan 3 08:04:14 2019 (r342720) @@ -983,7 +983,7 @@ mr_spanset_get_phy_params(struct mrsas_softc *sc, u_in } *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { ((RAID_CONTEXT_G35 *) pRAID_Context)->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; io_info->span_arm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; @@ -1190,7 +1190,7 @@ MR_BuildRaidContext(struct mrsas_softc *sc, struct IO_ * if FP possible, set the SLUD bit in regLockFlags for * ventura */ - else if ((sc->is_ventura) && !isRead && + else if ((sc->is_ventura || sc->is_aero) && !isRead && (raid->writeMode == MR_RL_WRITE_BACK_MODE) && (raid->level <= 1) && raid->capability.fpCacheBypassCapable) { ((RAID_CONTEXT_G35 *) pRAID_Context)->routingFlags.bits.sld = 1; @@ -1729,7 +1729,7 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int32_t ld, } *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { ((RAID_CONTEXT_G35 *) pRAID_Context)->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; io_info->span_arm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; From owner-svn-src-all@freebsd.org Thu Jan 3 09:04:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 184DD142120B; Thu, 3 Jan 2019 09:04:00 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFF956AA33; Thu, 3 Jan 2019 09:03:59 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9674B1F093; Thu, 3 Jan 2019 09:03:59 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0393xNt007849; Thu, 3 Jan 2019 09:03:59 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0393whW007845; Thu, 3 Jan 2019 09:03:58 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201901030903.x0393whW007845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 3 Jan 2019 09:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342721 - in head/stand/efi: include libefi loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand/efi: include libefi loader X-SVN-Commit-Revision: 342721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFF956AA33 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 09:04:00 -0000 Author: tsoome Date: Thu Jan 3 09:03:58 2019 New Revision: 342721 URL: https://svnweb.freebsd.org/changeset/base/342721 Log: loader.efi: update memmap command to recognize new attributes Also move memory type to string translation to libefi for later use. MFC after: 2 weeks Modified: head/stand/efi/include/efidef.h head/stand/efi/include/efilib.h head/stand/efi/libefi/env.c head/stand/efi/loader/main.c Modified: head/stand/efi/include/efidef.h ============================================================================== --- head/stand/efi/include/efidef.h Thu Jan 3 08:04:14 2019 (r342720) +++ head/stand/efi/include/efidef.h Thu Jan 3 09:03:58 2019 (r342721) @@ -157,23 +157,27 @@ typedef enum { EfiMemoryMappedIO, EfiMemoryMappedIOPortSpace, EfiPalCode, + EfiPersistentMemory, EfiMaxMemoryType } EFI_MEMORY_TYPE; // possible caching types for the memory range -#define EFI_MEMORY_UC 0x0000000000000001 -#define EFI_MEMORY_WC 0x0000000000000002 -#define EFI_MEMORY_WT 0x0000000000000004 -#define EFI_MEMORY_WB 0x0000000000000008 -#define EFI_MEMORY_UCE 0x0000000000000010 +#define EFI_MEMORY_UC 0x0000000000000001 +#define EFI_MEMORY_WC 0x0000000000000002 +#define EFI_MEMORY_WT 0x0000000000000004 +#define EFI_MEMORY_WB 0x0000000000000008 +#define EFI_MEMORY_UCE 0x0000000000000010 // physical memory protection on range -#define EFI_MEMORY_WP 0x0000000000001000 -#define EFI_MEMORY_RP 0x0000000000002000 -#define EFI_MEMORY_XP 0x0000000000004000 +#define EFI_MEMORY_WP 0x0000000000001000 +#define EFI_MEMORY_RP 0x0000000000002000 +#define EFI_MEMORY_XP 0x0000000000004000 +#define EFI_MEMORY_NV 0x0000000000008000 +#define EFI_MEMORY_MORE_RELIABLE 0x0000000000010000 +#define EFI_MEMORY_RO 0x0000000000020000 // range requires a runtime mapping -#define EFI_MEMORY_RUNTIME 0x8000000000000000 +#define EFI_MEMORY_RUNTIME 0x8000000000000000 #define EFI_MEMORY_DESCRIPTOR_VERSION 1 typedef struct { Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Thu Jan 3 08:04:14 2019 (r342720) +++ head/stand/efi/include/efilib.h Thu Jan 3 09:03:58 2019 (r342721) @@ -108,6 +108,9 @@ void delay(int usecs); /* EFI environment initialization. */ void efi_init_environment(void); +/* EFI Memory type strings. */ +const char *efi_memory_type(EFI_MEMORY_TYPE); + /* CHAR16 utility functions. */ int wcscmp(CHAR16 *, CHAR16 *); void cpy8to16(const char *, CHAR16 *, size_t); Modified: head/stand/efi/libefi/env.c ============================================================================== --- head/stand/efi/libefi/env.c Thu Jan 3 08:04:14 2019 (r342720) +++ head/stand/efi/libefi/env.c Thu Jan 3 09:03:58 2019 (r342721) @@ -47,6 +47,49 @@ efi_init_environment(void) COMMAND_SET(efishow, "efi-show", "print some or all EFI variables", command_efi_show); +const char * +efi_memory_type(EFI_MEMORY_TYPE type) +{ + const char *types[] = { + "Reserved", + "LoaderCode", + "LoaderData", + "BootServicesCode", + "BootServicesData", + "RuntimeServicesCode", + "RuntimeServicesData", + "ConventionalMemory", + "UnusableMemory", + "ACPIReclaimMemory", + "ACPIMemoryNVS", + "MemoryMappedIO", + "MemoryMappedIOPortSpace", + "PalCode", + "PersistentMemory" + }; + + switch (type) { + case EfiReservedMemoryType: + case EfiLoaderCode: + case EfiLoaderData: + case EfiBootServicesCode: + case EfiBootServicesData: + case EfiRuntimeServicesCode: + case EfiRuntimeServicesData: + case EfiConventionalMemory: + case EfiUnusableMemory: + case EfiACPIReclaimMemory: + case EfiACPIMemoryNVS: + case EfiMemoryMappedIO: + case EfiMemoryMappedIOPortSpace: + case EfiPalCode: + case EfiPersistentMemory: + return (types[type]); + default: + return ("Unknown"); + } +} + static int efi_print_var(CHAR16 *varnamearg, EFI_GUID *matchguid, int lflag) { Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Thu Jan 3 08:04:14 2019 (r342720) +++ head/stand/efi/loader/main.c Thu Jan 3 09:03:58 2019 (r342721) @@ -1041,7 +1041,7 @@ command_quit(int argc, char *argv[]) COMMAND_SET(memmap, "memmap", "print memory map", command_memmap); static int -command_memmap(int argc, char *argv[]) +command_memmap(int argc __unused, char *argv[] __unused) { UINTN sz; EFI_MEMORY_DESCRIPTOR *map, *p; @@ -1050,22 +1050,6 @@ command_memmap(int argc, char *argv[]) EFI_STATUS status; int i, ndesc; char line[80]; - static char *types[] = { - "Reserved", - "LoaderCode", - "LoaderData", - "BootServicesCode", - "BootServicesData", - "RuntimeServicesCode", - "RuntimeServicesData", - "ConventionalMemory", - "UnusableMemory", - "ACPIReclaimMemory", - "ACPIMemoryNVS", - "MemoryMappedIO", - "MemoryMappedIOPortSpace", - "PalCode" - }; sz = 0; status = BS->GetMemoryMap(&sz, 0, &key, &dsz, &dver); @@ -1091,9 +1075,12 @@ command_memmap(int argc, char *argv[]) for (i = 0, p = map; i < ndesc; i++, p = NextMemoryDescriptor(p, dsz)) { - printf("%23s %012jx %012jx %08jx ", types[p->Type], - (uintmax_t)p->PhysicalStart, (uintmax_t)p->VirtualStart, - (uintmax_t)p->NumberOfPages); + snprintf(line, sizeof(line), "%23s %012jx %012jx %08jx ", + efi_memory_type(p->Type), (uintmax_t)p->PhysicalStart, + (uintmax_t)p->VirtualStart, (uintmax_t)p->NumberOfPages); + if (pager_output(line)) + break; + if (p->Attribute & EFI_MEMORY_UC) printf("UC "); if (p->Attribute & EFI_MEMORY_WC) @@ -1110,6 +1097,12 @@ command_memmap(int argc, char *argv[]) printf("RP "); if (p->Attribute & EFI_MEMORY_XP) printf("XP "); + if (p->Attribute & EFI_MEMORY_NV) + printf("NV "); + if (p->Attribute & EFI_MEMORY_MORE_RELIABLE) + printf("MR "); + if (p->Attribute & EFI_MEMORY_RO) + printf("RO "); if (pager_output("\n")) break; } From owner-svn-src-all@freebsd.org Thu Jan 3 09:23:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07B821421F26; Thu, 3 Jan 2019 09:23:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0CE66B843; Thu, 3 Jan 2019 09:23:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73F9A1F423; Thu, 3 Jan 2019 09:23:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x039NZFu018338; Thu, 3 Jan 2019 09:23:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x039NZor018337; Thu, 3 Jan 2019 09:23:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901030923.x039NZor018337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Jan 2019 09:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342722 - stable/12/sys/dev/sound/usb X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/sound/usb X-SVN-Commit-Revision: 342722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0CE66B843 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.995,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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: Thu, 03 Jan 2019 09:23:36 -0000 Author: hselasky Date: Thu Jan 3 09:23:35 2019 New Revision: 342722 URL: https://svnweb.freebsd.org/changeset/base/342722 Log: MFC r342456: Fix reading of USB sample rate descriptor for SPL Crimson Rev 1. Read first one entry, then try to read the full rate descriptor table. PR: 234380 Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/sound/usb/uaudio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/12/sys/dev/sound/usb/uaudio.c Thu Jan 3 09:03:58 2019 (r342721) +++ stable/12/sys/dev/sound/usb/uaudio.c Thu Jan 3 09:23:35 2019 (r342722) @@ -1520,7 +1520,8 @@ uaudio20_check_rate(struct usb_device *udev, uint8_t i { struct usb_device_request req; usb_error_t error; - uint8_t data[255]; +#define UAUDIO20_MAX_RATES 32 /* we support at maxium 32 rates */ + uint8_t data[2 + UAUDIO20_MAX_RATES * 12]; uint16_t actlen; uint16_t rates; uint16_t x; @@ -1532,19 +1533,57 @@ uaudio20_check_rate(struct usb_device *udev, uint8_t i req.bRequest = UA20_CS_RANGE; USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); USETW2(req.wIndex, clockid, iface_no); - USETW(req.wLength, 255); + /* + * Assume there is at least one rate to begin with, else some + * devices might refuse to return the USB descriptor: + */ + USETW(req.wLength, (2 + 1 * 12)); - error = usbd_do_request_flags(udev, NULL, &req, data, + error = usbd_do_request_flags(udev, NULL, &req, data, USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); - if (error != 0 || actlen < 2) - return (USB_ERR_INVAL); + if (error != 0 || actlen < 2) { + /* + * Likely the descriptor doesn't fit into the supplied + * buffer. Try using a larger buffer and see if that + * helps: + */ + rates = MIN(UAUDIO20_MAX_RATES, (255 - 2) / 12); + error = USB_ERR_INVAL; + } else { + rates = UGETW(data); - rates = data[0] | (data[1] << 8); + if (rates > UAUDIO20_MAX_RATES) { + DPRINTF("Too many rates truncating to %d\n", UAUDIO20_MAX_RATES); + rates = UAUDIO20_MAX_RATES; + error = USB_ERR_INVAL; + } else if (rates > 1) { + DPRINTF("Need to read full rate descriptor\n"); + error = USB_ERR_INVAL; + } + } + + if (error != 0) { + /* + * Try to read full rate descriptor. + */ + actlen = (2 + rates * 12); + + USETW(req.wLength, actlen); + + error = usbd_do_request_flags(udev, NULL, &req, data, + USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); + + if (error != 0 || actlen < 2) + return (USB_ERR_INVAL); + + rates = UGETW(data); + } + actlen = (actlen - 2) / 12; if (rates > actlen) { - DPRINTF("Too many rates\n"); + DPRINTF("Too many rates truncating to %d\n", actlen); rates = actlen; } From owner-svn-src-all@freebsd.org Thu Jan 3 09:24:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7CF41421FA1; Thu, 3 Jan 2019 09:24:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE396B990; Thu, 3 Jan 2019 09:24:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 356481F425; Thu, 3 Jan 2019 09:24:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x039Ock0018452; Thu, 3 Jan 2019 09:24:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x039Ocad018451; Thu, 3 Jan 2019 09:24:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901030924.x039Ocad018451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Jan 2019 09:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342723 - stable/11/sys/dev/sound/usb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/sound/usb X-SVN-Commit-Revision: 342723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CE396B990 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.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 09:24:39 -0000 Author: hselasky Date: Thu Jan 3 09:24:37 2019 New Revision: 342723 URL: https://svnweb.freebsd.org/changeset/base/342723 Log: MFC r342456: Fix reading of USB sample rate descriptor for SPL Crimson Rev 1. Read first one entry, then try to read the full rate descriptor table. PR: 234380 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/sound/usb/uaudio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/11/sys/dev/sound/usb/uaudio.c Thu Jan 3 09:23:35 2019 (r342722) +++ stable/11/sys/dev/sound/usb/uaudio.c Thu Jan 3 09:24:37 2019 (r342723) @@ -1518,7 +1518,8 @@ uaudio20_check_rate(struct usb_device *udev, uint8_t i { struct usb_device_request req; usb_error_t error; - uint8_t data[255]; +#define UAUDIO20_MAX_RATES 32 /* we support at maxium 32 rates */ + uint8_t data[2 + UAUDIO20_MAX_RATES * 12]; uint16_t actlen; uint16_t rates; uint16_t x; @@ -1530,19 +1531,57 @@ uaudio20_check_rate(struct usb_device *udev, uint8_t i req.bRequest = UA20_CS_RANGE; USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); USETW2(req.wIndex, clockid, iface_no); - USETW(req.wLength, 255); + /* + * Assume there is at least one rate to begin with, else some + * devices might refuse to return the USB descriptor: + */ + USETW(req.wLength, (2 + 1 * 12)); - error = usbd_do_request_flags(udev, NULL, &req, data, + error = usbd_do_request_flags(udev, NULL, &req, data, USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); - if (error != 0 || actlen < 2) - return (USB_ERR_INVAL); + if (error != 0 || actlen < 2) { + /* + * Likely the descriptor doesn't fit into the supplied + * buffer. Try using a larger buffer and see if that + * helps: + */ + rates = MIN(UAUDIO20_MAX_RATES, (255 - 2) / 12); + error = USB_ERR_INVAL; + } else { + rates = UGETW(data); - rates = data[0] | (data[1] << 8); + if (rates > UAUDIO20_MAX_RATES) { + DPRINTF("Too many rates truncating to %d\n", UAUDIO20_MAX_RATES); + rates = UAUDIO20_MAX_RATES; + error = USB_ERR_INVAL; + } else if (rates > 1) { + DPRINTF("Need to read full rate descriptor\n"); + error = USB_ERR_INVAL; + } + } + + if (error != 0) { + /* + * Try to read full rate descriptor. + */ + actlen = (2 + rates * 12); + + USETW(req.wLength, actlen); + + error = usbd_do_request_flags(udev, NULL, &req, data, + USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); + + if (error != 0 || actlen < 2) + return (USB_ERR_INVAL); + + rates = UGETW(data); + } + actlen = (actlen - 2) / 12; if (rates > actlen) { - DPRINTF("Too many rates\n"); + DPRINTF("Too many rates truncating to %d\n", actlen); rates = actlen; } From owner-svn-src-all@freebsd.org Thu Jan 3 09:25:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74F25142207E; Thu, 3 Jan 2019 09:25:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 197F86BB04; Thu, 3 Jan 2019 09:25:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEBBD1F429; Thu, 3 Jan 2019 09:25:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x039PdqO018579; Thu, 3 Jan 2019 09:25:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x039PdGa018578; Thu, 3 Jan 2019 09:25:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901030925.x039PdGa018578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Jan 2019 09:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342724 - stable/10/sys/dev/sound/usb X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/sound/usb X-SVN-Commit-Revision: 342724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 197F86BB04 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.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 09:25:40 -0000 Author: hselasky Date: Thu Jan 3 09:25:39 2019 New Revision: 342724 URL: https://svnweb.freebsd.org/changeset/base/342724 Log: MFC r342456: Fix reading of USB sample rate descriptor for SPL Crimson Rev 1. Read first one entry, then try to read the full rate descriptor table. PR: 234380 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/sound/usb/uaudio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/10/sys/dev/sound/usb/uaudio.c Thu Jan 3 09:24:37 2019 (r342723) +++ stable/10/sys/dev/sound/usb/uaudio.c Thu Jan 3 09:25:39 2019 (r342724) @@ -1524,7 +1524,8 @@ uaudio20_check_rate(struct usb_device *udev, uint8_t i { struct usb_device_request req; usb_error_t error; - uint8_t data[255]; +#define UAUDIO20_MAX_RATES 32 /* we support at maxium 32 rates */ + uint8_t data[2 + UAUDIO20_MAX_RATES * 12]; uint16_t actlen; uint16_t rates; uint16_t x; @@ -1536,19 +1537,57 @@ uaudio20_check_rate(struct usb_device *udev, uint8_t i req.bRequest = UA20_CS_RANGE; USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); USETW2(req.wIndex, clockid, iface_no); - USETW(req.wLength, 255); + /* + * Assume there is at least one rate to begin with, else some + * devices might refuse to return the USB descriptor: + */ + USETW(req.wLength, (2 + 1 * 12)); - error = usbd_do_request_flags(udev, NULL, &req, data, + error = usbd_do_request_flags(udev, NULL, &req, data, USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); - if (error != 0 || actlen < 2) - return (USB_ERR_INVAL); + if (error != 0 || actlen < 2) { + /* + * Likely the descriptor doesn't fit into the supplied + * buffer. Try using a larger buffer and see if that + * helps: + */ + rates = MIN(UAUDIO20_MAX_RATES, (255 - 2) / 12); + error = USB_ERR_INVAL; + } else { + rates = UGETW(data); - rates = data[0] | (data[1] << 8); + if (rates > UAUDIO20_MAX_RATES) { + DPRINTF("Too many rates truncating to %d\n", UAUDIO20_MAX_RATES); + rates = UAUDIO20_MAX_RATES; + error = USB_ERR_INVAL; + } else if (rates > 1) { + DPRINTF("Need to read full rate descriptor\n"); + error = USB_ERR_INVAL; + } + } + + if (error != 0) { + /* + * Try to read full rate descriptor. + */ + actlen = (2 + rates * 12); + + USETW(req.wLength, actlen); + + error = usbd_do_request_flags(udev, NULL, &req, data, + USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); + + if (error != 0 || actlen < 2) + return (USB_ERR_INVAL); + + rates = UGETW(data); + } + actlen = (actlen - 2) / 12; if (rates > actlen) { - DPRINTF("Too many rates\n"); + DPRINTF("Too many rates truncating to %d\n", actlen); rates = actlen; } From owner-svn-src-all@freebsd.org Thu Jan 3 09:26:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CE4614221B4; Thu, 3 Jan 2019 09:26:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FAF66BCFA; Thu, 3 Jan 2019 09:26:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E9171F42B; Thu, 3 Jan 2019 09:26:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x039Qjhi018700; Thu, 3 Jan 2019 09:26:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x039QjXO018698; Thu, 3 Jan 2019 09:26:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901030926.x039QjXO018698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Jan 2019 09:26: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: r342725 - in stable/12/sys/dev/usb: . quirk X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys/dev/usb: . quirk X-SVN-Commit-Revision: 342725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FAF66BCFA 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(-0.99)[-0.995,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)[-0.998,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, 03 Jan 2019 09:26:46 -0000 Author: hselasky Date: Thu Jan 3 09:26:45 2019 New Revision: 342725 URL: https://svnweb.freebsd.org/changeset/base/342725 Log: MFC r342549: Add USB quirk for SPL Crimson Rev 1. PR: 234380 Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/quirk/usb_quirk.c stable/12/sys/dev/usb/usbdevs Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/12/sys/dev/usb/quirk/usb_quirk.c Thu Jan 3 09:25:39 2019 (r342724) +++ stable/12/sys/dev/usb/quirk/usb_quirk.c Thu Jan 3 09:26:45 2019 (r342725) @@ -526,6 +526,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(MAUDIO, FASTTRACKULTRA, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(MAUDIO, FASTTRACKULTRA8R, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(CMEDIA, CM6206, 0x0000, 0xffff, UQ_AU_SET_SPDIF_CM6206), + USB_QUIRK(PLOYTEC, SPL_CRIMSON_1, 0x0000, 0xffff, UQ_CFG_INDEX_1), /* * Quirks for manufacturers which USB devices does not respond Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Thu Jan 3 09:25:39 2019 (r342724) +++ stable/12/sys/dev/usb/usbdevs Thu Jan 3 09:26:45 2019 (r342725) @@ -498,6 +498,7 @@ vendor ASAHIOPTICAL 0x0a17 Asahi Optical vendor BOCASYSTEMS 0x0a43 Boca Systems vendor SHANTOU 0x0a46 ShanTou vendor MEDIAGEAR 0x0a48 MediaGear +vendor PLOYTEC 0x0a4a Ploytec GmbH vendor BROADCOM 0x0a5c Broadcom vendor GREENHOUSE 0x0a6b GREENHOUSE vendor MEDELI 0x0a67 Medeli @@ -3690,6 +3691,9 @@ product PLANEX2 GWUSNANO 0xab28 GW-USNano /* Plextor Corp. */ product PLEXTOR 40_12_40U 0x0011 PlexWriter 40/12/40U + +/* Ploytec GmbH */ +product PLOYTEC SPL_CRIMSON_1 0xc150 SPL Crimson Revision 1 /* PLX products */ product PLX TESTBOARD 0x9060 test board From owner-svn-src-all@freebsd.org Thu Jan 3 09:27:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F8C2142225B; Thu, 3 Jan 2019 09:27:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0D1F6BE4E; Thu, 3 Jan 2019 09:27:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDC291F42E; Thu, 3 Jan 2019 09:27:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x039RZKx018813; Thu, 3 Jan 2019 09:27:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x039RZPL018812; Thu, 3 Jan 2019 09:27:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901030927.x039RZPL018812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Jan 2019 09:27: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: r342726 - in stable/11/sys/dev/usb: . quirk X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/usb: . quirk X-SVN-Commit-Revision: 342726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F0D1F6BE4E 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(-0.99)[-0.995,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)[-0.998,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, 03 Jan 2019 09:27:36 -0000 Author: hselasky Date: Thu Jan 3 09:27:35 2019 New Revision: 342726 URL: https://svnweb.freebsd.org/changeset/base/342726 Log: MFC r342549: Add USB quirk for SPL Crimson Rev 1. PR: 234380 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/11/sys/dev/usb/quirk/usb_quirk.c Thu Jan 3 09:26:45 2019 (r342725) +++ stable/11/sys/dev/usb/quirk/usb_quirk.c Thu Jan 3 09:27:35 2019 (r342726) @@ -525,6 +525,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(MAUDIO, FASTTRACKULTRA, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(MAUDIO, FASTTRACKULTRA8R, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(CMEDIA, CM6206, 0x0000, 0xffff, UQ_AU_SET_SPDIF_CM6206), + USB_QUIRK(PLOYTEC, SPL_CRIMSON_1, 0x0000, 0xffff, UQ_CFG_INDEX_1), /* * Quirks for manufacturers which USB devices does not respond Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Thu Jan 3 09:26:45 2019 (r342725) +++ stable/11/sys/dev/usb/usbdevs Thu Jan 3 09:27:35 2019 (r342726) @@ -489,6 +489,7 @@ vendor ASAHIOPTICAL 0x0a17 Asahi Optical vendor BOCASYSTEMS 0x0a43 Boca Systems vendor SHANTOU 0x0a46 ShanTou vendor MEDIAGEAR 0x0a48 MediaGear +vendor PLOYTEC 0x0a4a Ploytec GmbH vendor BROADCOM 0x0a5c Broadcom vendor GREENHOUSE 0x0a6b GREENHOUSE vendor MEDELI 0x0a67 Medeli @@ -3584,6 +3585,9 @@ product PLANEX2 GWUSNANO 0xab28 GW-USNano /* Plextor Corp. */ product PLEXTOR 40_12_40U 0x0011 PlexWriter 40/12/40U + +/* Ploytec GmbH */ +product PLOYTEC SPL_CRIMSON_1 0xc150 SPL Crimson Revision 1 /* PLX products */ product PLX TESTBOARD 0x9060 test board From owner-svn-src-all@freebsd.org Thu Jan 3 09:28:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1EBF1422330; Thu, 3 Jan 2019 09:28:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73B676BFBD; Thu, 3 Jan 2019 09:28:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 627D91F430; Thu, 3 Jan 2019 09:28:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x039SJmi018918; Thu, 3 Jan 2019 09:28:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x039SJQp018914; Thu, 3 Jan 2019 09:28:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901030928.x039SJQp018914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Jan 2019 09:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342727 - in stable/10/sys/dev/usb: . quirk X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/usb: . quirk X-SVN-Commit-Revision: 342727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73B676BFBD 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(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Jan 2019 09:28:20 -0000 Author: hselasky Date: Thu Jan 3 09:28:18 2019 New Revision: 342727 URL: https://svnweb.freebsd.org/changeset/base/342727 Log: MFC r342549: Add USB quirk for SPL Crimson Rev 1. PR: 234380 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/10/sys/dev/usb/quirk/usb_quirk.c Thu Jan 3 09:27:35 2019 (r342726) +++ stable/10/sys/dev/usb/quirk/usb_quirk.c Thu Jan 3 09:28:18 2019 (r342727) @@ -522,6 +522,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(MAUDIO, FASTTRACKULTRA, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(MAUDIO, FASTTRACKULTRA8R, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(CMEDIA, CM6206, 0x0000, 0xffff, UQ_AU_SET_SPDIF_CM6206), + USB_QUIRK(PLOYTEC, SPL_CRIMSON_1, 0x0000, 0xffff, UQ_CFG_INDEX_1), /* * Quirks for manufacturers which USB devices does not respond Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Thu Jan 3 09:27:35 2019 (r342726) +++ stable/10/sys/dev/usb/usbdevs Thu Jan 3 09:28:18 2019 (r342727) @@ -488,6 +488,7 @@ vendor ASAHIOPTICAL 0x0a17 Asahi Optical vendor BOCASYSTEMS 0x0a43 Boca Systems vendor SHANTOU 0x0a46 ShanTou vendor MEDIAGEAR 0x0a48 MediaGear +vendor PLOYTEC 0x0a4a Ploytec GmbH vendor BROADCOM 0x0a5c Broadcom vendor GREENHOUSE 0x0a6b GREENHOUSE vendor MEDELI 0x0a67 Medeli @@ -3573,6 +3574,9 @@ product PLANEX2 GWUSNANO 0xab28 GW-USNano /* Plextor Corp. */ product PLEXTOR 40_12_40U 0x0011 PlexWriter 40/12/40U + +/* Ploytec GmbH */ +product PLOYTEC SPL_CRIMSON_1 0xc150 SPL Crimson Revision 1 /* PLX products */ product PLX TESTBOARD 0x9060 test board From owner-svn-src-all@freebsd.org Thu Jan 3 09:29:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA7E91422476; Thu, 3 Jan 2019 09:29:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BFD96C1AA; Thu, 3 Jan 2019 09:29:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F9E21F433; Thu, 3 Jan 2019 09:29:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x039TcRS019043; Thu, 3 Jan 2019 09:29:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x039Tchw019042; Thu, 3 Jan 2019 09:29:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901030929.x039Tchw019042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Jan 2019 09:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r342728 - stable/9/sys/dev/sound/usb X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/dev/sound/usb X-SVN-Commit-Revision: 342728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5BFD96C1AA 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.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Jan 2019 09:29:39 -0000 Author: hselasky Date: Thu Jan 3 09:29:37 2019 New Revision: 342728 URL: https://svnweb.freebsd.org/changeset/base/342728 Log: MFC r342456: Fix reading of USB sample rate descriptor for SPL Crimson Rev 1. Read first one entry, then try to read the full rate descriptor table. PR: 234380 Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/sound/usb/uaudio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Thu Jan 3 09:28:18 2019 (r342727) +++ stable/9/sys/dev/sound/usb/uaudio.c Thu Jan 3 09:29:37 2019 (r342728) @@ -1493,7 +1493,8 @@ uaudio20_check_rate(struct usb_device *udev, uint8_t i { struct usb_device_request req; usb_error_t error; - uint8_t data[255]; +#define UAUDIO20_MAX_RATES 32 /* we support at maxium 32 rates */ + uint8_t data[2 + UAUDIO20_MAX_RATES * 12]; uint16_t actlen; uint16_t rates; uint16_t x; @@ -1505,19 +1506,57 @@ uaudio20_check_rate(struct usb_device *udev, uint8_t i req.bRequest = UA20_CS_RANGE; USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); USETW2(req.wIndex, clockid, iface_no); - USETW(req.wLength, 255); + /* + * Assume there is at least one rate to begin with, else some + * devices might refuse to return the USB descriptor: + */ + USETW(req.wLength, (2 + 1 * 12)); - error = usbd_do_request_flags(udev, NULL, &req, data, + error = usbd_do_request_flags(udev, NULL, &req, data, USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); - if (error != 0 || actlen < 2) - return (USB_ERR_INVAL); + if (error != 0 || actlen < 2) { + /* + * Likely the descriptor doesn't fit into the supplied + * buffer. Try using a larger buffer and see if that + * helps: + */ + rates = MIN(UAUDIO20_MAX_RATES, (255 - 2) / 12); + error = USB_ERR_INVAL; + } else { + rates = UGETW(data); - rates = data[0] | (data[1] << 8); + if (rates > UAUDIO20_MAX_RATES) { + DPRINTF("Too many rates truncating to %d\n", UAUDIO20_MAX_RATES); + rates = UAUDIO20_MAX_RATES; + error = USB_ERR_INVAL; + } else if (rates > 1) { + DPRINTF("Need to read full rate descriptor\n"); + error = USB_ERR_INVAL; + } + } + + if (error != 0) { + /* + * Try to read full rate descriptor. + */ + actlen = (2 + rates * 12); + + USETW(req.wLength, actlen); + + error = usbd_do_request_flags(udev, NULL, &req, data, + USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); + + if (error != 0 || actlen < 2) + return (USB_ERR_INVAL); + + rates = UGETW(data); + } + actlen = (actlen - 2) / 12; if (rates > actlen) { - DPRINTF("Too many rates\n"); + DPRINTF("Too many rates truncating to %d\n", actlen); rates = actlen; } From owner-svn-src-all@freebsd.org Thu Jan 3 09:30:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2988A142251A; Thu, 3 Jan 2019 09:30:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C45CB6C330; Thu, 3 Jan 2019 09:30:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6E431F438; Thu, 3 Jan 2019 09:30:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x039UA0Y019170; Thu, 3 Jan 2019 09:30:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x039UAn0019169; Thu, 3 Jan 2019 09:30:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901030930.x039UAn0019169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Jan 2019 09:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r342729 - in stable/9/sys/dev/usb: . quirk X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/9/sys/dev/usb: . quirk X-SVN-Commit-Revision: 342729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C45CB6C330 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(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Jan 2019 09:30:11 -0000 Author: hselasky Date: Thu Jan 3 09:30:10 2019 New Revision: 342729 URL: https://svnweb.freebsd.org/changeset/base/342729 Log: MFC r342549: Add USB quirk for SPL Crimson Rev 1. PR: 234380 Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Thu Jan 3 09:29:37 2019 (r342728) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Thu Jan 3 09:30:10 2019 (r342729) @@ -519,6 +519,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(MAUDIO, FASTTRACKULTRA, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(MAUDIO, FASTTRACKULTRA8R, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(CMEDIA, CM6206, 0x0000, 0xffff, UQ_AU_SET_SPDIF_CM6206), + USB_QUIRK(PLOYTEC, SPL_CRIMSON_1, 0x0000, 0xffff, UQ_CFG_INDEX_1), /* * Quirks for manufacturers which USB devices does not respond Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Thu Jan 3 09:29:37 2019 (r342728) +++ stable/9/sys/dev/usb/usbdevs Thu Jan 3 09:30:10 2019 (r342729) @@ -488,6 +488,7 @@ vendor ASAHIOPTICAL 0x0a17 Asahi Optical vendor BOCASYSTEMS 0x0a43 Boca Systems vendor SHANTOU 0x0a46 ShanTou vendor MEDIAGEAR 0x0a48 MediaGear +vendor PLOYTEC 0x0a4a Ploytec GmbH vendor BROADCOM 0x0a5c Broadcom vendor GREENHOUSE 0x0a6b GREENHOUSE vendor MEDELI 0x0a67 Medeli @@ -3565,6 +3566,9 @@ product PLANEX2 GWUSNANO 0xab28 GW-USNano /* Plextor Corp. */ product PLEXTOR 40_12_40U 0x0011 PlexWriter 40/12/40U + +/* Ploytec GmbH */ +product PLOYTEC SPL_CRIMSON_1 0xc150 SPL Crimson Revision 1 /* PLX products */ product PLX TESTBOARD 0x9060 test board From owner-svn-src-all@freebsd.org Thu Jan 3 14:27:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A9D142C6F9; Thu, 3 Jan 2019 14:27:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CC1D77661; Thu, 3 Jan 2019 14:27:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71296226C9; Thu, 3 Jan 2019 14:27:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03ERpMg079678; Thu, 3 Jan 2019 14:27:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03ERp2S079677; Thu, 3 Jan 2019 14:27:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901031427.x03ERp2S079677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Jan 2019 14:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342730 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 342730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CC1D77661 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.995,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 14:27:52 -0000 Author: hselasky Date: Thu Jan 3 14:27:51 2019 New Revision: 342730 URL: https://svnweb.freebsd.org/changeset/base/342730 Log: Improve USB generic debug messages. Print process ID and name when opening and closing usb/ugenX.Y character device nodes. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_generic.c Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Thu Jan 3 09:30:10 2019 (r342729) +++ head/sys/dev/usb/usb_generic.c Thu Jan 3 14:27:51 2019 (r342730) @@ -183,7 +183,8 @@ ugen_open(struct usb_fifo *f, int fflags) struct usb_endpoint_descriptor *ed = ep->edesc; uint8_t type; - DPRINTFN(6, "flag=0x%x\n", fflags); + DPRINTFN(1, "flag=0x%x pid=%d name=%s\n", fflags, + curthread->td_proc->p_pid, curthread->td_proc->p_comm); mtx_lock(f->priv_mtx); switch (usbd_get_speed(f->udev)) { @@ -213,7 +214,9 @@ ugen_open(struct usb_fifo *f, int fflags) static void ugen_close(struct usb_fifo *f, int fflags) { - DPRINTFN(6, "flag=0x%x\n", fflags); + + DPRINTFN(1, "flag=0x%x pid=%d name=%s\n", fflags, + curthread->td_proc->p_pid, curthread->td_proc->p_comm); /* cleanup */ From owner-svn-src-all@freebsd.org Thu Jan 3 16:11:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DDA8142EA2C; Thu, 3 Jan 2019 16:11:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7E3482E50; Thu, 3 Jan 2019 16:11:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD5FA237D9; Thu, 3 Jan 2019 16:11:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03GBLeQ034328; Thu, 3 Jan 2019 16:11:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03GBLeD034327; Thu, 3 Jan 2019 16:11:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901031611.x03GBLeD034327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Jan 2019 16:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342731 - head/sys/riscv/conf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/conf X-SVN-Commit-Revision: 342731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C7E3482E50 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.995,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 16:11:22 -0000 Author: markj Date: Thu Jan 3 16:11:21 2019 New Revision: 342731 URL: https://svnweb.freebsd.org/changeset/base/342731 Log: Configure hz=100 in the QEMU target. We currently don't have a good way to dynamically detect whether the kernel is running as a guest. Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18715 Modified: head/sys/riscv/conf/QEMU Modified: head/sys/riscv/conf/QEMU ============================================================================== --- head/sys/riscv/conf/QEMU Thu Jan 3 14:27:51 2019 (r342730) +++ head/sys/riscv/conf/QEMU Thu Jan 3 16:11:21 2019 (r342731) @@ -6,4 +6,5 @@ include "GENERIC" ident QEMU +options HZ=100 options ROOTDEVNAME=\"ufs:/dev/vtbd0\" From owner-svn-src-all@freebsd.org Thu Jan 3 16:15:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 798FE142EAE4; Thu, 3 Jan 2019 16:15:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EAF383206; Thu, 3 Jan 2019 16:15:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0331A23940; Thu, 3 Jan 2019 16:15:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03GFSkf037923; Thu, 3 Jan 2019 16:15:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03GFSBT037922; Thu, 3 Jan 2019 16:15:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901031615.x03GFSBT037922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Jan 2019 16:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342732 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1EAF383206 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.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Jan 2019 16:15:29 -0000 Author: markj Date: Thu Jan 3 16:15:28 2019 New Revision: 342732 URL: https://svnweb.freebsd.org/changeset/base/342732 Log: Use regular stores to update PTEs in the riscv pmap layer. There's no need to use atomics when the previous value isn't needed. No functional change intended. Reviewed by: kib Discussed with: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18717 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Jan 3 16:11:21 2019 (r342731) +++ head/sys/riscv/riscv/pmap.c Thu Jan 3 16:15:28 2019 (r342732) @@ -257,15 +257,13 @@ static void _pmap_unwire_l3(pmap_t pmap, vm_offset_t v struct spglist *free); static int pmap_unuse_l3(pmap_t, vm_offset_t, pd_entry_t, struct spglist *); -/* - * These load the old table data and store the new value. - * They need to be atomic as the System MMU may write to the table at - * the same time as the CPU. - */ -#define pmap_load_store(table, entry) atomic_swap_64(table, entry) -#define pmap_set(table, mask) atomic_set_64(table, mask) -#define pmap_load_clear(table) atomic_swap_64(table, 0) -#define pmap_load(table) (*table) +#define pmap_clear(pte) pmap_store(pte, 0) +#define pmap_clear_bits(pte, bits) atomic_clear_64(pte, bits) +#define pmap_load_store(pte, entry) atomic_swap_64(pte, entry) +#define pmap_load_clear(pte) pmap_load_store(pte, 0) +#define pmap_load(pte) atomic_load_64(pte) +#define pmap_store(pte, entry) atomic_store_64(pte, entry) +#define pmap_store_bits(pte, bits) atomic_set_64(pte, bits) /********************/ /* Inline functions */ @@ -384,10 +382,7 @@ pmap_distribute_l1(struct pmap *pmap, vm_pindex_t l1in LIST_FOREACH(user_pmap, &allpmaps, pm_list) { l1 = &user_pmap->pm_l1[l1index]; - if (entry) - pmap_load_store(l1, entry); - else - pmap_load_clear(l1); + pmap_store(l1, entry); } } @@ -455,7 +450,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi pn = (pa / PAGE_SIZE); entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); - pmap_load_store(&l1[l1_slot], entry); + pmap_store(&l1[l1_slot], entry); } /* Set the upper limit of the DMAP region */ @@ -489,7 +484,7 @@ pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm pn = (pa / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(&l2[l2_slot], entry); + pmap_store(&l2[l2_slot], entry); l3pt += PAGE_SIZE; } @@ -875,7 +870,7 @@ pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm pn = (pa / PAGE_SIZE); entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); - pmap_load_store(l3, entry); + pmap_store(l3, entry); va += PAGE_SIZE; pa += PAGE_SIZE; @@ -896,8 +891,7 @@ pmap_kremove(vm_offset_t va) l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("pmap_kremove: Invalid address")); - pmap_load_clear(l3); - + pmap_clear(l3); sfence_vma(); } @@ -916,7 +910,7 @@ pmap_kremove_device(vm_offset_t sva, vm_size_t size) while (size != 0) { l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("Invalid page table, va: 0x%lx", va)); - pmap_load_clear(l3); + pmap_clear(l3); va += PAGE_SIZE; size -= PAGE_SIZE; @@ -973,7 +967,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); - pmap_load_store(l3, entry); + pmap_store(l3, entry); va += L3_SIZE; } @@ -993,14 +987,10 @@ pmap_qremove(vm_offset_t sva, int count) KASSERT(sva >= VM_MIN_KERNEL_ADDRESS, ("usermode va %lx", sva)); - va = sva; - while (count-- > 0) { + for (va = sva; count-- > 0; va += PAGE_SIZE) { l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("pmap_kremove: Invalid address")); - - pmap_load_clear(l3); - - va += PAGE_SIZE; + pmap_clear(l3); } pmap_invalidate_range(kernel_pmap, sva, va); } @@ -1057,13 +1047,13 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t /* PD page */ pd_entry_t *l1; l1 = pmap_l1(pmap, va); - pmap_load_clear(l1); + pmap_clear(l1); pmap_distribute_l1(pmap, pmap_l1_index(va), 0); } else { /* PTE page */ pd_entry_t *l2; l2 = pmap_l2(pmap, va); - pmap_load_clear(l2); + pmap_clear(l2); } pmap_resident_count_dec(pmap, 1); if (m->pindex < NUPDE) { @@ -1207,7 +1197,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str pn = (VM_PAGE_TO_PHYS(m) / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(l1, entry); + pmap_store(l1, entry); pmap_distribute_l1(pmap, l1index, entry); } else { vm_pindex_t l1index; @@ -1236,7 +1226,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str pn = (VM_PAGE_TO_PHYS(m) / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(l2, entry); + pmap_store(l2, entry); } pmap_resident_count_inc(pmap, 1); @@ -1367,7 +1357,7 @@ pmap_growkernel(vm_offset_t addr) pn = (paddr / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(l1, entry); + pmap_store(l1, entry); pmap_distribute_l1(kernel_pmap, pmap_l1_index(kernel_vm_end), entry); continue; /* try again */ @@ -1396,7 +1386,7 @@ pmap_growkernel(vm_offset_t addr) pn = (paddr / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(l2, entry); + pmap_store(l2, entry); pmap_invalidate_page(kernel_pmap, kernel_vm_end); @@ -1908,7 +1898,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t if ((l3 & PTE_V) != 0) { entry = pmap_load(l3p); entry &= ~PTE_W; - pmap_load_store(l3p, entry); + pmap_store(l3p, entry); /* XXX: Use pmap_invalidate_range */ pmap_invalidate_page(pmap, sva); } @@ -1945,7 +1935,7 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_ new_l3 |= PTE_D; if (orig_l3 != new_l3) { - pmap_load_store(l3, new_l3); + pmap_store(l3, new_l3); pmap_invalidate_page(pmap, va); rv = 1; goto done; @@ -2062,7 +2052,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v l1 = pmap_l1(pmap, va); entry = (PTE_V); entry |= (l2_pn << PTE_PPN0_S); - pmap_load_store(l1, entry); + pmap_store(l1, entry); pmap_distribute_l1(pmap, pmap_l1_index(va), entry); l2 = pmap_l1_to_l2(l1, va); } @@ -2081,7 +2071,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v l3_pn = (l3_pa / PAGE_SIZE); entry = (PTE_V); entry |= (l3_pn << PTE_PPN0_S); - pmap_load_store(l2, entry); + pmap_store(l2, entry); l3 = pmap_l2_to_l3(l2, va); } pmap_invalidate_page(pmap, va); @@ -2209,7 +2199,7 @@ validate: (PTE_D | PTE_SW_MANAGED)) vm_page_dirty(m); } else { - pmap_load_store(l3, new_l3); + pmap_store(l3, new_l3); } if (lock != NULL) @@ -2290,10 +2280,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v struct spglist free; vm_paddr_t phys; pd_entry_t *l2; - pt_entry_t *l3; - vm_paddr_t pa; - pt_entry_t entry; - pn_t pn; + pt_entry_t *l3, newl3; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || (m->oflags & VPO_UNMANAGED) != 0, @@ -2399,7 +2386,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v if (prot & VM_PROT_EXECUTE) pmap_sync_icache(pmap, va, PAGE_SIZE); - pmap_load_store(l3, entry); + pmap_store(l3, entry); pmap_invalidate_page(pmap, va); return (mpte); @@ -2742,7 +2729,7 @@ pmap_remove_pages(pmap_t pmap) ("pmap_remove_pages: bad l3 %#jx", (uintmax_t)tl3)); - pmap_load_clear(l3); + pmap_clear(l3); /* * Update the vm_page_t clean/reference bits. From owner-svn-src-all@freebsd.org Thu Jan 3 16:19:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD74B142F0B4; Thu, 3 Jan 2019 16:19:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE90835FC; Thu, 3 Jan 2019 16:19:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CB1823949; Thu, 3 Jan 2019 16:19:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03GJXRf038152; Thu, 3 Jan 2019 16:19:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03GJXB4038151; Thu, 3 Jan 2019 16:19:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901031619.x03GJXB4038151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Jan 2019 16:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342733 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7EE90835FC 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.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 16:19:34 -0000 Author: markj Date: Thu Jan 3 16:19:32 2019 New Revision: 342733 URL: https://svnweb.freebsd.org/changeset/base/342733 Log: Set PTE_U on PTEs created by pmap_enter_quick(). Otherwise prefaulted entries are not accessible from user mode and end up triggering a fault upon access, so prefaulting has no effect. Reviewed by: jhb, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18718 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Jan 3 16:15:28 2019 (r342732) +++ head/sys/riscv/riscv/pmap.c Thu Jan 3 16:19:32 2019 (r342733) @@ -2365,19 +2365,14 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ pmap_resident_count_inc(pmap, 1); - pa = VM_PAGE_TO_PHYS(m); - pn = (pa / PAGE_SIZE); - - entry = PTE_V | PTE_R; - if (prot & VM_PROT_EXECUTE) - entry |= PTE_X; - entry |= (pn << PTE_PPN0_S); - - /* - * Now validate mapping with RO protection - */ + newl3 = ((VM_PAGE_TO_PHYS(m) / PAGE_SIZE) << PTE_PPN0_S) | + PTE_V | PTE_R; + if ((prot & VM_PROT_EXECUTE) != 0) + newl3 |= PTE_X; if ((m->oflags & VPO_UNMANAGED) == 0) - entry |= PTE_SW_MANAGED; + newl3 |= PTE_SW_MANAGED; + if (va < VM_MAX_USER_ADDRESS) + newl3 |= PTE_U; /* * Sync the i-cache on all harts before updating the PTE @@ -2386,7 +2381,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v if (prot & VM_PROT_EXECUTE) pmap_sync_icache(pmap, va, PAGE_SIZE); - pmap_store(l3, entry); + pmap_store(l3, newl3); pmap_invalidate_page(pmap, va); return (mpte); From owner-svn-src-all@freebsd.org Thu Jan 3 16:21:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2C92142F2DF; Thu, 3 Jan 2019 16:21: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 468D4839AC; Thu, 3 Jan 2019 16:21: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 2321D23ACA; Thu, 3 Jan 2019 16:21: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 x03GLjbo042238; Thu, 3 Jan 2019 16:21:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03GLjE4042237; Thu, 3 Jan 2019 16:21:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901031621.x03GLjE4042237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Jan 2019 16:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342734 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 468D4839AC 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.996,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)[-0.998,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, 03 Jan 2019 16:21:45 -0000 Author: markj Date: Thu Jan 3 16:21:44 2019 New Revision: 342734 URL: https://svnweb.freebsd.org/changeset/base/342734 Log: Fix some issues with the riscv pmap_protect() implementation. - Handle VM_PROT_EXECUTE. - Clear PTE_D and mark the page dirty when removing write access from a mapping. - Atomically clear PTE_W to avoid clobbering a hardware PTE update. Reviewed by: jhb, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18719 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Jan 3 16:19:32 2019 (r342733) +++ head/sys/riscv/riscv/pmap.c Thu Jan 3 16:21:44 2019 (r342734) @@ -1853,22 +1853,28 @@ pmap_remove_all(vm_page_t m) void pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { - vm_offset_t va_next; pd_entry_t *l1, *l2; - pt_entry_t *l3p, l3; - pt_entry_t entry; + pt_entry_t *l3, l3e, mask; + vm_page_t m; + vm_offset_t va_next; if ((prot & VM_PROT_READ) == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); return; } - if ((prot & VM_PROT_WRITE) == VM_PROT_WRITE) + if ((prot & (VM_PROT_WRITE | VM_PROT_EXECUTE)) == + (VM_PROT_WRITE | VM_PROT_EXECUTE)) return; + mask = 0; + if ((prot & VM_PROT_WRITE) == 0) + mask |= PTE_W | PTE_D; + if ((prot & VM_PROT_EXECUTE) == 0) + mask |= PTE_X; + PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { - l1 = pmap_l1(pmap, sva); if (pmap_load(l1) == 0) { va_next = (sva + L1_SIZE) & ~L1_OFFSET; @@ -1882,26 +1888,30 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t va_next = eva; l2 = pmap_l1_to_l2(l1, sva); - if (l2 == NULL) + if (l2 == NULL || pmap_load(l2) == 0) continue; - if (pmap_load(l2) == 0) - continue; if ((pmap_load(l2) & PTE_RX) != 0) continue; if (va_next > eva) va_next = eva; - for (l3p = pmap_l2_to_l3(l2, sva); sva != va_next; l3p++, + for (l3 = pmap_l2_to_l3(l2, sva); sva != va_next; l3++, sva += L3_SIZE) { - l3 = pmap_load(l3p); - if ((l3 & PTE_V) != 0) { - entry = pmap_load(l3p); - entry &= ~PTE_W; - pmap_store(l3p, entry); - /* XXX: Use pmap_invalidate_range */ - pmap_invalidate_page(pmap, sva); + l3e = pmap_load(l3); +retry: + if ((l3e & PTE_V) == 0) + continue; + if ((prot & VM_PROT_WRITE) == 0 && + (l3e & (PTE_SW_MANAGED | PTE_D)) == + (PTE_SW_MANAGED | PTE_D)) { + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(l3e)); + vm_page_dirty(m); } + if (!atomic_fcmpset_long(l3, &l3e, l3e & ~mask)) + goto retry; + /* XXX: Use pmap_invalidate_range */ + pmap_invalidate_page(pmap, sva); } } PMAP_UNLOCK(pmap); From owner-svn-src-all@freebsd.org Thu Jan 3 16:24:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5EAA142F454; Thu, 3 Jan 2019 16:24:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BE5B83C91; Thu, 3 Jan 2019 16:24:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 513C123B10; Thu, 3 Jan 2019 16:24:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03GO4pp043230; Thu, 3 Jan 2019 16:24:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03GO4wj043229; Thu, 3 Jan 2019 16:24:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901031624.x03GO4wj043229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Jan 2019 16:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342735 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5BE5B83C91 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.995,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Jan 2019 16:24:04 -0000 Author: markj Date: Thu Jan 3 16:24:03 2019 New Revision: 342735 URL: https://svnweb.freebsd.org/changeset/base/342735 Log: Synchronize access to the allpmaps list. The list will be removed with some future work. Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18721 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Jan 3 16:21:44 2019 (r342734) +++ head/sys/riscv/riscv/pmap.c Thu Jan 3 16:24:03 2019 (r342735) @@ -228,6 +228,7 @@ CTASSERT((DMAP_MIN_ADDRESS & ~L1_OFFSET) == DMAP_MIN_ CTASSERT((DMAP_MAX_ADDRESS & ~L1_OFFSET) == DMAP_MAX_ADDRESS); static struct rwlock_padalign pvh_global_lock; +static struct mtx_padalign allpmaps_lock; /* * Data for the pv entry allocation mechanism @@ -380,10 +381,12 @@ pmap_distribute_l1(struct pmap *pmap, vm_pindex_t l1in if (pmap != kernel_pmap) return; + mtx_lock(&allpmaps_lock); LIST_FOREACH(user_pmap, &allpmaps, pm_list) { l1 = &user_pmap->pm_l1[l1index]; pmap_store(l1, entry); } + mtx_unlock(&allpmaps_lock); } static pt_entry_t * @@ -636,9 +639,10 @@ pmap_init(void) int i; /* - * Initialize the pv chunk list mutex. + * Initialize the pv chunk and pmap list mutexes. */ mtx_init(&pv_chunks_mutex, "pmap pv chunk list", NULL, MTX_DEF); + mtx_init(&allpmaps_lock, "allpmaps", NULL, MTX_DEF); /* * Initialize the pool of pv list locks. @@ -1132,7 +1136,9 @@ pmap_pinit(pmap_t pmap) memcpy(pmap->pm_l1, kernel_pmap->pm_l1, PAGE_SIZE); /* Add to the list of all user pmaps */ + mtx_lock(&allpmaps_lock); LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); + mtx_unlock(&allpmaps_lock); return (1); } @@ -1296,7 +1302,9 @@ pmap_release(pmap_t pmap) vm_page_free_zero(m); /* Remove pmap from the allpmaps list */ + mtx_lock(&allpmaps_lock); LIST_REMOVE(pmap, pm_list); + mtx_unlock(&allpmaps_lock); /* Remove kernel pagetables */ bzero(pmap->pm_l1, PAGE_SIZE); From owner-svn-src-all@freebsd.org Thu Jan 3 16:26:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8570F142F5C7; Thu, 3 Jan 2019 16:26: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 2A34583EF8; Thu, 3 Jan 2019 16:26: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 181C923B2E; Thu, 3 Jan 2019 16:26: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 x03GQqGD043416; Thu, 3 Jan 2019 16:26:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03GQqiw043415; Thu, 3 Jan 2019 16:26:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901031626.x03GQqiw043415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Jan 2019 16:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342736 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A34583EF8 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.995,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Jan 2019 16:26:53 -0000 Author: markj Date: Thu Jan 3 16:26:52 2019 New Revision: 342736 URL: https://svnweb.freebsd.org/changeset/base/342736 Log: Fix a use-after-free in the riscv pmap_release() implementation. Don't bother zeroing the top-level page before freeing it. Previously, the page was freed before being zeroed. Reviewed by: jhb, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18720 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Jan 3 16:24:03 2019 (r342735) +++ head/sys/riscv/riscv/pmap.c Thu Jan 3 16:26:52 2019 (r342736) @@ -1297,17 +1297,13 @@ pmap_release(pmap_t pmap) ("pmap_release: pmap resident count %ld != 0", pmap->pm_stats.resident_count)); - m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l1)); - vm_page_unwire_noq(m); - vm_page_free_zero(m); - - /* Remove pmap from the allpmaps list */ mtx_lock(&allpmaps_lock); LIST_REMOVE(pmap, pm_list); mtx_unlock(&allpmaps_lock); - /* Remove kernel pagetables */ - bzero(pmap->pm_l1, PAGE_SIZE); + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l1)); + vm_page_unwire_noq(m); + vm_page_free(m); } #if 0 From owner-svn-src-all@freebsd.org Thu Jan 3 16:47:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C384142FE52; Thu, 3 Jan 2019 16:47:06 +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 1DDA984AF4; Thu, 3 Jan 2019 16:47:06 +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 1219B23E99; Thu, 3 Jan 2019 16:47:06 +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 x03Gl5St053520; Thu, 3 Jan 2019 16:47:05 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03Gl5Ja053519; Thu, 3 Jan 2019 16:47:05 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201901031647.x03Gl5Ja053519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 3 Jan 2019 16:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342737 - head/tests/sys/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tests/sys/netmap X-SVN-Commit-Revision: 342737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DDA984AF4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 16:47:06 -0000 Author: vmaffione Date: Thu Jan 3 16:47:05 2019 New Revision: 342737 URL: https://svnweb.freebsd.org/changeset/base/342737 Log: netmap: unit tests: fix issues found by coverity scan Reported by: asomers MFC after: 1 week Sponsored by: Sunny Valley Networks Modified: head/tests/sys/netmap/ctrl-api-test.c Modified: head/tests/sys/netmap/ctrl-api-test.c ============================================================================== --- head/tests/sys/netmap/ctrl-api-test.c Thu Jan 3 16:26:52 2019 (r342736) +++ head/tests/sys/netmap/ctrl-api-test.c Thu Jan 3 16:47:05 2019 (r342737) @@ -83,16 +83,19 @@ exec_command(int argc, const char *const argv[]) child_pid = fork(); if (child_pid == 0) { char **av; + int fds[3]; /* Child process. Redirect stdin, stdout * and stderr. */ - close(0); - close(1); - close(2); - if (open("/dev/null", O_RDONLY) < 0 || - open("/dev/null", O_RDONLY) < 0 || - open("/dev/null", O_RDONLY) < 0) { - return -1; + for (i = 0; i < 3; i++) { + close(i); + fds[i] = open("/dev/null", O_RDONLY); + if (fds[i] < 0) { + for (i--; i >= 0; i--) { + close(fds[i]); + } + return -1; + } } /* Make a copy of the arguments, passing them to execvp. */ @@ -128,7 +131,8 @@ exec_command(int argc, const char *const argv[]) #define THRET_FAILURE ((void *)0) struct TestContext { - char ifname[128]; + char ifname[64]; + char ifname_ext[128]; char bdgname[64]; uint32_t nr_tx_slots; /* slots in tx rings */ uint32_t nr_rx_slots; /* slots in rx rings */ @@ -171,9 +175,9 @@ port_info_get(struct TestContext *ctx) int success; int ret; - printf("Testing NETMAP_REQ_PORT_INFO_GET on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_PORT_INFO_GET on '%s'\n", ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_PORT_INFO_GET; hdr.nr_body = (uintptr_t)&req; memset(&req, 0, sizeof(req)); @@ -218,9 +222,9 @@ port_register(struct TestContext *ctx) printf("Testing NETMAP_REQ_REGISTER(mode=%d,ringid=%d," "flags=0x%llx) on '%s'\n", ctx->nr_mode, ctx->nr_ringid, (unsigned long long)ctx->nr_flags, - ctx->ifname); + ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_REGISTER; hdr.nr_body = (uintptr_t)&req; hdr.nr_options = (uintptr_t)ctx->nr_opt; @@ -284,10 +288,10 @@ niocregif(struct TestContext *ctx, int netmap_api) int success; int ret; - printf("Testing legacy NIOCREGIF on '%s'\n", ctx->ifname); + printf("Testing legacy NIOCREGIF on '%s'\n", ctx->ifname_ext); memset(&req, 0, sizeof(req)); - memcpy(req.nr_name, ctx->ifname, sizeof(req.nr_name)); + memcpy(req.nr_name, ctx->ifname_ext, sizeof(req.nr_name)); req.nr_name[sizeof(req.nr_name) - 1] = '\0'; req.nr_version = netmap_api; req.nr_ringid = ctx->nr_ringid; @@ -399,7 +403,7 @@ legacy_regif_extra_bufs(struct TestContext *ctx) static int legacy_regif_extra_bufs_pipe(struct TestContext *ctx) { - strncat(ctx->ifname, "{pipeexbuf", sizeof(ctx->ifname)); + strncat(ctx->ifname_ext, "{pipeexbuf", sizeof(ctx->ifname_ext)); ctx->nr_mode = NR_REG_ALL_NIC; ctx->nr_extra_bufs = 58; /* arbitrary number of extra bufs */ @@ -409,7 +413,7 @@ legacy_regif_extra_bufs_pipe(struct TestContext *ctx) static int legacy_regif_extra_bufs_pipe_vale(struct TestContext *ctx) { - strncpy(ctx->ifname, "valeX1:Y4", sizeof(ctx->ifname)); + strncpy(ctx->ifname_ext, "valeX1:Y4", sizeof(ctx->ifname_ext)); return legacy_regif_extra_bufs_pipe(ctx); } @@ -478,10 +482,10 @@ vale_attach(struct TestContext *ctx) { struct nmreq_vale_attach req; struct nmreq_header hdr; - char vpname[sizeof(ctx->bdgname) + 1 + sizeof(ctx->ifname)]; + char vpname[sizeof(ctx->bdgname) + 1 + sizeof(ctx->ifname_ext)]; int ret; - snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname_ext); printf("Testing NETMAP_REQ_VALE_ATTACH on '%s'\n", vpname); nmreq_hdr_init(&hdr, vpname); @@ -516,7 +520,7 @@ vale_detach(struct TestContext *ctx) char vpname[256]; int ret; - snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname_ext); printf("Testing NETMAP_REQ_VALE_DETACH on '%s'\n", vpname); nmreq_hdr_init(&hdr, vpname); @@ -560,9 +564,9 @@ port_hdr_set_and_get(struct TestContext *ctx) struct nmreq_header hdr; int ret; - printf("Testing NETMAP_REQ_PORT_HDR_SET on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_PORT_HDR_SET on '%s'\n", ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_PORT_HDR_SET; hdr.nr_body = (uintptr_t)&req; memset(&req, 0, sizeof(req)); @@ -577,7 +581,7 @@ port_hdr_set_and_get(struct TestContext *ctx) return -1; } - printf("Testing NETMAP_REQ_PORT_HDR_GET on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_PORT_HDR_GET on '%s'\n", ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_PORT_HDR_GET; req.nr_hdr_len = 0; ret = ioctl(ctx->fd, NIOCCTRL, &hdr); @@ -603,7 +607,7 @@ vale_ephemeral_port_hdr_manipulation(struct TestContex { int ret; - strncpy(ctx->ifname, "vale:eph0", sizeof(ctx->ifname)); + strncpy(ctx->ifname_ext, "vale:eph0", sizeof(ctx->ifname_ext)); ctx->nr_mode = NR_REG_ALL_NIC; if ((ret = port_register(ctx))) { return ret; @@ -632,11 +636,11 @@ vale_persistent_port(struct TestContext *ctx) int result; int ret; - strncpy(ctx->ifname, "per4", sizeof(ctx->ifname)); + strncpy(ctx->ifname_ext, "per4", sizeof(ctx->ifname_ext)); - printf("Testing NETMAP_REQ_VALE_NEWIF on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_VALE_NEWIF on '%s'\n", ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_VALE_NEWIF; hdr.nr_body = (uintptr_t)&req; memset(&req, 0, sizeof(req)); @@ -654,7 +658,7 @@ vale_persistent_port(struct TestContext *ctx) /* Attach the persistent VALE port to a switch and then detach. */ result = vale_attach_detach(ctx); - printf("Testing NETMAP_REQ_VALE_DELIF on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_VALE_DELIF on '%s'\n", ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_VALE_DELIF; hdr.nr_body = (uintptr_t)NULL; ret = ioctl(ctx->fd, NIOCCTRL, &hdr); @@ -676,9 +680,9 @@ pools_info_get(struct TestContext *ctx) struct nmreq_header hdr; int ret; - printf("Testing NETMAP_REQ_POOLS_INFO_GET on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_POOLS_INFO_GET on '%s'\n", ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_POOLS_INFO_GET; hdr.nr_body = (uintptr_t)&req; memset(&req, 0, sizeof(req)); @@ -739,14 +743,14 @@ pools_info_get_and_register(struct TestContext *ctx) static int pools_info_get_empty_ifname(struct TestContext *ctx) { - strncpy(ctx->ifname, "", sizeof(ctx->ifname)); + strncpy(ctx->ifname_ext, "", sizeof(ctx->ifname_ext)); return pools_info_get(ctx) != 0 ? 0 : -1; } static int pipe_master(struct TestContext *ctx) { - strncat(ctx->ifname, "{pipeid1", sizeof(ctx->ifname)); + strncat(ctx->ifname_ext, "{pipeid1", sizeof(ctx->ifname_ext)); ctx->nr_mode = NR_REG_NIC_SW; if (port_register(ctx) == 0) { @@ -761,7 +765,7 @@ pipe_master(struct TestContext *ctx) static int pipe_slave(struct TestContext *ctx) { - strncat(ctx->ifname, "}pipeid2", sizeof(ctx->ifname)); + strncat(ctx->ifname_ext, "}pipeid2", sizeof(ctx->ifname_ext)); ctx->nr_mode = NR_REG_ALL_NIC; return port_register(ctx); @@ -772,7 +776,7 @@ pipe_slave(struct TestContext *ctx) static int pipe_port_info_get(struct TestContext *ctx) { - strncat(ctx->ifname, "}pipeid3", sizeof(ctx->ifname)); + strncat(ctx->ifname_ext, "}pipeid3", sizeof(ctx->ifname_ext)); return port_info_get(ctx); } @@ -780,7 +784,7 @@ pipe_port_info_get(struct TestContext *ctx) static int pipe_pools_info_get(struct TestContext *ctx) { - strncat(ctx->ifname, "{xid", sizeof(ctx->ifname)); + strncat(ctx->ifname_ext, "{xid", sizeof(ctx->ifname_ext)); return pools_info_get(ctx); } @@ -794,7 +798,7 @@ vale_polling_enable(struct TestContext *ctx) char vpname[256]; int ret; - snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname_ext); printf("Testing NETMAP_REQ_VALE_POLLING_ENABLE on '%s'\n", vpname); nmreq_hdr_init(&hdr, vpname); @@ -826,7 +830,7 @@ vale_polling_disable(struct TestContext *ctx) char vpname[256]; int ret; - snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname_ext); printf("Testing NETMAP_REQ_VALE_POLLING_DISABLE on '%s'\n", vpname); nmreq_hdr_init(&hdr, vpname); @@ -861,8 +865,9 @@ vale_polling_enable_disable(struct TestContext *ctx) * because it is currently broken. We are happy to see that * it fails. */ return 0; -#endif +#else return ret; +#endif } if ((ret = vale_polling_disable(ctx))) { @@ -913,7 +918,7 @@ unsupported_option(struct TestContext *ctx) { struct nmreq_option opt, save; - printf("Testing unsupported option on %s\n", ctx->ifname); + printf("Testing unsupported option on %s\n", ctx->ifname_ext); memset(&opt, 0, sizeof(opt)); opt.nro_reqtype = 1234; @@ -933,7 +938,7 @@ infinite_options(struct TestContext *ctx) { struct nmreq_option opt; - printf("Testing infinite list of options on %s\n", ctx->ifname); + printf("Testing infinite list of options on %s\n", ctx->ifname_ext); opt.nro_reqtype = 1234; push_option(&opt, ctx); @@ -1045,7 +1050,7 @@ _extmem_option(struct TestContext *ctx, save = e; - strncpy(ctx->ifname, "vale0:0", sizeof(ctx->ifname)); + strncpy(ctx->ifname_ext, "vale0:0", sizeof(ctx->ifname_ext)); ctx->nr_tx_slots = 16; ctx->nr_rx_slots = 16; @@ -1235,9 +1240,9 @@ sync_kloop_stop(struct TestContext *ctx) struct nmreq_header hdr; int ret; - printf("Testing NETMAP_REQ_SYNC_KLOOP_STOP on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_SYNC_KLOOP_STOP on '%s'\n", ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_SYNC_KLOOP_STOP; ret = ioctl(ctx->fd, NIOCCTRL, &hdr); if (ret != 0) { @@ -1255,9 +1260,9 @@ sync_kloop_worker(void *opaque) struct nmreq_header hdr; int ret; - printf("Testing NETMAP_REQ_SYNC_KLOOP_START on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_SYNC_KLOOP_START on '%s'\n", ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_SYNC_KLOOP_START; hdr.nr_body = (uintptr_t)&req; hdr.nr_options = (uintptr_t)ctx->nr_opt; @@ -1423,12 +1428,12 @@ csb_enable(struct TestContext *ctx) saveopt = opt.nro_opt; saveopt.nro_status = 0; - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_CSB_ENABLE; hdr.nr_options = (uintptr_t)ctx->nr_opt; hdr.nr_body = (uintptr_t)NULL; - printf("Testing NETMAP_REQ_CSB_ENABLE on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_CSB_ENABLE on '%s'\n", ctx->ifname_ext); ret = ioctl(ctx->fd, NIOCCTRL, &hdr); if (ret != 0) { @@ -1894,6 +1899,8 @@ main(int argc, char **argv) } memcpy(&ctxcopy, &ctx_, sizeof(ctxcopy)); ctxcopy.fd = fd; + memcpy(ctxcopy.ifname_ext, ctxcopy.ifname, + sizeof(ctxcopy.ifname)); ret = tests[i].test(&ctxcopy); if (ret != 0) { printf("Test #%d [%s] failed\n", i + 1, tests[i].name); From owner-svn-src-all@freebsd.org Thu Jan 3 18:30:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA4401432A16; Thu, 3 Jan 2019 18:30:37 +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 770DF88ADF; Thu, 3 Jan 2019 18:30:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68F2A2508D; Thu, 3 Jan 2019 18:30:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03IUbtq007886; Thu, 3 Jan 2019 18:30:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03IUa1L007882; Thu, 3 Jan 2019 18:30:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901031830.x03IUa1L007882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 3 Jan 2019 18:30: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: r342738 - in stable/12: lib/libbe sbin/bectl sbin/bectl/tests X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: lib/libbe sbin/bectl sbin/bectl/tests X-SVN-Commit-Revision: 342738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 770DF88ADF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 18:30:38 -0000 Author: kevans Date: Thu Jan 3 18:30:36 2019 New Revision: 342738 URL: https://svnweb.freebsd.org/changeset/base/342738 Log: MFC r340722-r340723, r342466: bectl(8)/libbe(3) fixes r340722 (0mp): libbe(3): Put each error value in separate line. As requested by a TODO in the source code. r340723 (0mp): Cross-reference libbe(3) and bectl(8). Those two manual pages are already referencing each other in the HISTORY sections, which people might skip. Mention those manual pages explicitly in the SEE ALSO sections. Also, remove a reference to be(1) from libbe(3). r342466: bectl: use jail id as the default jail name for a boot environment By default, bectl is setting the jail 'name' parameter to the boot environment name, which causes an error when the boot environment name is not a valid jail name. With the attached fix, when no name is supplied, the default jail name will be the jail id - this is is the same behavior as the jail command. Additionally, this commit addresses two other bugs that prevented unjailing in scenarios where the jail name does not match the boot environment name: 1. In 'bectl_locate_jail', 'mountpoint' is used to resolve the boot environment path, but really 'mounted' should be used. 'mountpoint' is the path where the zfs dataset will be mounted. 'mounted' is the path where the dataset is actually mounted. 2. in 'bectl_search_jail_paths', 'jail_getv' would fail after the first call. Which is fine, if the boot environment you're unjailing is the next one up. According to 'man jail_getv', it's expecting name and value strings. 'jail_getv' is being passed an integer for the lastjid, so amend that to use a string instead. Test cases have been amended to reflect the bugs found. PR: 233637 Modified: stable/12/lib/libbe/libbe.3 stable/12/sbin/bectl/bectl.8 stable/12/sbin/bectl/bectl_jail.c stable/12/sbin/bectl/tests/bectl_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libbe/libbe.3 ============================================================================== --- stable/12/lib/libbe/libbe.3 Thu Jan 3 16:47:05 2019 (r342737) +++ stable/12/lib/libbe/libbe.3 Thu Jan 3 18:30:36 2019 (r342738) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 2018 +.Dd November 21, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -440,32 +440,51 @@ The .Fn be_prop_list_free function will free the property list. .Sh DIAGNOSTICS -Upon error, one of the following values will be returned. -.\" TODO: make each entry on its own line. -.Bd -ragged -offset indent -BE_ERR_SUCCESS, -BE_ERR_INVALIDNAME, -BE_ERR_EXISTS, -BE_ERR_NOENT, -BE_ERR_PERMS, -BE_ERR_DESTROYACT, -BE_ERR_DESTROYMNT, -BE_ERR_BADPATH, -BE_ERR_PATHBUSY, -BE_ERR_PATHLEN, -BE_ERR_BADMOUNT, -BE_ERR_NOORIGIN, -BE_ERR_MOUNTED, -BE_ERR_NOMOUNT, -BE_ERR_ZFSOPEN, -BE_ERR_ZFSCLONE, -BE_ERR_IO, -BE_ERR_NOPOOL, -BE_ERR_NOMEM, +Upon error, one of the following values will be returned: +.Bl -dash -offset indent -compact +.It +BE_ERR_SUCCESS +.It +BE_ERR_INVALIDNAME +.It +BE_ERR_EXISTS +.It +BE_ERR_NOENT +.It +BE_ERR_PERMS +.It +BE_ERR_DESTROYACT +.It +BE_ERR_DESTROYMNT +.It +BE_ERR_BADPATH +.It +BE_ERR_PATHBUSY +.It +BE_ERR_PATHLEN +.It +BE_ERR_BADMOUNT +.It +BE_ERR_NOORIGIN +.It +BE_ERR_MOUNTED +.It +BE_ERR_NOMOUNT +.It +BE_ERR_ZFSOPEN +.It +BE_ERR_ZFSCLONE +.It +BE_ERR_IO +.It +BE_ERR_NOPOOL +.It +BE_ERR_NOMEM +.It BE_ERR_UNKNOWN -.Ed +.El .Sh SEE ALSO -.Xr be 1 +.Xr bectl 8 .Sh HISTORY .Nm and its corresponding command, Modified: stable/12/sbin/bectl/bectl.8 ============================================================================== --- stable/12/sbin/bectl/bectl.8 Thu Jan 3 16:47:05 2019 (r342737) +++ stable/12/sbin/bectl/bectl.8 Thu Jan 3 18:30:36 2019 (r342738) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2018 +.Dd December 25, 2018 .Dt BECTL 8 .Os .Sh NAME @@ -52,7 +52,6 @@ .Cm jail .Brq Fl b | Fl U .Oo Bro Fl o Ar key Ns = Ns Ar value | Fl u Ar key Brc Oc Ns ... -.Brq Ar jailID | jailName .Ar bootenv .Op Ar utility Op Ar argument ... .Nm @@ -153,7 +152,6 @@ from .Cm jail .Brq Fl b | Fl U .Oo Bro Fl o Ar key Ns = Ns Ar value | Fl u Ar key Brc Oc Ns ... -.Brq Ar jailID | jailName .Ao Ar bootenv Ac .Op Ar utility Op Ar argument ... .Xc @@ -193,10 +191,7 @@ The .Va host.hostname , and .Va path -may not actually be unset. -Attempts to unset any of these will revert them to the default values specified -below, if they have been overwritten by -.Fl o . +must be set, the default values are specified below. .Pp All .Ar key Ns = Ns Ar value @@ -207,7 +202,7 @@ The following default parameters are provided: .It Va allow.mount Ta Cm true .It Va allow.mount.devfs Ta Cm true .It Va enforce_statfs Ta Cm 1 -.It Va name Ta Va bootenv +.It Va name Ta jail id .It Va host.hostname Ta Va bootenv .It Va path Ta Set to a path in /tmp generated by .Xr libbe 3 . @@ -263,6 +258,7 @@ will force the unmount if busy. To fill in with jail upgrade example when behavior is firm. .El .Sh SEE ALSO +.Xr libbe 3 , .Xr jail 8 , .Xr zfs 8 , .Xr zpool 8 Modified: stable/12/sbin/bectl/bectl_jail.c ============================================================================== --- stable/12/sbin/bectl/bectl_jail.c Thu Jan 3 16:47:05 2019 (r342737) +++ stable/12/sbin/bectl/bectl_jail.c Thu Jan 3 18:30:36 2019 (r342738) @@ -181,10 +181,10 @@ bectl_cmd_jail(int argc, char *argv[]) { char *bootenv, *mountpoint; int jid, opt, ret; - bool default_hostname, default_name, interactive, unjail; + bool default_hostname, interactive, unjail; pid_t pid; - default_hostname = default_name = interactive = unjail = true; + default_hostname = interactive = unjail = true; jpcnt = INIT_PARAMCOUNT; jp = malloc(jpcnt * sizeof(*jp)); if (jp == NULL) @@ -206,8 +206,6 @@ bectl_cmd_jail(int argc, char *argv[]) * optarg has been modified to null terminate * at the assignment operator. */ - if (strcmp(optarg, "name") == 0) - default_name = false; if (strcmp(optarg, "host.hostname") == 0) default_hostname = false; } @@ -217,8 +215,6 @@ bectl_cmd_jail(int argc, char *argv[]) break; case 'u': if ((ret = jailparam_delarg(optarg)) == 0) { - if (strcmp(optarg, "name") == 0) - default_name = true; if (strcmp(optarg, "host.hostname") == 0) default_hostname = true; } else if (ret != ENOENT) { @@ -259,8 +255,6 @@ bectl_cmd_jail(int argc, char *argv[]) return (1); } - if (default_name) - jailparam_add("name", bootenv); if (default_hostname) jailparam_add("host.hostname", bootenv); @@ -316,15 +310,23 @@ bectl_cmd_jail(int argc, char *argv[]) static int bectl_search_jail_paths(const char *mnt) { - char jailpath[MAXPATHLEN]; int jid; + char lastjid[16]; + char jailpath[MAXPATHLEN]; + /* jail_getv expects name/value strings */ + snprintf(lastjid, sizeof(lastjid), "%d", 0); + jid = 0; - (void)mnt; - while ((jid = jail_getv(0, "lastjid", &jid, "path", &jailpath, + while ((jid = jail_getv(0, "lastjid", lastjid, "path", &jailpath, NULL)) != -1) { + + /* the jail we've been looking for */ if (strcmp(jailpath, mnt) == 0) return (jid); + + /* update lastjid and keep on looking */ + snprintf(lastjid, sizeof(lastjid), "%d", jid); } return (-1); @@ -354,8 +356,11 @@ bectl_locate_jail(const char *ident) return (-1); if (nvlist_lookup_nvlist(belist, ident, &props) == 0) { - /* We'll attempt to resolve the jid by way of mountpoint */ - if (nvlist_lookup_string(props, "mountpoint", &mnt) == 0) { + + /* path where a boot environment is mounted */ + if (nvlist_lookup_string(props, "mounted", &mnt) == 0) { + + /* looking for a jail that matches our bootenv path */ jid = bectl_search_jail_paths(mnt); be_prop_list_free(belist); return (jid); Modified: stable/12/sbin/bectl/tests/bectl_test.sh ============================================================================== --- stable/12/sbin/bectl/tests/bectl_test.sh Thu Jan 3 16:47:05 2019 (r342737) +++ stable/12/sbin/bectl/tests/bectl_test.sh Thu Jan 3 18:30:36 2019 (r342738) @@ -254,6 +254,14 @@ bectl_jail_body() atf_check cp /rescue/rescue ${root}/rescue/rescue atf_check bectl -r ${zpool}/ROOT umount default + # Prepare a second boot environment + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT create -e default target + + # When a jail name is not explicit, it should match the jail id. + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT jail -b -o jid=233637 default + atf_check -o inline:"233637\n" -s exit:0 -x "jls -j 233637 name" + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT unjail default + # Basic command-mode tests, with and without jail cleanup atf_check -o inline:"rescue\n" bectl -r ${zpool}/ROOT \ jail default /rescue/rescue ls -1 @@ -271,6 +279,11 @@ bectl_jail_body() atf_check bectl -r ${zpool}/ROOT jail -b default atf_check bectl -r ${zpool}/ROOT unjail default atf_check -s not-exit:0 -x "jls | grep -F \"${root}\"" + # 'unjail' by BE name. Force bectl to lookup jail id by the BE name. + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT jail -b default + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT jail -b -o name=bectl_test target + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT unjail target + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT unjail default # cannot unjail an unjailed BE (by either command name) atf_check -e ignore -s not-exit:0 bectl -r ${zpool}/ROOT ujail default atf_check -e ignore -s not-exit:0 bectl -r ${zpool}/ROOT unjail default @@ -281,8 +294,24 @@ bectl_jail_body() atf_check -s not-exit:0 -x "mount | grep -F '${root}'" atf_check bectl -r ${zpool}/ROOT ujail default } + +# If a test has failed, it's possible that the boot environment hasn't +# been 'unjail'ed. We want to remove the jail before 'bectl_cleanup' +# attempts to destroy the zpool. bectl_jail_cleanup() { + for bootenv in "default" "target"; do + # mountpoint of the boot environment + mountpoint="$(bectl -r bectl_test/ROOT list -H | grep ${bootenv} | awk '{print $3}')" + + # see if any jail paths match the boot environment mountpoint + jailid="$(jls | grep ${mountpoint} | awk '{print $1}')" + + if [ -z "$jailid" ]; then + continue; + fi + jail -r ${jailid} + done; bectl_cleanup bectl_test } From owner-svn-src-all@freebsd.org Thu Jan 3 19:35:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5634E14347E2; Thu, 3 Jan 2019 19:35: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 D7B588B6B6; Thu, 3 Jan 2019 19:35:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A67D725CB9; Thu, 3 Jan 2019 19:35: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 x03JZ7I9045846; Thu, 3 Jan 2019 19:35:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03JZ7L6045845; Thu, 3 Jan 2019 19:35:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901031935.x03JZ7L6045845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 3 Jan 2019 19:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342739 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 342739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D7B588B6B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 19:35:08 -0000 Author: kib Date: Thu Jan 3 19:35:07 2019 New Revision: 342739 URL: https://svnweb.freebsd.org/changeset/base/342739 Log: Fix typo in r342710. Noted by: lidl MFC after: 3 days Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jan 3 18:30:36 2019 (r342738) +++ head/sys/i386/i386/pmap.c Thu Jan 3 19:35:07 2019 (r342739) @@ -569,7 +569,7 @@ pmap_cold(void) /* * Bootstrap the system enough to run with virtual memory. * - * On the i386 this is called after pmap_cold() created intial + * On the i386 this is called after pmap_cold() created initial * kernel page table and enabled paging, and just syncs the pmap * module with what has already been done. */ From owner-svn-src-all@freebsd.org Thu Jan 3 20:22:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08B0714360CB; Thu, 3 Jan 2019 20:22:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DD1C8E032; Thu, 3 Jan 2019 20:22:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84FED26579; Thu, 3 Jan 2019 20:22:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03KMag8073799; Thu, 3 Jan 2019 20:22:36 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03KMaTq073798; Thu, 3 Jan 2019 20:22:36 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201901032022.x03KMaTq073798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 3 Jan 2019 20:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342740 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 342740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9DD1C8E032 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 20:22:37 -0000 Author: jilles Date: Thu Jan 3 20:22:35 2019 New Revision: 342740 URL: https://svnweb.freebsd.org/changeset/base/342740 Log: sh: Do not place exported but unset variables into the environment PR: 233545 Submitted by: Jan Beich Obtained from: NetBSD Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Thu Jan 3 19:35:07 2019 (r342739) +++ head/bin/sh/var.c Thu Jan 3 20:22:35 2019 (r342740) @@ -558,13 +558,13 @@ environment(void) nenv = 0; for (vpp = vartab ; vpp < vartab + VTABSIZE ; vpp++) { for (vp = *vpp ; vp ; vp = vp->next) - if (vp->flags & VEXPORT) + if ((vp->flags & (VEXPORT|VUNSET)) == VEXPORT) nenv++; } ep = env = stalloc((nenv + 1) * sizeof *env); for (vpp = vartab ; vpp < vartab + VTABSIZE ; vpp++) { for (vp = *vpp ; vp ; vp = vp->next) - if (vp->flags & VEXPORT) + if ((vp->flags & (VEXPORT|VUNSET)) == VEXPORT) *ep++ = vp->text; } *ep = NULL; From owner-svn-src-all@freebsd.org Thu Jan 3 20:23:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED005143611A; Thu, 3 Jan 2019 20:23:13 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DCE78E163; Thu, 3 Jan 2019 20:23:13 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 720E02657B; Thu, 3 Jan 2019 20:23:13 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03KNDhi073913; Thu, 3 Jan 2019 20:23:13 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03KNDN7073911; Thu, 3 Jan 2019 20:23:13 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201901032023.x03KNDN7073911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 3 Jan 2019 20:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342741 - head/bin/sh/tests/execution X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh/tests/execution X-SVN-Commit-Revision: 342741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DCE78E163 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Jan 2019 20:23:14 -0000 Author: jilles Date: Thu Jan 3 20:23:12 2019 New Revision: 342741 URL: https://svnweb.freebsd.org/changeset/base/342741 Log: sh: Add test for exported but unset variables PR: 233545 Added: head/bin/sh/tests/execution/env1.0 (contents, props changed) Modified: head/bin/sh/tests/execution/Makefile Modified: head/bin/sh/tests/execution/Makefile ============================================================================== --- head/bin/sh/tests/execution/Makefile Thu Jan 3 20:22:35 2019 (r342740) +++ head/bin/sh/tests/execution/Makefile Thu Jan 3 20:23:12 2019 (r342741) @@ -17,6 +17,7 @@ ${PACKAGE}FILES+= bg7.0 ${PACKAGE}FILES+= bg8.0 ${PACKAGE}FILES+= bg9.0 ${PACKAGE}FILES+= bg10.0 bg10.0.stdout +${PACKAGE}FILES+= env1.0 ${PACKAGE}FILES+= fork1.0 ${PACKAGE}FILES+= fork2.0 ${PACKAGE}FILES+= fork3.0 Added: head/bin/sh/tests/execution/env1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/env1.0 Thu Jan 3 20:23:12 2019 (r342741) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +unset somestrangevar +export somestrangevar +[ "`$SH -c 'echo ${somestrangevar-unset}'`" = unset ] From owner-svn-src-all@freebsd.org Thu Jan 3 20:27:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9309614364B4; Thu, 3 Jan 2019 20:27:53 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 396908E771; Thu, 3 Jan 2019 20:27:53 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2874A26586; Thu, 3 Jan 2019 20:27:53 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03KRrPa074543; Thu, 3 Jan 2019 20:27:53 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03KRoh2074528; Thu, 3 Jan 2019 20:27:50 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201901032027.x03KRoh2074528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 3 Jan 2019 20:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342742 - in head/stand/efi: include include/Guid include/Protocol libefi loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand/efi: include include/Guid include/Protocol libefi loader X-SVN-Commit-Revision: 342742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 396908E771 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 03 Jan 2019 20:27:54 -0000 Author: tsoome Date: Thu Jan 3 20:27:50 2019 New Revision: 342742 URL: https://svnweb.freebsd.org/changeset/base/342742 Log: loader.efi: efi variable rework and lsefi command added This update does add diag and debug capabilities to interpret the efi variables, configuration and protocols (lsefi). The side effect is that we add/update bunch of related headers. Added: head/stand/efi/include/Guid/ head/stand/efi/include/Guid/MemoryTypeInformation.h (contents, props changed) head/stand/efi/include/Guid/MtcVendor.h (contents, props changed) head/stand/efi/include/Guid/ZeroGuid.h (contents, props changed) head/stand/efi/include/Protocol/ head/stand/efi/include/Protocol/EdidActive.h (contents, props changed) head/stand/efi/include/Protocol/EdidDiscovered.h (contents, props changed) head/stand/efi/include/Protocol/EdidOverride.h (contents, props changed) head/stand/efi/include/efigpt.h (contents, props changed) head/stand/efi/include/efiip.h (contents, props changed) head/stand/efi/include/efipoint.h (contents, props changed) head/stand/efi/include/efitcp.h (contents, props changed) head/stand/efi/include/efiudp.h (contents, props changed) Modified: head/stand/efi/include/efi.h head/stand/efi/include/efiapi.h head/stand/efi/include/eficon.h head/stand/efi/include/efidef.h head/stand/efi/include/efilib.h head/stand/efi/include/efipciio.h head/stand/efi/libefi/env.c head/stand/efi/loader/main.c Added: head/stand/efi/include/Guid/MemoryTypeInformation.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Guid/MemoryTypeInformation.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,37 @@ +/* $FreeBSD$ */ +/** @file + This file defines: + * Memory Type Information GUID for HOB and Variable. + * Memory Type Information Variable Name. + * Memory Type Information GUID HOB data structure. + + The memory type information HOB and variable can + be used to store the information for each memory type in Variable or HOB. + +Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that accompanies this distribution. +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __MEMORY_TYPE_INFORMATION_GUID_H__ +#define __MEMORY_TYPE_INFORMATION_GUID_H__ + +#define EFI_MEMORY_TYPE_INFORMATION_GUID \ + { 0x4c19049f,0x4137,0x4dd3, { 0x9c,0x10,0x8b,0x97,0xa8,0x3f,0xfd,0xfa } } + +#define EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME "MemoryTypeInformation" + +extern EFI_GUID gEfiMemoryTypeInformationGuid; + +typedef struct { + UINT32 Type; ///< EFI memory type defined in UEFI specification. + UINT32 NumberOfPages; ///< The pages of this type memory. +} EFI_MEMORY_TYPE_INFORMATION; + +#endif Added: head/stand/efi/include/Guid/MtcVendor.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Guid/MtcVendor.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,32 @@ +/* $FreeBSD$ */ +/** @file + GUID is for MTC variable. + +Copyright (c) 2011, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that accompanies this distribution. +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __MTC_VENDOR_GUID_H__ +#define __MTC_VENDOR_GUID_H__ + +// +// Vendor GUID of the variable for the high part of monotonic counter (UINT32). +// +#define MTC_VENDOR_GUID \ + { 0xeb704011, 0x1402, 0x11d3, { 0x8e, 0x77, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } } + +// +// Name of the variable for the high part of monotonic counter +// +#define MTC_VARIABLE_NAME "MTC" + +extern EFI_GUID gMtcVendorGuid; + +#endif Added: head/stand/efi/include/Guid/ZeroGuid.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Guid/ZeroGuid.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,26 @@ +/* $FreeBSD$ */ +/** @file + GUID has all zero values. + +Copyright (c) 2011, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that accompanies this distribution. +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __ZERO_GUID_H__ +#define __ZERO_GUID_H__ + +#define ZERO_GUID \ + { \ + 0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} \ + } + +extern EFI_GUID gZeroGuid; + +#endif Added: head/stand/efi/include/Protocol/EdidActive.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Protocol/EdidActive.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,53 @@ +/* $FreeBSD$ */ +/** @file + EDID Active Protocol from the UEFI 2.0 specification. + + Placed on the video output device child handle that is actively displaying output. + + Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __EDID_ACTIVE_H__ +#define __EDID_ACTIVE_H__ + +#define EFI_EDID_ACTIVE_PROTOCOL_GUID \ + { \ + 0xbd8c1056, 0x9f36, 0x44ec, {0x92, 0xa8, 0xa6, 0x33, 0x7f, 0x81, 0x79, 0x86 } \ + } + +/// +/// This protocol contains the EDID information for an active video output device. This is either the +/// EDID information retrieved from the EFI_EDID_OVERRIDE_PROTOCOL if an override is +/// available, or an identical copy of the EDID information from the +/// EFI_EDID_DISCOVERED_PROTOCOL if no overrides are available. +/// +typedef struct { + /// + /// The size, in bytes, of the Edid buffer. 0 if no EDID information + /// is available from the video output device. Otherwise, it must be a + /// minimum of 128 bytes. + /// + UINT32 SizeOfEdid; + + /// + /// A pointer to a read-only array of bytes that contains the EDID + /// information for an active video output device. This pointer is + /// NULL if no EDID information is available for the video output + /// device. The minimum size of a valid Edid buffer is 128 bytes. + /// EDID information is defined in the E-EDID EEPROM + /// specification published by VESA (www.vesa.org). + /// + UINT8 *Edid; +} EFI_EDID_ACTIVE_PROTOCOL; + +extern EFI_GUID gEfiEdidActiveProtocolGuid; + +#endif Added: head/stand/efi/include/Protocol/EdidDiscovered.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Protocol/EdidDiscovered.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,51 @@ +/* $FreeBSD$ */ +/** @file + EDID Discovered Protocol from the UEFI 2.0 specification. + + This protocol is placed on the video output device child handle. It represents + the EDID information being used for the output device represented by the child handle. + + Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __EDID_DISCOVERED_H__ +#define __EDID_DISCOVERED_H__ + +#define EFI_EDID_DISCOVERED_PROTOCOL_GUID \ + { \ + 0x1c0c34f6, 0xd380, 0x41fa, {0xa0, 0x49, 0x8a, 0xd0, 0x6c, 0x1a, 0x66, 0xaa } \ + } + +/// +/// This protocol contains the EDID information retrieved from a video output device. +/// +typedef struct { + /// + /// The size, in bytes, of the Edid buffer. 0 if no EDID information + /// is available from the video output device. Otherwise, it must be a + /// minimum of 128 bytes. + /// + UINT32 SizeOfEdid; + + /// + /// A pointer to a read-only array of bytes that contains the EDID + /// information for an active video output device. This pointer is + /// NULL if no EDID information is available for the video output + /// device. The minimum size of a valid Edid buffer is 128 bytes. + /// EDID information is defined in the E-EDID EEPROM + /// specification published by VESA (www.vesa.org). + /// + UINT8 *Edid; +} EFI_EDID_DISCOVERED_PROTOCOL; + +extern EFI_GUID gEfiEdidDiscoveredProtocolGuid; + +#endif Added: head/stand/efi/include/Protocol/EdidOverride.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Protocol/EdidOverride.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,68 @@ +/* $FreeBSD$ */ +/** @file + EDID Override Protocol from the UEFI 2.0 specification. + + Allow platform to provide EDID information to the producer of the Graphics Output + protocol. + + Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __EDID_OVERRIDE_H__ +#define __EDID_OVERRIDE_H__ + +#define EFI_EDID_OVERRIDE_PROTOCOL_GUID \ + { \ + 0x48ecb431, 0xfb72, 0x45c0, {0xa9, 0x22, 0xf4, 0x58, 0xfe, 0x4, 0xb, 0xd5 } \ + } + +typedef struct _EFI_EDID_OVERRIDE_PROTOCOL EFI_EDID_OVERRIDE_PROTOCOL; + +#define EFI_EDID_OVERRIDE_DONT_OVERRIDE 0x01 +#define EFI_EDID_OVERRIDE_ENABLE_HOT_PLUG 0x02 + +/** + Returns policy information and potentially a replacement EDID for the specified video output device. + + @param This The EFI_EDID_OVERRIDE_PROTOCOL instance. + @param ChildHandle A child handle produced by the Graphics Output EFI + driver that represents a video output device. + @param Attributes The attributes associated with ChildHandle video output device. + @param EdidSize A pointer to the size, in bytes, of the Edid buffer. + @param Edid A pointer to callee allocated buffer that contains the EDID that + should be used for ChildHandle. A value of NULL + represents no EDID override for ChildHandle. + + @retval EFI_SUCCESS Valid overrides returned for ChildHandle. + @retval EFI_UNSUPPORTED ChildHandle has no overrides. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID)( + IN EFI_EDID_OVERRIDE_PROTOCOL *This, + IN EFI_HANDLE *ChildHandle, + OUT UINT32 *Attributes, + IN OUT UINTN *EdidSize, + IN OUT UINT8 **Edid + ); + +/// +/// This protocol is produced by the platform to allow the platform to provide +/// EDID information to the producer of the Graphics Output protocol. +/// +struct _EFI_EDID_OVERRIDE_PROTOCOL { + EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID GetEdid; +}; + +extern EFI_GUID gEfiEdidOverrideProtocolGuid; + +#endif Modified: head/stand/efi/include/efi.h ============================================================================== --- head/stand/efi/include/efi.h Thu Jan 3 20:23:12 2019 (r342741) +++ head/stand/efi/include/efi.h Thu Jan 3 20:27:50 2019 (r342742) @@ -43,8 +43,10 @@ Revision History #include "efibind.h" #include "efidef.h" #include "efidevp.h" +#include "efipciio.h" #include "efiprot.h" #include "eficon.h" +#include "eficonsctl.h" #include "efiser.h" #include "efi_nii.h" #include "efipxebc.h" @@ -53,6 +55,11 @@ Revision History #include "efifs.h" #include "efierr.h" #include "efigop.h" +#include "efiip.h" +#include "efiudp.h" +#include "efitcp.h" +#include "efipoint.h" +#include "efiuga.h" /* * FreeBSD UUID Modified: head/stand/efi/include/efiapi.h ============================================================================== --- head/stand/efi/include/efiapi.h Thu Jan 3 20:23:12 2019 (r342741) +++ head/stand/efi/include/efiapi.h Thu Jan 3 20:27:50 2019 (r342742) @@ -218,9 +218,13 @@ VOID { 0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C} } // Variable attributes -#define EFI_VARIABLE_NON_VOLATILE 0x00000001 -#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 -#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 +#define EFI_VARIABLE_NON_VOLATILE 0x00000001 +#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 +#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 +#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008 +#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010 +#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020 +#define EFI_VARIABLE_APPEND_WRITE 0x00000040 // Variable size limitation #define EFI_MAXIMUM_VARIABLE_SIZE 1024 @@ -911,4 +915,282 @@ typedef struct _EFI_SYSTEM_TABLE { } EFI_SYSTEM_TABLE; +/* + * unlisted GUID's.. + */ +#define EFI_EBC_INTERPRETER_PROTOCOL_GUID \ +{ 0x13AC6DD1, 0x73D0, 0x11D4, {0xB0, 0x6B, 0x00, 0xAA, 0x00, 0xBD, 0x6D, 0xE7} } + +#define EFI_DRIVER_CONFIGURATION2_PROTOCOL_GUID \ +{ 0xbfd7dc1d, 0x24f1, 0x40d9, {0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe} } + +#define EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \ +{ 0x107a772b, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_DRIVER_BINDING_PROTOCOL_GUID \ + { 0x18A031AB, 0xB443, 0x4D1A, \ + { 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71 } \ + } + +#define EFI_TAPE_IO_PROTOCOL_GUID \ + { 0x1e93e633, 0xd65a, 0x459e, \ + { 0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \ + } + +#define EFI_SCSI_IO_PROTOCOL_GUID \ + { 0x932f47e6, 0x2362, 0x4002, \ + { 0x80, 0x3e, 0x3c, 0xd5, 0x4b, 0x13, 0x8f, 0x85 } \ + } + +#define EFI_USB2_HC_PROTOCOL_GUID \ + { 0x3e745226, 0x9818, 0x45b6, \ + { 0xa2, 0xac, 0xd7, 0xcd, 0x0e, 0x8b, 0xa2, 0xbc } \ + } + +#define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \ + { 0x2755590C, 0x6F3C, 0x42FA, \ + { 0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } \ + } + +#define EFI_DEBUGPORT_PROTOCOL_GUID \ + { 0xEBA4E8D2, 0x3858, 0x41EC, \ + { 0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \ + } + +#define EFI_DECOMPRESS_PROTOCOL_GUID \ + { 0xd8117cfe, 0x94a6, 0x11d4, \ + { 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ + } + +#define EFI_ACPI_TABLE_PROTOCOL_GUID \ + { 0xffe06bdd, 0x6107, 0x46a6, \ + { 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c} \ + } + +#define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \ + { 0x587e72d7, 0xcc50, 0x4f79, \ + { 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f } \ + } + +#define EFI_HII_DATABASE_PROTOCOL_GUID \ + { 0xef9fc172, 0xa1b2, 0x4693, \ + { 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } \ + } + +#define EFI_HII_STRING_PROTOCOL_GUID \ + { 0xfd96974, 0x23aa, 0x4cdc, \ + { 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a } \ + } + +#define EFI_HII_IMAGE_PROTOCOL_GUID \ + { 0x31a6406a, 0x6bdf, 0x4e46, \ + { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } \ + } + +#define EFI_HII_FONT_PROTOCOL_GUID \ + { 0xe9ca4775, 0x8657, 0x47fc, \ + { 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 } \ + } +#define EFI_HII_CONFIGURATION_ACCESS_PROTOCOL_GUID \ + { 0x330d4706, 0xf2a0, 0x4e4f, \ + { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } \ + } + +#define EFI_COMPONENT_NAME_PROTOCOL_GUID \ +{ 0x107a772c, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \ + { 0x6a7a5cff, 0xe8d9, 0x4f70, \ + { 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14} \ + } + +#define EFI_USB_IO_PROTOCOL_GUID \ + { 0x2B2F68D6, 0x0CD2, 0x44cf, \ + { 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } \ + } +#define EFI_HCDP_TABLE_GUID \ + { 0xf951938d, 0x620b, 0x42ef, \ + { 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } \ + } + +#define EFI_DEVICE_TREE_GUID \ + { 0xb1b621d5, 0xf19c, 0x41a5, \ + { 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } \ + } + +#define EFI_VENDOR_APPLE_GUID \ + { 0x2B0585EB, 0xD8B8, 0x49A9, \ + { 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \ + } + +#define EFI_CONSOLE_IN_DEVICE_GUID \ +{ 0xd3b36f2b, 0xd551, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_CONSOLE_OUT_DEVICE_GUID \ +{ 0xd3b36f2c, 0xd551, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_STANDARD_ERROR_DEVICE_GUID \ +{ 0xd3b36f2d, 0xd551, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_UNICODE_COLLATION2_PROTOCOL_GUID \ +{ 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49} } + +#define EFI_FORM_BROWSER2_PROTOCOL_GUID \ +{ 0xb9d4c360, 0xbcfb, 0x4f9b, {0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58} } + +#define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \ +{ 0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3} } + +#define EFI_ARP_PROTOCOL_GUID \ +{ 0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c} } + +#define EFI_IP4_CONFIG_PROTOCOL_GUID \ +{ 0x3b95aa31, 0x3793, 0x434b, {0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e} } + +#define EFI_IP6_CONFIG_PROTOCOL_GUID \ +{ 0x937fe521, 0x95ae, 0x4d1a, {0x89, 0x29, 0x48, 0xbc, 0xd9, 0x0a, 0xd3, 0x1a} } + +#define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \ +{ 0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c} } + +#define EFI_MANAGED_NETWORK_PROTOCOL_GUID \ +{ 0x7ab33a91, 0xace5, 0x4326, {0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16} } + +#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \ +{ 0x2FE800BE, 0x8F01, 0x4aa6, {0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F} } + +#define EFI_MTFTP4_PROTOCOL_GUID \ +{ 0x78247c57, 0x63db, 0x4708, {0x99, 0xc2, 0xa8, 0xb4, 0xa9, 0xa6, 0x1f, 0x6b} } + +#define EFI_MTFTP6_SERVICE_BINDING_PROTOCOL_GUID \ +{ 0xd9760ff3, 0x3cca, 0x4267, {0x80, 0xf9, 0x75, 0x27, 0xfa, 0xfa, 0x42, 0x23} } + +#define EFI_MTFTP6_PROTOCOL_GUID \ +{ 0xbf0a78ba, 0xec29, 0x49cf, {0xa1, 0xc9, 0x7a, 0xe5, 0x4e, 0xab, 0x6a, 0x51} } + +#define EFI_DHCP4_PROTOCOL_GUID \ +{ 0x8a219718, 0x4ef5, 0x4761, {0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56} } + +#define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \ +{ 0x9d9a39d8, 0xbd42, 0x4a73, {0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80} } + +#define EFI_DHCP6_SERVICE_BINDING_PROTOCOL_GUID \ +{ 0x9fb9a8a1, 0x2f4a, 0x43a6, {0x88, 0x9c, 0xd0, 0xf7, 0xb6, 0xc4, 0x7a, 0xd5} } + +#define EFI_DHCP6_PROTOCOL_GUID \ +{ 0x87c8bad7, 0x595, 0x4053, {0x82, 0x97, 0xde, 0xde, 0x39, 0x5f, 0x5d, 0x5b} } + +#define EFI_SCSI_PASS_THRU_PROTOCOL_GUID \ +{ 0xa59e8fcf, 0xbda0, 0x43bb, {0x90, 0xb1, 0xd3, 0x73, 0x2e, 0xca, 0xa8, 0x77} } + +#define EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID \ +{ 0x143b7632, 0xb81b, 0x4cb7, {0xab, 0xd3, 0xb6, 0x25, 0xa5, 0xb9, 0xbf, 0xfe} } + +#define EFI_DISK_INFO_PROTOCOL_GUID \ +{ 0xd432a67f, 0x14dc, 0x484b, {0xb3, 0xbb, 0x3f, 0x2, 0x91, 0x84, 0x93, 0x27} } + +#define EFI_ISA_IO_PROTOCOL_GUID \ +{ 0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_VLAN_CONFIG_PROTOCOL_GUID \ +{ 0x9e23d768, 0xd2f3, 0x4366, {0x9f, 0xc3, 0x3a, 0x7a, 0xba, 0x86, 0x43, 0x74} } + +#define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \ +{ 0xa1e37052, 0x80d9, 0x4e65, {0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9} } + +#define EFI_ISA_ACPI_PROTOCOL_GUID \ +{ 0x64a892dc, 0x5561, 0x4536, {0x92, 0xc7, 0x79, 0x9b, 0xfc, 0x18, 0x33, 0x55} } + +#define EFI_PCI_ENUMERATION_COMPLETE_GUID \ +{ 0x30cfe3e7, 0x3de1, 0x4586, {0xbe, 0x20, 0xde, 0xab, 0xa1, 0xb3, 0xb7, 0x93} } + +#define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \ +{ 0x0784924f, 0xe296, 0x11d4, {0x9a, 0x49, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } } + +#define EFI_DRIVER_DIAGNOSTICS2_PROTOCOL_GUID \ +{ 0x4d330321, 0x025f, 0x4aac, {0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63} } + +#define EFI_CAPSULE_ARCH_PROTOCOL_GUID \ +{ 0x5053697e, 0x2cbc, 0x4819, {0x90, 0xd9, 0x05, 0x80, 0xde, 0xee, 0x57, 0x54} } + +#define EFI_MONOTONIC_COUNTER_ARCH_PROTOCOL_GUID \ +{0x1da97072, 0xbddc, 0x4b30, {0x99, 0xf1, 0x72, 0xa0, 0xb5, 0x6f, 0xff, 0x2a} } + +#define EFI_REALTIME_CLOCK_ARCH_PROTOCOL_GUID \ +{0x27cfac87, 0x46cc, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_MP_SERVICES_PROTOCOL_GUID \ +{ 0x3fdda605, 0xa76e, 0x4f46, {0xad, 0x29, 0x12, 0xf4, 0x53, 0x1b, 0x3d, 0x08} } + +#define EFI_VARIABLE_ARCH_PROTOCOL_GUID \ +{ 0x1e5668e2, 0x8481, 0x11d4, {0xbc, 0xf1, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } } + +#define EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID \ +{ 0x6441f818, 0x6362, 0x4e44, {0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53} } + +#define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \ +{ 0x6441f818, 0x6362, 0x4e44, {0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53} } + +#define EFI_ACPI_SUPPORT_PROTOCOL_GUID \ +{ 0x6441f818, 0x6362, 0x4e44, {0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53} } + +#define EFI_BDS_ARCH_PROTOCOL_GUID \ +{ 0x665e3ff6, 0x46cc, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_METRONOME_ARCH_PROTOCOL_GUID \ +{ 0x26baccb2, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } } + +#define EFI_TIMER_ARCH_PROTOCOL_GUID \ +{ 0x26baccb3, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } } + +#define EFI_DPC_PROTOCOL_GUID \ +{ 0x480f8ae9, 0xc46, 0x4aa9, { 0xbc, 0x89, 0xdb, 0x9f, 0xba, 0x61, 0x98, 0x6} } + +#define EFI_PRINT2_PROTOCOL_GUID \ +{ 0xf05976ef, 0x83f1, 0x4f3d, {0x86, 0x19, 0xf7, 0x59, 0x5d, 0x41, 0xe5, 0x38} } + +#define EFI_RESET_ARCH_PROTOCOL_GUID \ +{ 0x27cfac88, 0x46cc, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_CPU_ARCH_PROTOCOL_GUID \ +{ 0x26baccb1, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } } + +#define EFI_CPU_IO2_PROTOCOL_GUID \ +{ 0xad61f191, 0xae5f, 0x4c0e, {0xb9, 0xfa, 0xe8, 0x69, 0xd2, 0x88, 0xc6, 0x4f} } + +#define EFI_LEGACY_8259_PROTOCOL_GUID \ +{ 0x38321dba, 0x4fe0, 0x4e17, {0x8a, 0xec, 0x41, 0x30, 0x55, 0xea, 0xed, 0xc1} } + +#define EFI_SECURITY_ARCH_PROTOCOL_GUID \ +{ 0xa46423e3, 0x4617, 0x49f1, {0xb9, 0xff, 0xd1, 0xbf, 0xa9, 0x11, 0x58, 0x39} } + +#define EFI_SECURITY2_ARCH_PROTOCOL_GUID \ +{ 0x94ab2f58, 0x1438, 0x4ef1, {0x91, 0x52, 0x18, 0x94, 0x1a, 0x3a, 0x0e, 0x68} } + +#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \ +{ 0xb7dfb4e1, 0x52f, 0x449f, {0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33} } + +#define EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID \ +{ 0xd2b2b828, 0x826, 0x48a7, {0xb3, 0xdf, 0x98, 0x3c, 0x0, 0x60, 0x24, 0xf0} } + +#define EFI_DATA_HUB_PROTOCOL_GUID \ +{ 0xae80d021, 0x618e, 0x11d4, {0xbc, 0xd7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} } + +#define PCD_PROTOCOL_GUID \ +{ 0x11b34006, 0xd85b, 0x4d0a, { 0xa2, 0x90, 0xd5, 0xa5, 0x71, 0x31, 0xe, 0xf7} } + +#define EFI_PCD_PROTOCOL_GUID \ +{ 0x13a3f0f6, 0x264a, 0x3ef0, {0xf2, 0xe0, 0xde, 0xc5, 0x12, 0x34, 0x2f, 0x34} } + +#define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \ +{ 0x8f644fa9, 0xe850, 0x4db1, {0x9c, 0xe2, 0xb, 0x44, 0x69, 0x8e, 0x8d, 0xa4 } } + +#define EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID \ +{ 0x220e73b6, 0x6bdb, 0x4413, { 0x84, 0x5, 0xb9, 0x74, 0xb1, 0x8, 0x61, 0x9a } } + +#define EFI_FIRMWARE_VOLUME_DISPATCH_PROTOCOL_GUID \ +{ 0x7aa35a69, 0x506c, 0x444f, {0xa7, 0xaf, 0x69, 0x4b, 0xf5, 0x6f, 0x71, 0xc8} } + +#define LZMA_COMPRESS_GUID \ +{ 0xee4e5898, 0x3914, 0x4259, {0x9d, 0x6e, 0xdc, 0x7b, 0xd7, 0x94, 0x03, 0xcf} } #endif Modified: head/stand/efi/include/eficon.h ============================================================================== --- head/stand/efi/include/eficon.h Thu Jan 3 20:23:12 2019 (r342741) +++ head/stand/efi/include/eficon.h Thu Jan 3 20:27:50 2019 (r342742) @@ -263,29 +263,57 @@ typedef struct { // Scan codes for base line keys // -#define SCAN_NULL 0x0000 -#define SCAN_UP 0x0001 -#define SCAN_DOWN 0x0002 -#define SCAN_RIGHT 0x0003 -#define SCAN_LEFT 0x0004 -#define SCAN_HOME 0x0005 -#define SCAN_END 0x0006 -#define SCAN_INSERT 0x0007 -#define SCAN_DELETE 0x0008 -#define SCAN_PAGE_UP 0x0009 -#define SCAN_PAGE_DOWN 0x000A -#define SCAN_F1 0x000B -#define SCAN_F2 0x000C -#define SCAN_F3 0x000D -#define SCAN_F4 0x000E -#define SCAN_F5 0x000F -#define SCAN_F6 0x0010 -#define SCAN_F7 0x0011 -#define SCAN_F8 0x0012 -#define SCAN_F9 0x0013 -#define SCAN_F10 0x0014 -#define SCAN_ESC 0x0017 +#define SCAN_NULL 0x0000 +#define SCAN_UP 0x0001 +#define SCAN_DOWN 0x0002 +#define SCAN_RIGHT 0x0003 +#define SCAN_LEFT 0x0004 +#define SCAN_HOME 0x0005 +#define SCAN_END 0x0006 +#define SCAN_INSERT 0x0007 +#define SCAN_DELETE 0x0008 +#define SCAN_PAGE_UP 0x0009 +#define SCAN_PAGE_DOWN 0x000A +#define SCAN_F1 0x000B +#define SCAN_F2 0x000C +#define SCAN_F3 0x000D +#define SCAN_F4 0x000E +#define SCAN_F5 0x000F +#define SCAN_F6 0x0010 +#define SCAN_F7 0x0011 +#define SCAN_F8 0x0012 +#define SCAN_F9 0x0013 +#define SCAN_F10 0x0014 +#define SCAN_ESC 0x0017 +// +// EFI Scan code Ex +// +#define SCAN_F11 0x0015 +#define SCAN_F12 0x0016 +#define SCAN_F13 0x0068 +#define SCAN_F14 0x0069 +#define SCAN_F15 0x006A +#define SCAN_F16 0x006B +#define SCAN_F17 0x006C +#define SCAN_F18 0x006D +#define SCAN_F19 0x006E +#define SCAN_F20 0x006F +#define SCAN_F21 0x0070 +#define SCAN_F22 0x0071 +#define SCAN_F23 0x0072 +#define SCAN_F24 0x0073 +#define SCAN_MUTE 0x007F +#define SCAN_VOLUME_UP 0x0080 +#define SCAN_VOLUME_DOWN 0x0081 +#define SCAN_BRIGHTNESS_UP 0x0100 +#define SCAN_BRIGHTNESS_DOWN 0x0101 +#define SCAN_SUSPEND 0x0102 +#define SCAN_HIBERNATE 0x0103 +#define SCAN_TOGGLE_DISPLAY 0x0104 +#define SCAN_RECOVERY 0x0105 +#define SCAN_EJECT 0x0106 + typedef EFI_STATUS (EFIAPI *EFI_INPUT_RESET) ( @@ -305,5 +333,195 @@ typedef struct _SIMPLE_INPUT_INTERFACE { EFI_INPUT_READ_KEY ReadKeyStroke; EFI_EVENT WaitForKey; } SIMPLE_INPUT_INTERFACE; + +#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ + {0xdd9e7534, 0x7762, 0x4698, {0x8c, 0x14, 0xf5, 0x85, \ + 0x17, 0xa6, 0x25, 0xaa} } + +INTERFACE_DECL(_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL); + +typedef UINT8 EFI_KEY_TOGGLE_STATE; +// +// Any Shift or Toggle State that is valid should have +// high order bit set. +// +typedef struct EFI_KEY_STATE { + UINT32 KeyShiftState; + EFI_KEY_TOGGLE_STATE KeyToggleState; +} EFI_KEY_STATE; + +typedef struct { + EFI_INPUT_KEY Key; + EFI_KEY_STATE KeyState; +} EFI_KEY_DATA; + +// +// Shift state +// +#define EFI_SHIFT_STATE_VALID 0x80000000 +#define EFI_RIGHT_SHIFT_PRESSED 0x00000001 +#define EFI_LEFT_SHIFT_PRESSED 0x00000002 +#define EFI_RIGHT_CONTROL_PRESSED 0x00000004 +#define EFI_LEFT_CONTROL_PRESSED 0x00000008 +#define EFI_RIGHT_ALT_PRESSED 0x00000010 +#define EFI_LEFT_ALT_PRESSED 0x00000020 +#define EFI_RIGHT_LOGO_PRESSED 0x00000040 +#define EFI_LEFT_LOGO_PRESSED 0x00000080 +#define EFI_MENU_KEY_PRESSED 0x00000100 +#define EFI_SYS_REQ_PRESSED 0x00000200 + +// +// Toggle state +// +#define EFI_TOGGLE_STATE_VALID 0x80 +#define EFI_KEY_STATE_EXPOSED 0x40 +#define EFI_SCROLL_LOCK_ACTIVE 0x01 +#define EFI_NUM_LOCK_ACTIVE 0x02 +#define EFI_CAPS_LOCK_ACTIVE 0x04 + +// +// EFI Key Notfication Function +// +typedef +EFI_STATUS +(EFIAPI *EFI_KEY_NOTIFY_FUNCTION) ( + IN EFI_KEY_DATA *KeyData + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_INPUT_RESET_EX) ( + IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN BOOLEAN ExtendedVerification + ) +/*++ + + Routine Description: + Reset the input device and optionaly run diagnostics + + Arguments: + This - Protocol instance pointer. + ExtendedVerification - Driver may perform diagnostics on reset. + + Returns: + EFI_SUCCESS - The device was reset. + EFI_DEVICE_ERROR - The device is not functioning properly and could + not be reset. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_INPUT_READ_KEY_EX) ( + IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + OUT EFI_KEY_DATA *KeyData + ) +/*++ + + Routine Description: + Reads the next keystroke from the input device. The WaitForKey Event can + be used to test for existance of a keystroke via WaitForEvent () call. + + Arguments: + This - Protocol instance pointer. + KeyData - A pointer to a buffer that is filled in with the keystroke + state data for the key that was pressed. + + Returns: + EFI_SUCCESS - The keystroke information was returned. + EFI_NOT_READY - There was no keystroke data availiable. + EFI_DEVICE_ERROR - The keystroke information was not returned due to + hardware errors. + EFI_INVALID_PARAMETER - KeyData is NULL. +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_SET_STATE) ( + IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_KEY_TOGGLE_STATE *KeyToggleState + ) +/*++ + + Routine Description: + Set certain state for the input device. + + Arguments: + This - Protocol instance pointer. + KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the + state for the input device. + + Returns: + EFI_SUCCESS - The device state was set successfully. + EFI_DEVICE_ERROR - The device is not functioning correctly and could + not have the setting adjusted. + EFI_UNSUPPORTED - The device does not have the ability to set its state. + EFI_INVALID_PARAMETER - KeyToggleState is NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY) ( + IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_KEY_DATA *KeyData, + IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, + OUT EFI_HANDLE *NotifyHandle + ) +/*++ + + Routine Description: + Register a notification function for a particular keystroke for the input device. + + Arguments: + This - Protocol instance pointer. + KeyData - A pointer to a buffer that is filled in with the keystroke + information data for the key that was pressed. + KeyNotificationFunction - Points to the function to be called when the key + sequence is typed specified by KeyData. + NotifyHandle - Points to the unique handle assigned to the registered notification. + + Returns: + EFI_SUCCESS - The notification function was registered successfully. + EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures. + EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY) ( + IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_HANDLE NotificationHandle + ) +/*++ + + Routine Description: + Remove a registered notification function from a particular keystroke. + + Arguments: + This - Protocol instance pointer. + NotificationHandle - The handle of the notification function being unregistered. + + Returns: + EFI_SUCCESS - The notification function was unregistered successfully. + EFI_INVALID_PARAMETER - The NotificationHandle is invalid. + EFI_NOT_FOUND - Can not find the matching entry in database. + +--*/ +; + +typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL { + EFI_INPUT_RESET_EX Reset; + EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx; + EFI_EVENT WaitForKeyEx; + EFI_SET_STATE SetState; + EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify; + EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify; +} EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; #endif Modified: head/stand/efi/include/efidef.h ============================================================================== --- head/stand/efi/include/efidef.h Thu Jan 3 20:23:12 2019 (r342741) +++ head/stand/efi/include/efidef.h Thu Jan 3 20:27:50 2019 (r342742) @@ -121,6 +121,19 @@ typedef struct { UINT8 Addr[32]; } EFI_MAC_ADDRESS; +typedef struct { + UINT32 ReceivedQueueTimeoutValue; + UINT32 TransmitQueueTimeoutValue; + UINT16 ProtocolTypeFilter; + BOOLEAN EnableUnicastReceive; + BOOLEAN EnableMulticastReceive; + BOOLEAN EnableBroadcastReceive; + BOOLEAN EnablePromiscuousReceive; + BOOLEAN FlushQueuesOnReset; + BOOLEAN EnableReceiveTimestamps; + BOOLEAN DisableBackgroundPolling; +} EFI_MANAGED_NETWORK_CONFIG_DATA; + // // Memory // Added: head/stand/efi/include/efigpt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/efigpt.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,69 @@ +/* $FreeBSD$ */ +#ifndef _EFI_GPT_H +#define _EFI_GPT_H +/*++ + +Copyright (c) 1998 Intel Corporation + +Module Name: + + EfiGpt.h + +Abstract: + Include file for EFI partitioning scheme + + + +Revision History + +--*/ + +#define PRIMARY_PART_HEADER_LBA 1 + +typedef struct { + EFI_TABLE_HEADER Header; + EFI_LBA MyLBA; + EFI_LBA AlternateLBA; + EFI_LBA FirstUsableLBA; + EFI_LBA LastUsableLBA; + EFI_GUID DiskGUID; + EFI_LBA PartitionEntryLBA; + UINT32 NumberOfPartitionEntries; + UINT32 SizeOfPartitionEntry; + UINT32 PartitionEntryArrayCRC32; +} EFI_PARTITION_TABLE_HEADER; + +#define EFI_PTAB_HEADER_ID "EFI PART" + +typedef struct { + EFI_GUID PartitionTypeGUID; + EFI_GUID UniquePartitionGUID; + EFI_LBA StartingLBA; + EFI_LBA EndingLBA; + UINT64 Attributes; + CHAR16 PartitionName[36]; +} EFI_PARTITION_ENTRY; + +// +// EFI Partition Attributes +// +#define EFI_PART_USED_BY_EFI 0x0000000000000001 +#define EFI_PART_REQUIRED_TO_FUNCTION 0x0000000000000002 +#define EFI_PART_USED_BY_OS 0x0000000000000004 +#define EFI_PART_REQUIRED_BY_OS 0x0000000000000008 +#define EFI_PART_BACKUP_REQUIRED 0x0000000000000010 +#define EFI_PART_USER_DATA 0x0000000000000020 +#define EFI_PART_CRITICAL_USER_DATA 0x0000000000000040 +#define EFI_PART_REDUNDANT_PARTITION 0x0000000000000080 + +#define EFI_PART_TYPE_UNUSED_GUID \ + { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} } + +#define EFI_PART_TYPE_EFI_SYSTEM_PART_GUID \ + { 0xc12a7328, 0xf81f, 0x11d2, {0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b} } + +#define EFI_PART_TYPE_LEGACY_MBR_GUID \ + { 0x024dee41, 0x33e7, 0x11d3, {0x9d, 0x69, 0x00, 0x08, 0xc7, 0x81, 0xf3, 0x9f} } + +#endif + Added: head/stand/efi/include/efiip.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/efiip.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,460 @@ +/* $FreeBSD$ */ +#ifndef _EFI_IP_H +#define _EFI_IP_H + +/*++ +Copyright (c) 2013 Intel Corporation + +--*/ + +#define EFI_IP4_SERVICE_BINDING_PROTOCOL \ + {0xc51711e7,0xb4bf,0x404a,{0xbf,0xb8,0x0a,0x04, 0x8e,0xf1,0xff,0xe4}} + +#define EFI_IP4_PROTOCOL \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jan 3 21:31:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8131A14381DB; Thu, 3 Jan 2019 21:31:18 +0000 (UTC) (envelope-from romain@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2183C6A4EB; Thu, 3 Jan 2019 21:31:18 +0000 (UTC) (envelope-from romain@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15B1C27120; Thu, 3 Jan 2019 21:31:18 +0000 (UTC) (envelope-from romain@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03LVHg6010374; Thu, 3 Jan 2019 21:31:17 GMT (envelope-from romain@FreeBSD.org) Received: (from romain@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03LVHvj010372; Thu, 3 Jan 2019 21:31:17 GMT (envelope-from romain@FreeBSD.org) Message-Id: <201901032131.x03LVHvj010372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: romain set sender to romain@FreeBSD.org using -f From: =?UTF-8?Q?Romain_Tarti=c3=a8re?= Date: Thu, 3 Jan 2019 21:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342743 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: romain X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 342743 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2183C6A4EB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 21:31:18 -0000 Author: romain (ports committer) Date: Thu Jan 3 21:31:17 2019 New Revision: 342743 URL: https://svnweb.freebsd.org/changeset/base/342743 Log: Add man page for dlvsym(3) Add a short description of the function to the appropriate man page and add reference to it where it makes sense. Reviewed by: bcr, markj, 0mp Approved by: markj Differential Revision: https://reviews.freebsd.org/D18725 Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/gen/dlopen.3 Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Thu Jan 3 20:27:50 2019 (r342742) +++ head/lib/libc/gen/Makefile.inc Thu Jan 3 21:31:17 2019 (r342743) @@ -339,7 +339,8 @@ MLINKS+=dlopen.3 fdlopen.3 \ dlopen.3 dlclose.3 \ dlopen.3 dlerror.3 \ dlopen.3 dlfunc.3 \ - dlopen.3 dlsym.3 + dlopen.3 dlsym.3 \ + dlopen.3 dlvsym.3 MLINKS+=err.3 err_set_exit.3 \ err.3 err_set_file.3 \ err.3 errc.3 \ Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Thu Jan 3 20:27:50 2019 (r342742) +++ head/lib/libc/gen/dlopen.3 Thu Jan 3 21:31:17 2019 (r342743) @@ -32,13 +32,14 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd July 7, 2017 +.Dd January 2, 2019 .Dt DLOPEN 3 .Os .Sh NAME .Nm dlopen , .Nm fdlopen , .Nm dlsym , +.Nm dlvsym , .Nm dlfunc , .Nm dlerror , .Nm dlclose @@ -53,6 +54,8 @@ .Fn fdlopen "int fd" "int mode" .Ft void * .Fn dlsym "void * restrict handle" "const char * restrict symbol" +.Ft void * +.Fn dlvsym "void * restrict handle" "const char * restrict symbol" "const char * restrict version" .Ft dlfunc_t .Fn dlfunc "void * restrict handle" "const char * restrict symbol" .Ft char * @@ -74,7 +77,8 @@ provides access to the shared object in .Fa path , returning a descriptor that can be used for later references to the object in calls to -.Fn dlsym +.Fn dlsym , +.Fn dlvsym and .Fn dlclose . If @@ -300,6 +304,16 @@ condition which may be queried with .Fn dlerror . .Pp The +.Fn dlvsym +function behaves like +.Fn dlsym , +but takes an extra argument +.Fa version : +a null-terminated character string which is used to request a specific version +of +.Fa symbol . +.Pp +The .Fn dlfunc function implements all of the behavior of @@ -328,6 +342,7 @@ occurred during a call to .Fn dladdr , .Fn dlinfo , .Fn dlsym , +.Fn dlvsym , .Fn dlfunc , or .Fn dlclose . @@ -375,7 +390,10 @@ using the option to .Xr ld 1 for symbols defined in the executable to become visible to -.Fn dlsym . +.Fn dlsym , +.Fn dlvsym +or +.Fn dlfunc .Pp Other ELF platforms require linking with .Lb libdl @@ -397,6 +415,7 @@ The .Fn dlopen , .Fn fdlopen , .Fn dlsym , +.Fn dlvsym , and .Fn dlfunc functions From owner-svn-src-all@freebsd.org Thu Jan 3 22:32:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4FB81439B71; Thu, 3 Jan 2019 22:32:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 783546C7F0; Thu, 3 Jan 2019 22:32:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AB6327BB8; Thu, 3 Jan 2019 22:32:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03MWDRH044333; Thu, 3 Jan 2019 22:32:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03MWDiT044332; Thu, 3 Jan 2019 22:32:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901032232.x03MWDiT044332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Jan 2019 22:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342744 - stable/12/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/opencrypto X-SVN-Commit-Revision: 342744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 783546C7F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 22:32:14 -0000 Author: jhb Date: Thu Jan 3 22:32:12 2019 New Revision: 342744 URL: https://svnweb.freebsd.org/changeset/base/342744 Log: MFC 339665: Add sha224 to the authctx union. Modified: stable/12/sys/opencrypto/xform_auth.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/opencrypto/xform_auth.h ============================================================================== --- stable/12/sys/opencrypto/xform_auth.h Thu Jan 3 21:31:17 2019 (r342743) +++ stable/12/sys/opencrypto/xform_auth.h Thu Jan 3 22:32:12 2019 (r342744) @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -89,6 +90,7 @@ union authctx { MD5_CTX md5ctx; SHA1_CTX sha1ctx; RMD160_CTX rmd160ctx; + SHA224_CTX sha224ctx; SHA256_CTX sha256ctx; SHA384_CTX sha384ctx; SHA512_CTX sha512ctx; From owner-svn-src-all@freebsd.org Thu Jan 3 22:42:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33230143A085; Thu, 3 Jan 2019 22:42:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C47E06CE6C; Thu, 3 Jan 2019 22:42:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7DC627D60; Thu, 3 Jan 2019 22:42:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03MgGxV049950; Thu, 3 Jan 2019 22:42:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03MgGCX049949; Thu, 3 Jan 2019 22:42:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901032242.x03MgGCX049949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Jan 2019 22:42: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: r342745 - stable/12/sys/dev/cxgbe/crypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe/crypto X-SVN-Commit-Revision: 342745 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C47E06CE6C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 22:42:17 -0000 Author: jhb Date: Thu Jan 3 22:42:16 2019 New Revision: 342745 URL: https://svnweb.freebsd.org/changeset/base/342745 Log: MFC 339666: Support the SHA224 HMAC algorithm in ccr(4). Modified: stable/12/sys/dev/cxgbe/crypto/t4_crypto.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- stable/12/sys/dev/cxgbe/crypto/t4_crypto.c Thu Jan 3 22:32:12 2019 (r342744) +++ stable/12/sys/dev/cxgbe/crypto/t4_crypto.c Thu Jan 3 22:42:16 2019 (r342745) @@ -1667,6 +1667,7 @@ ccr_attach(device_t dev) ccr_sysctls(sc); crypto_register(cid, CRYPTO_SHA1_HMAC, 0, 0); + crypto_register(cid, CRYPTO_SHA2_224_HMAC, 0, 0); crypto_register(cid, CRYPTO_SHA2_256_HMAC, 0, 0); crypto_register(cid, CRYPTO_SHA2_384_HMAC, 0, 0); crypto_register(cid, CRYPTO_SHA2_512_HMAC, 0, 0); @@ -1717,6 +1718,10 @@ ccr_copy_partial_hash(void *dst, int cri_alg, union au for (i = 0; i < SHA1_HASH_LEN / 4; i++) u32[i] = htobe32(auth_ctx->sha1ctx.h.b32[i]); break; + case CRYPTO_SHA2_224_HMAC: + for (i = 0; i < SHA2_256_HASH_LEN / 4; i++) + u32[i] = htobe32(auth_ctx->sha224ctx.state[i]); + break; case CRYPTO_SHA2_256_HMAC: for (i = 0; i < SHA2_256_HASH_LEN / 4; i++) u32[i] = htobe32(auth_ctx->sha256ctx.state[i]); @@ -1897,6 +1902,7 @@ ccr_newsession(device_t dev, crypto_session_t cses, st for (c = cri; c != NULL; c = c->cri_next) { switch (c->cri_alg) { case CRYPTO_SHA1_HMAC: + case CRYPTO_SHA2_224_HMAC: case CRYPTO_SHA2_256_HMAC: case CRYPTO_SHA2_384_HMAC: case CRYPTO_SHA2_512_HMAC: @@ -1912,6 +1918,12 @@ ccr_newsession(device_t dev, crypto_session_t cses, st auth_mode = CHCR_SCMD_AUTH_MODE_SHA1; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_160; partial_digest_len = SHA1_HASH_LEN; + break; + case CRYPTO_SHA2_224_HMAC: + auth_hash = &auth_hash_hmac_sha2_224; + auth_mode = CHCR_SCMD_AUTH_MODE_SHA224; + mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_256; + partial_digest_len = SHA2_256_HASH_LEN; break; case CRYPTO_SHA2_256_HMAC: auth_hash = &auth_hash_hmac_sha2_256; From owner-svn-src-all@freebsd.org Thu Jan 3 22:49:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FC25143A133; Thu, 3 Jan 2019 22:49:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B0476D089; Thu, 3 Jan 2019 22:49:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 035F827D88; Thu, 3 Jan 2019 22:49:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03MmxVW050362; Thu, 3 Jan 2019 22:48:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03MmxJA050361; Thu, 3 Jan 2019 22:48:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901032248.x03MmxJA050361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Jan 2019 22:48: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: r342746 - stable/12/sys/dev/cxgbe/crypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe/crypto X-SVN-Commit-Revision: 342746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B0476D089 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,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, 03 Jan 2019 22:49:01 -0000 Author: jhb Date: Thu Jan 3 22:48:59 2019 New Revision: 342746 URL: https://svnweb.freebsd.org/changeset/base/342746 Log: MFC 339890: Add support for "plain" (non-HMAC) SHA digests. Modified: stable/12/sys/dev/cxgbe/crypto/t4_crypto.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- stable/12/sys/dev/cxgbe/crypto/t4_crypto.c Thu Jan 3 22:42:16 2019 (r342745) +++ stable/12/sys/dev/cxgbe/crypto/t4_crypto.c Thu Jan 3 22:48:59 2019 (r342746) @@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$"); * | key context header | * +-------------------------------+ * | AES key | ----- For requests with AES + * +-------------------------------+ + * | Hash state | ----- For hash-only requests * +-------------------------------+ - * | IPAD (16-byte aligned) | \ * +-------------------------------+ +---- For requests with HMAC @@ -72,7 +74,7 @@ __FBSDID("$FreeBSD$"); * +-------------------------------+ +---- Destination buffer for * | PHYS_DSGL entries | / non-hash-only requests * +-------------------------------+ - - * | 16 dummy bytes | ----- Only for hash-only requests + * | 16 dummy bytes | ----- Only for HMAC/hash-only requests * +-------------------------------+ * | IV | ----- If immediate IV * +-------------------------------+ @@ -160,7 +162,7 @@ struct ccr_session_blkcipher { struct ccr_session { bool active; int pending; - enum { HMAC, BLKCIPHER, AUTHENC, GCM } mode; + enum { HASH, HMAC, BLKCIPHER, AUTHENC, GCM } mode; union { struct ccr_session_hmac hmac; struct ccr_session_gmac gmac; @@ -200,6 +202,7 @@ struct ccr_softc { /* Statistics. */ uint64_t stats_blkcipher_encrypt; uint64_t stats_blkcipher_decrypt; + uint64_t stats_hash; uint64_t stats_hmac; uint64_t stats_authenc_encrypt; uint64_t stats_authenc_decrypt; @@ -420,7 +423,7 @@ ccr_populate_wreq(struct ccr_softc *sc, struct chcr_wr } static int -ccr_hmac(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) +ccr_hash(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) { struct chcr_wr *crwr; struct wrqe *wr; @@ -428,8 +431,8 @@ ccr_hmac(struct ccr_softc *sc, struct ccr_session *s, struct cryptodesc *crd; char *dst; u_int hash_size_in_response, kctx_flits, kctx_len, transhdr_len, wr_len; - u_int imm_len, iopad_size; - int error, sgl_nsegs, sgl_len; + u_int hmac_ctrl, imm_len, iopad_size; + int error, sgl_nsegs, sgl_len, use_opad; crd = crp->crp_desc; @@ -439,6 +442,14 @@ ccr_hmac(struct ccr_softc *sc, struct ccr_session *s, axf = s->hmac.auth_hash; + if (s->mode == HMAC) { + use_opad = 1; + hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; + } else { + use_opad = 0; + hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NOP; + } + /* PADs must be 128-bit aligned. */ iopad_size = roundup2(s->hmac.partial_digest_len, 16); @@ -446,7 +457,9 @@ ccr_hmac(struct ccr_softc *sc, struct ccr_session *s, * The 'key' part of the context includes the aligned IPAD and * OPAD. */ - kctx_len = iopad_size * 2; + kctx_len = iopad_size; + if (use_opad) + kctx_len += iopad_size; hash_size_in_response = axf->hashsize; transhdr_len = HASH_TRANSHDR_SIZE(kctx_len); @@ -503,19 +516,21 @@ ccr_hmac(struct ccr_softc *sc, struct ccr_session *s, V_SCMD_PROTO_VERSION(CHCR_SCMD_PROTO_VERSION_GENERIC) | V_SCMD_CIPH_MODE(CHCR_SCMD_CIPHER_MODE_NOP) | V_SCMD_AUTH_MODE(s->hmac.auth_mode) | - V_SCMD_HMAC_CTRL(CHCR_SCMD_HMAC_CTRL_NO_TRUNC)); + V_SCMD_HMAC_CTRL(hmac_ctrl)); crwr->sec_cpl.ivgen_hdrlen = htobe32( V_SCMD_LAST_FRAG(0) | V_SCMD_MORE_FRAGS(crd->crd_len == 0 ? 1 : 0) | V_SCMD_MAC_ONLY(1)); memcpy(crwr->key_ctx.key, s->hmac.ipad, s->hmac.partial_digest_len); - memcpy(crwr->key_ctx.key + iopad_size, s->hmac.opad, - s->hmac.partial_digest_len); + if (use_opad) + memcpy(crwr->key_ctx.key + iopad_size, s->hmac.opad, + s->hmac.partial_digest_len); /* XXX: F_KEY_CONTEXT_SALT_PRESENT set, but 'salt' not set. */ kctx_flits = (sizeof(struct _key_ctx) + kctx_len) / 16; crwr->key_ctx.ctx_hdr = htobe32(V_KEY_CONTEXT_CTX_LEN(kctx_flits) | - V_KEY_CONTEXT_OPAD_PRESENT(1) | V_KEY_CONTEXT_SALT_PRESENT(1) | + V_KEY_CONTEXT_OPAD_PRESENT(use_opad) | + V_KEY_CONTEXT_SALT_PRESENT(1) | V_KEY_CONTEXT_CK_SIZE(CHCR_KEYCTX_NO_KEY) | V_KEY_CONTEXT_MK_SIZE(s->hmac.mk_size) | V_KEY_CONTEXT_VALID(1)); @@ -537,7 +552,7 @@ ccr_hmac(struct ccr_softc *sc, struct ccr_session *s, } static int -ccr_hmac_done(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, +ccr_hash_done(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, const struct cpl_fw6_pld *cpl, int error) { struct cryptodesc *crd; @@ -1591,6 +1606,8 @@ ccr_sysctls(struct ccr_softc *sc) NULL, "statistics"); children = SYSCTL_CHILDREN(oid); + SYSCTL_ADD_U64(ctx, children, OID_AUTO, "hash", CTLFLAG_RD, + &sc->stats_hash, 0, "Hash requests submitted"); SYSCTL_ADD_U64(ctx, children, OID_AUTO, "hmac", CTLFLAG_RD, &sc->stats_hmac, 0, "HMAC requests submitted"); SYSCTL_ADD_U64(ctx, children, OID_AUTO, "cipher_encrypt", CTLFLAG_RD, @@ -1666,6 +1683,11 @@ ccr_attach(device_t dev) sc->sg_iv_aad = sglist_build(sc->iv_aad_buf, MAX_AAD_LEN, M_WAITOK); ccr_sysctls(sc); + crypto_register(cid, CRYPTO_SHA1, 0, 0); + crypto_register(cid, CRYPTO_SHA2_224, 0, 0); + crypto_register(cid, CRYPTO_SHA2_256, 0, 0); + crypto_register(cid, CRYPTO_SHA2_384, 0, 0); + crypto_register(cid, CRYPTO_SHA2_512, 0, 0); crypto_register(cid, CRYPTO_SHA1_HMAC, 0, 0); crypto_register(cid, CRYPTO_SHA2_224_HMAC, 0, 0); crypto_register(cid, CRYPTO_SHA2_256_HMAC, 0, 0); @@ -1714,22 +1736,27 @@ ccr_copy_partial_hash(void *dst, int cri_alg, union au u32 = (uint32_t *)dst; u64 = (uint64_t *)dst; switch (cri_alg) { + case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: for (i = 0; i < SHA1_HASH_LEN / 4; i++) u32[i] = htobe32(auth_ctx->sha1ctx.h.b32[i]); break; + case CRYPTO_SHA2_224: case CRYPTO_SHA2_224_HMAC: for (i = 0; i < SHA2_256_HASH_LEN / 4; i++) u32[i] = htobe32(auth_ctx->sha224ctx.state[i]); break; + case CRYPTO_SHA2_256: case CRYPTO_SHA2_256_HMAC: for (i = 0; i < SHA2_256_HASH_LEN / 4; i++) u32[i] = htobe32(auth_ctx->sha256ctx.state[i]); break; + case CRYPTO_SHA2_384: case CRYPTO_SHA2_384_HMAC: for (i = 0; i < SHA2_512_HASH_LEN / 8; i++) u64[i] = htobe64(auth_ctx->sha384ctx.state[i]); break; + case CRYPTO_SHA2_512: case CRYPTO_SHA2_512_HMAC: for (i = 0; i < SHA2_512_HASH_LEN / 8; i++) u64[i] = htobe64(auth_ctx->sha512ctx.state[i]); @@ -1738,6 +1765,17 @@ ccr_copy_partial_hash(void *dst, int cri_alg, union au } static void +ccr_init_hash_digest(struct ccr_session *s, int cri_alg) +{ + union authctx auth_ctx; + struct auth_hash *axf; + + axf = s->hmac.auth_hash; + axf->Init(&auth_ctx); + ccr_copy_partial_hash(s->hmac.ipad, cri_alg, &auth_ctx); +} + +static void ccr_init_hmac_digest(struct ccr_session *s, int cri_alg, char *key, int klen) { @@ -1885,12 +1923,13 @@ ccr_newsession(device_t dev, crypto_session_t cses, st unsigned int auth_mode, cipher_mode, iv_len, mk_size; unsigned int partial_digest_len; int error; - bool gcm_hash; + bool gcm_hash, hmac; if (cri == NULL) return (EINVAL); gcm_hash = false; + hmac = false; cipher = NULL; hash = NULL; auth_hash = NULL; @@ -1901,6 +1940,11 @@ ccr_newsession(device_t dev, crypto_session_t cses, st partial_digest_len = 0; for (c = cri; c != NULL; c = c->cri_next) { switch (c->cri_alg) { + case CRYPTO_SHA1: + case CRYPTO_SHA2_224: + case CRYPTO_SHA2_256: + case CRYPTO_SHA2_384: + case CRYPTO_SHA2_512: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224_HMAC: case CRYPTO_SHA2_256_HMAC: @@ -1913,30 +1957,35 @@ ccr_newsession(device_t dev, crypto_session_t cses, st return (EINVAL); hash = c; switch (c->cri_alg) { + case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: auth_hash = &auth_hash_hmac_sha1; auth_mode = CHCR_SCMD_AUTH_MODE_SHA1; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_160; partial_digest_len = SHA1_HASH_LEN; break; + case CRYPTO_SHA2_224: case CRYPTO_SHA2_224_HMAC: auth_hash = &auth_hash_hmac_sha2_224; auth_mode = CHCR_SCMD_AUTH_MODE_SHA224; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_256; partial_digest_len = SHA2_256_HASH_LEN; break; + case CRYPTO_SHA2_256: case CRYPTO_SHA2_256_HMAC: auth_hash = &auth_hash_hmac_sha2_256; auth_mode = CHCR_SCMD_AUTH_MODE_SHA256; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_256; partial_digest_len = SHA2_256_HASH_LEN; break; + case CRYPTO_SHA2_384: case CRYPTO_SHA2_384_HMAC: auth_hash = &auth_hash_hmac_sha2_384; auth_mode = CHCR_SCMD_AUTH_MODE_SHA512_384; mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_512; partial_digest_len = SHA2_512_HASH_LEN; break; + case CRYPTO_SHA2_512: case CRYPTO_SHA2_512_HMAC: auth_hash = &auth_hash_hmac_sha2_512; auth_mode = CHCR_SCMD_AUTH_MODE_SHA512_512; @@ -1951,6 +2000,15 @@ ccr_newsession(device_t dev, crypto_session_t cses, st mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_128; break; } + switch (c->cri_alg) { + case CRYPTO_SHA1_HMAC: + case CRYPTO_SHA2_224_HMAC: + case CRYPTO_SHA2_256_HMAC: + case CRYPTO_SHA2_384_HMAC: + case CRYPTO_SHA2_512_HMAC: + hmac = true; + break; + } break; case CRYPTO_AES_CBC: case CRYPTO_AES_ICM: @@ -1992,8 +2050,12 @@ ccr_newsession(device_t dev, crypto_session_t cses, st return (EINVAL); if (hash == NULL && cipher == NULL) return (EINVAL); - if (hash != NULL && hash->cri_key == NULL) - return (EINVAL); + if (hash != NULL) { + if ((hmac || gcm_hash) && hash->cri_key == NULL) + return (EINVAL); + if (!(hmac || gcm_hash) && hash->cri_key != NULL) + return (EINVAL); + } sc = device_get_softc(dev); mtx_lock(&sc->lock); @@ -2008,9 +2070,12 @@ ccr_newsession(device_t dev, crypto_session_t cses, st s->mode = GCM; else if (hash != NULL && cipher != NULL) s->mode = AUTHENC; - else if (hash != NULL) - s->mode = HMAC; - else { + else if (hash != NULL) { + if (hmac) + s->mode = HMAC; + else + s->mode = HASH; + } else { MPASS(cipher != NULL); s->mode = BLKCIPHER; } @@ -2029,8 +2094,11 @@ ccr_newsession(device_t dev, crypto_session_t cses, st s->hmac.hash_len = auth_hash->hashsize; else s->hmac.hash_len = hash->cri_mlen; - ccr_init_hmac_digest(s, hash->cri_alg, hash->cri_key, - hash->cri_klen); + if (hmac) + ccr_init_hmac_digest(s, hash->cri_alg, hash->cri_key, + hash->cri_klen); + else + ccr_init_hash_digest(s, hash->cri_alg); } if (cipher != NULL) { s->blkcipher.cipher_mode = cipher_mode; @@ -2085,11 +2153,16 @@ ccr_process(device_t dev, struct cryptop *crp, int hin } switch (s->mode) { + case HASH: + error = ccr_hash(sc, s, crp); + if (error == 0) + sc->stats_hash++; + break; case HMAC: if (crd->crd_flags & CRD_F_KEY_EXPLICIT) ccr_init_hmac_digest(s, crd->crd_alg, crd->crd_key, crd->crd_klen); - error = ccr_hmac(sc, s, crp); + error = ccr_hash(sc, s, crp); if (error == 0) sc->stats_hmac++; break; @@ -2240,8 +2313,9 @@ do_cpl6_fw_pld(struct sge_iq *iq, const struct rss_hea sc->stats_inflight--; switch (s->mode) { + case HASH: case HMAC: - error = ccr_hmac_done(sc, s, crp, cpl, error); + error = ccr_hash_done(sc, s, crp, cpl, error); break; case BLKCIPHER: error = ccr_blkcipher_done(sc, s, crp, cpl, error); From owner-svn-src-all@freebsd.org Thu Jan 3 22:49:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF6B6143A166; Thu, 3 Jan 2019 22:49:12 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 705C46D17C; Thu, 3 Jan 2019 22:49:12 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5B4C27D89; Thu, 3 Jan 2019 22:49:11 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03MnBa8050421; Thu, 3 Jan 2019 22:49:11 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03MnBtG050420; Thu, 3 Jan 2019 22:49:11 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201901032249.x03MnBtG050420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 3 Jan 2019 22:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342747 - head/sys/cddl/boot/zfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/cddl/boot/zfs X-SVN-Commit-Revision: 342747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 705C46D17C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 22:49:13 -0000 Author: mmacy Date: Thu Jan 3 22:49:11 2019 New Revision: 342747 URL: https://svnweb.freebsd.org/changeset/base/342747 Log: zfsboot: support newer ZFS versions declare v3 objset size/layout to fix userboot and possibly other loader issues - fix for userboot assertion failure in zfs_dev_close in free due to out of bounds write - fix for zfs_alloc / zfs_free mismatch assertion failure when booting GPT on BIOS Modified: head/sys/cddl/boot/zfs/zfsimpl.h Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Thu Jan 3 22:48:59 2019 (r342746) +++ head/sys/cddl/boot/zfs/zfsimpl.h Thu Jan 3 22:49:11 2019 (r342747) @@ -1121,6 +1121,8 @@ typedef struct sa_hdr_phys { #define SA_PARENT_OFFSET 40 #define SA_SYMLINK_OFFSET 160 +#define ZIO_OBJSET_MAC_LEN 32 + /* * Intent log header - this on disk structure holds fields to manage * the log. All fields are 64 bit to easily handle cross architectures. @@ -1133,17 +1135,24 @@ typedef struct zil_header { uint64_t zh_pad[5]; } zil_header_t; -#define OBJSET_PHYS_SIZE 2048 +#define OBJSET_PHYS_SIZE_V2 2048 +#define OBJSET_PHYS_SIZE_V3 4096 typedef struct objset_phys { dnode_phys_t os_meta_dnode; zil_header_t os_zil_header; uint64_t os_type; uint64_t os_flags; - char os_pad[OBJSET_PHYS_SIZE - sizeof (dnode_phys_t)*3 - - sizeof (zil_header_t) - sizeof (uint64_t)*2]; + uint8_t os_portable_mac[ZIO_OBJSET_MAC_LEN]; + uint8_t os_local_mac[ZIO_OBJSET_MAC_LEN]; + char os_pad0[OBJSET_PHYS_SIZE_V2 - sizeof (dnode_phys_t)*3 - + sizeof (zil_header_t) - sizeof (uint64_t)*2 - + 2*ZIO_OBJSET_MAC_LEN]; dnode_phys_t os_userused_dnode; dnode_phys_t os_groupused_dnode; + dnode_phys_t os_projectused_dnode; + char os_pad1[OBJSET_PHYS_SIZE_V3 - OBJSET_PHYS_SIZE_V2 - + sizeof (dnode_phys_t)]; } objset_phys_t; typedef struct dsl_dir_phys { From owner-svn-src-all@freebsd.org Thu Jan 3 22:51:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C621143A3D6; Thu, 3 Jan 2019 22:51:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E70186D3F7; Thu, 3 Jan 2019 22:51:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB6AF27DBD; Thu, 3 Jan 2019 22:51:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03MpE5r052844; Thu, 3 Jan 2019 22:51:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03MpE3d052843; Thu, 3 Jan 2019 22:51:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901032251.x03MpE3d052843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 3 Jan 2019 22:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342748 - stable/12/tools/tools/crypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/tools/tools/crypto X-SVN-Commit-Revision: 342748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E70186D3F7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 03 Jan 2019 22:51:15 -0000 Author: jhb Date: Thu Jan 3 22:51:14 2019 New Revision: 342748 URL: https://svnweb.freebsd.org/changeset/base/342748 Log: MFC 340018: Compile cryptocheck with in-tree openssl again. Modified: stable/12/tools/tools/crypto/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/tools/crypto/Makefile ============================================================================== --- stable/12/tools/tools/crypto/Makefile Thu Jan 3 22:49:11 2019 (r342747) +++ stable/12/tools/tools/crypto/Makefile Thu Jan 3 22:51:14 2019 (r342748) @@ -32,10 +32,7 @@ MAN= BINDIR?= /usr/local/bin # cryptocheck: test symmetric crypto functions -# Use openssl from ports for Blake2 algorithms -CFLAGS.cryptocheck.c+= $$(pkg-config --cflags openssl) -LDFLAGS.cryptocheck+= $$(pkg-config --libs openssl) -LIBADD.cryptocheck+= util +LIBADD.cryptocheck+= crypto util # cryptokeytest: test asymmetric crypto functions LIBADD.cryptokeytest+= crypto From owner-svn-src-all@freebsd.org Thu Jan 3 23:06:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E663A143AA62; Thu, 3 Jan 2019 23:06:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 510446DE96; Thu, 3 Jan 2019 23:06:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AEEF280E1; Thu, 3 Jan 2019 23:06:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03N65MQ060674; Thu, 3 Jan 2019 23:06:05 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03N65bN060673; Thu, 3 Jan 2019 23:06:05 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201901032306.x03N65bN060673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 3 Jan 2019 23:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342749 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 342749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 510446DE96 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 23:06:07 -0000 Author: mmacy Date: Thu Jan 3 23:06:05 2019 New Revision: 342749 URL: https://svnweb.freebsd.org/changeset/base/342749 Log: mp_ring: avoid items offset difference between iflib and mp_ring on architectures without 64-bit atomics Reported by: Augustin Cavalier Modified: head/sys/net/mp_ring.c head/sys/net/mp_ring.h Modified: head/sys/net/mp_ring.c ============================================================================== --- head/sys/net/mp_ring.c Thu Jan 3 22:51:14 2019 (r342748) +++ head/sys/net/mp_ring.c Thu Jan 3 23:06:05 2019 (r342749) @@ -37,10 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__powerpc__) || defined(__mips__) || defined(__i386__) -#define NO_64BIT_ATOMICS -#endif - #if defined(__i386__) #define atomic_cmpset_acq_64 atomic_cmpset_64 #define atomic_cmpset_rel_64 atomic_cmpset_64 @@ -101,7 +97,7 @@ state_to_flags(union ring_state s, int abdicate) return (BUSY); } -#ifdef NO_64BIT_ATOMICS +#ifdef MP_RING_NO_64BIT_ATOMICS static void drain_ring_locked(struct ifmp_ring *r, union ring_state os, uint16_t prev, int budget) { @@ -291,7 +287,7 @@ ifmp_ring_alloc(struct ifmp_ring **pr, int size, void } *pr = r; -#ifdef NO_64BIT_ATOMICS +#ifdef MP_RING_NO_64BIT_ATOMICS mtx_init(&r->lock, "mp_ring lock", NULL, MTX_DEF); #endif return (0); @@ -325,7 +321,7 @@ ifmp_ring_free(struct ifmp_ring *r) * * Returns an errno. */ -#ifdef NO_64BIT_ATOMICS +#ifdef MP_RING_NO_64BIT_ATOMICS int ifmp_ring_enqueue(struct ifmp_ring *r, void **items, int n, int budget, int abdicate) { @@ -503,7 +499,7 @@ ifmp_ring_check_drainage(struct ifmp_ring *r, int budg ns.flags = BUSY; -#ifdef NO_64BIT_ATOMICS +#ifdef MP_RING_NO_64BIT_ATOMICS mtx_lock(&r->lock); if (r->state != os.state) { mtx_unlock(&r->lock); Modified: head/sys/net/mp_ring.h ============================================================================== --- head/sys/net/mp_ring.h Thu Jan 3 22:51:14 2019 (r342748) +++ head/sys/net/mp_ring.h Thu Jan 3 23:06:05 2019 (r342749) @@ -40,6 +40,10 @@ typedef u_int (*mp_ring_drain_t)(struct ifmp_ring *, u typedef u_int (*mp_ring_can_drain_t)(struct ifmp_ring *); typedef void (*mp_ring_serial_t)(struct ifmp_ring *); +#if defined(__powerpc__) || defined(__mips__) || defined(__i386__) +#define MP_RING_NO_64BIT_ATOMICS +#endif + struct ifmp_ring { volatile uint64_t state __aligned(CACHE_LINE_SIZE); @@ -54,7 +58,7 @@ struct ifmp_ring { counter_u64_t stalls; counter_u64_t restarts; /* recovered after stalling */ counter_u64_t abdications; -#ifdef NO_64BIT_ATOMICS +#ifdef MP_RING_NO_64BIT_ATOMICS struct mtx lock; #endif void * volatile items[] __aligned(CACHE_LINE_SIZE); From owner-svn-src-all@freebsd.org Fri Jan 4 00:06:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B11EA143C097; Fri, 4 Jan 2019 00:06:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51DCE6FCCA; Fri, 4 Jan 2019 00:06:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 322A328B08; Fri, 4 Jan 2019 00:06:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0406VJu092921; Fri, 4 Jan 2019 00:06:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0406VvF092920; Fri, 4 Jan 2019 00:06:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901040006.x0406VvF092920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 4 Jan 2019 00:06: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: r342750 - in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Commit-Revision: 342750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51DCE6FCCA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 04 Jan 2019 00:06:31 -0000 Author: jhb Date: Fri Jan 4 00:06:30 2019 New Revision: 342750 URL: https://svnweb.freebsd.org/changeset/base/342750 Log: MFC 340021: Assert that reclaim_tx_descs() is always making forward progress. Modified: stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Thu Jan 3 23:06:05 2019 (r342749) +++ stable/11/sys/dev/cxgbe/t4_sge.c Fri Jan 4 00:06:30 2019 (r342750) @@ -4694,6 +4694,9 @@ reclaim_tx_descs(struct sge_txq *txq, u_int n) KASSERT(can_reclaim >= ndesc, ("%s: unexpected number of credits: %d, %d", __func__, can_reclaim, ndesc)); + KASSERT(ndesc != 0, + ("%s: descriptor with no credits: cidx %d", + __func__, eq->cidx)); for (m = txsd->m; m != NULL; m = nextpkt) { nextpkt = m->m_nextpkt; From owner-svn-src-all@freebsd.org Fri Jan 4 00:06:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6168B143C091; Fri, 4 Jan 2019 00:06:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1A636FCC9; Fri, 4 Jan 2019 00:06:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7B3228B07; Fri, 4 Jan 2019 00:06:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0406UoW092915; Fri, 4 Jan 2019 00:06:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0406UMo092914; Fri, 4 Jan 2019 00:06:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901040006.x0406UMo092914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 4 Jan 2019 00:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342750 - in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Commit-Revision: 342750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F1A636FCC9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Jan 2019 00:06:31 -0000 Author: jhb Date: Fri Jan 4 00:06:30 2019 New Revision: 342750 URL: https://svnweb.freebsd.org/changeset/base/342750 Log: MFC 340021: Assert that reclaim_tx_descs() is always making forward progress. Modified: stable/12/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_sge.c Thu Jan 3 23:06:05 2019 (r342749) +++ stable/12/sys/dev/cxgbe/t4_sge.c Fri Jan 4 00:06:30 2019 (r342750) @@ -5079,6 +5079,9 @@ reclaim_tx_descs(struct sge_txq *txq, u_int n) KASSERT(can_reclaim >= ndesc, ("%s: unexpected number of credits: %d, %d", __func__, can_reclaim, ndesc)); + KASSERT(ndesc != 0, + ("%s: descriptor with no credits: cidx %d", + __func__, eq->cidx)); for (m = txsd->m; m != NULL; m = nextpkt) { nextpkt = m->m_nextpkt; From owner-svn-src-all@freebsd.org Fri Jan 4 01:19:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D729143DA6B; Fri, 4 Jan 2019 01:19:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1268471B6F; Fri, 4 Jan 2019 01:19:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02677296AD; Fri, 4 Jan 2019 01:19:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x041JNhv030395; Fri, 4 Jan 2019 01:19:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x041JNh5030394; Fri, 4 Jan 2019 01:19:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901040119.x041JNh5030394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 4 Jan 2019 01:19: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: r342751 - in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Commit-Revision: 342751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1268471B6F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 04 Jan 2019 01:19:24 -0000 Author: jhb Date: Fri Jan 4 01:19:23 2019 New Revision: 342751 URL: https://svnweb.freebsd.org/changeset/base/342751 Log: MFC 340022: Add support for port unit wiring to cxgbe(4). - Add a bus_child_location_str method to the nexus drivers that prints out 'port=N' as the location string exported via devinfo and the '%location' sysctl node. - We can't use a bus_hint_device_unit to wire the unit numbers of devices with a fixed devclass as the device gets assigned a unit in make_device() before the device creator can set softc, etc. Instead, when adding a child device, use a helper function much like a bus_hint_device_unit method to look for wiring hints or to return -1 to let the system choose a unit number. This function requires an "at" hint for the port pointing to the nexus device and a "port" hint listing the port number. For example: hint.cxl.4.at="t5nex0" hint.cxl.4.port="0" wires cxl4 to the first port on the t5nex0 adapter. Modified: stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Fri Jan 4 00:06:30 2019 (r342750) +++ stable/12/sys/dev/cxgbe/t4_main.c Fri Jan 4 01:19:23 2019 (r342751) @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); static int t4_probe(device_t); static int t4_attach(device_t); static int t4_detach(device_t); +static int t4_child_location_str(device_t, device_t, char *, size_t); static int t4_ready(device_t); static int t4_read_port_device(device_t, int, device_t *); static device_method_t t4_methods[] = { @@ -97,6 +98,8 @@ static device_method_t t4_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -156,6 +159,8 @@ static device_method_t t5_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -189,6 +194,8 @@ static device_method_t t6_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -835,6 +842,24 @@ t4_init_devnames(struct adapter *sc) } static int +t4_ifnet_unit(struct adapter *sc, struct port_info *pi) +{ + const char *parent, *name; + long value; + int line, unit; + + line = 0; + parent = device_get_nameunit(sc->dev); + name = sc->names->ifnet_name; + while (resource_find_dev(&line, name, &unit, "at", parent) == 0) { + if (resource_long_value(name, unit, "port", &value) == 0 && + value == pi->port_id) + return (unit); + } + return (-1); +} + +static int t4_attach(device_t dev) { struct adapter *sc; @@ -1035,7 +1060,8 @@ t4_attach(device_t dev) pi->flags |= FIXED_IFMEDIA; PORT_UNLOCK(pi); - pi->dev = device_add_child(dev, sc->names->ifnet_name, -1); + pi->dev = device_add_child(dev, sc->names->ifnet_name, + t4_ifnet_unit(sc, pi)); if (pi->dev == NULL) { device_printf(dev, "failed to add device for port %d.\n", i); @@ -1248,6 +1274,16 @@ done: t4_sysctls(sc); return (rc); +} + +static int +t4_child_location_str(device_t bus, device_t dev, char *buf, size_t buflen) +{ + struct port_info *pi; + + pi = device_get_softc(dev); + snprintf(buf, buflen, "port=%d", pi->port_id); + return (0); } static int From owner-svn-src-all@freebsd.org Fri Jan 4 01:19:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8139143DA6F; Fri, 4 Jan 2019 01:19:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9B771B70; Fri, 4 Jan 2019 01:19:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54374296AE; Fri, 4 Jan 2019 01:19:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x041JOkr030401; Fri, 4 Jan 2019 01:19:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x041JOkU030400; Fri, 4 Jan 2019 01:19:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901040119.x041JOkU030400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 4 Jan 2019 01:19: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: r342751 - in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/cxgbe 12/sys/dev/cxgbe X-SVN-Commit-Revision: 342751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F9B771B70 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 04 Jan 2019 01:19:25 -0000 Author: jhb Date: Fri Jan 4 01:19:23 2019 New Revision: 342751 URL: https://svnweb.freebsd.org/changeset/base/342751 Log: MFC 340022: Add support for port unit wiring to cxgbe(4). - Add a bus_child_location_str method to the nexus drivers that prints out 'port=N' as the location string exported via devinfo and the '%location' sysctl node. - We can't use a bus_hint_device_unit to wire the unit numbers of devices with a fixed devclass as the device gets assigned a unit in make_device() before the device creator can set softc, etc. Instead, when adding a child device, use a helper function much like a bus_hint_device_unit method to look for wiring hints or to return -1 to let the system choose a unit number. This function requires an "at" hint for the port pointing to the nexus device and a "port" hint listing the port number. For example: hint.cxl.4.at="t5nex0" hint.cxl.4.port="0" wires cxl4 to the first port on the t5nex0 adapter. Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Fri Jan 4 00:06:30 2019 (r342750) +++ stable/11/sys/dev/cxgbe/t4_main.c Fri Jan 4 01:19:23 2019 (r342751) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); static int t4_probe(device_t); static int t4_attach(device_t); static int t4_detach(device_t); +static int t4_child_location_str(device_t, device_t, char *, size_t); static int t4_ready(device_t); static int t4_read_port_device(device_t, int, device_t *); static device_method_t t4_methods[] = { @@ -92,6 +93,8 @@ static device_method_t t4_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -151,6 +154,8 @@ static device_method_t t5_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -184,6 +189,8 @@ static device_method_t t6_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(bus_child_location_str, t4_child_location_str), + DEVMETHOD(t4_is_main_ready, t4_ready), DEVMETHOD(t4_read_port_device, t4_read_port_device), @@ -846,6 +853,24 @@ t4_init_devnames(struct adapter *sc) } static int +t4_ifnet_unit(struct adapter *sc, struct port_info *pi) +{ + const char *parent, *name; + long value; + int line, unit; + + line = 0; + parent = device_get_nameunit(sc->dev); + name = sc->names->ifnet_name; + while (resource_find_dev(&line, name, &unit, "at", parent) == 0) { + if (resource_long_value(name, unit, "port", &value) == 0 && + value == pi->port_id) + return (unit); + } + return (-1); +} + +static int t4_attach(device_t dev) { struct adapter *sc; @@ -1040,7 +1065,8 @@ t4_attach(device_t dev) pi->flags |= FIXED_IFMEDIA; PORT_UNLOCK(pi); - pi->dev = device_add_child(dev, sc->names->ifnet_name, -1); + pi->dev = device_add_child(dev, sc->names->ifnet_name, + t4_ifnet_unit(sc, pi)); if (pi->dev == NULL) { device_printf(dev, "failed to add device for port %d.\n", i); @@ -1238,6 +1264,16 @@ done: t4_sysctls(sc); return (rc); +} + +static int +t4_child_location_str(device_t bus, device_t dev, char *buf, size_t buflen) +{ + struct port_info *pi; + + pi = device_get_softc(dev); + snprintf(buf, buflen, "port=%d", pi->port_id); + return (0); } static int From owner-svn-src-all@freebsd.org Fri Jan 4 02:20:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC9EA143F0C9; Fri, 4 Jan 2019 02:20:35 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66AED739F0; Fri, 4 Jan 2019 02:20:35 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4005F2A0BD; Fri, 4 Jan 2019 02:20:35 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x042KZ4P062439; Fri, 4 Jan 2019 02:20:35 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x042KYo5062437; Fri, 4 Jan 2019 02:20:34 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201901040220.x042KYo5062437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 4 Jan 2019 02:20: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: r342752 - stable/11/sys/dev/asmc X-SVN-Group: stable-11 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/11/sys/dev/asmc X-SVN-Commit-Revision: 342752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 66AED739F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 04 Jan 2019 02:20:36 -0000 Author: dab Date: Fri Jan 4 02:20:34 2019 New Revision: 342752 URL: https://svnweb.freebsd.org/changeset/base/342752 Log: MFC r342171: asmc: Add support for mid-2011 Macmini 5,2 PR: 225911 Submitted by: trev Reported by: trev Modified: stable/11/sys/dev/asmc/asmc.c stable/11/sys/dev/asmc/asmcvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/asmc/asmc.c ============================================================================== --- stable/11/sys/dev/asmc/asmc.c Fri Jan 4 01:19:23 2019 (r342751) +++ stable/11/sys/dev/asmc/asmc.c Fri Jan 4 02:20:34 2019 (r342752) @@ -263,6 +263,15 @@ struct asmc_model asmc_models[] = { ASMC_MM31_TEMPS, ASMC_MM31_TEMPNAMES, ASMC_MM31_TEMPDESCS }, + /* The Mac Mini 5,2 has no SMS */ + { + "Macmini5,2", "Apple SMC Mac Mini 5,2", + NULL, NULL, NULL, + ASMC_FAN_FUNCS2, + NULL, NULL, NULL, + ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS + }, + /* Idem for the MacPro */ { "MacPro2", "Apple SMC Mac Pro (8-core)", Modified: stable/11/sys/dev/asmc/asmcvar.h ============================================================================== --- stable/11/sys/dev/asmc/asmcvar.h Fri Jan 4 01:19:23 2019 (r342751) +++ stable/11/sys/dev/asmc/asmcvar.h Fri Jan 4 02:20:34 2019 (r342752) @@ -337,6 +337,41 @@ struct asmc_softc { "Northbridge Proximity Temperature", \ "Wireless Module Proximity Temperature", } +#define ASMC_MM52_TEMPS { "TA0P", "TA1P", \ + "TC0D", "TC0P", \ + "TG0D", "TG1D", \ + "TG0P", "TG0M", \ + "TI0P", \ + "TM0S", "TMBS", \ + "TM0P", "TP0P", \ + "TPCD", "Tp0C", \ + "TW0P", NULL } + +#define ASMC_MM52_TEMPNAMES { "ambient_air_proximity", "ambient_cpu_pch_wireless_dimm", \ + "cpu_die", "cpu_proximity", \ + "gpu_diode1", "gpu_diode2", \ + "gpu_proximity", "gpu_integrated_switcher", \ + "thunderbolt_proximity", \ + "memory_slot1", "memory_slot2", \ + "memory_proximity", "pch_controller_proximity", \ + "pch_controller_die", "pwr_supply", \ + "wireless_proximity", } + +#define ASMC_MM52_TEMPDESCS { "Ambient Air Proximity Temperature", \ + "Combo Ambient CPU PCH Wireless DIMM Temperature", \ + "CPU Die Temperature", "CPU Proximity Temperature", \ + "GPU Diode 1 Temperature" , "GPU Diode 2 Temperature", \ + "GPU Proximity Temperature", \ + "Integrated Graphics/GPU Switcher Temperature", \ + "Thunderbolt Proximity Temperature", \ + "Memory Slot 1 Temperature", \ + "Memory Slot 2 Temperature", \ + "Memory Slots Proximity Temperature", \ + "Platform Controller Hub Proximity Temperature", \ + "Platform Controller Hub Die Temperature", \ + "Power Supply Temperature", \ + "Wireless Module Proximity Temperature", } + #define ASMC_MP_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ From owner-svn-src-all@freebsd.org Fri Jan 4 02:21:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 092B8143F11C; Fri, 4 Jan 2019 02:21:02 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9922373B4B; Fri, 4 Jan 2019 02:21:01 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7231F2A0DF; Fri, 4 Jan 2019 02:21:01 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x042L1Ul062523; Fri, 4 Jan 2019 02:21:01 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x042L1kG062522; Fri, 4 Jan 2019 02:21:01 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201901040221.x042L1kG062522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 4 Jan 2019 02:21: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: r342753 - stable/12/sys/dev/asmc X-SVN-Group: stable-12 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/12/sys/dev/asmc X-SVN-Commit-Revision: 342753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9922373B4B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 04 Jan 2019 02:21:02 -0000 Author: dab Date: Fri Jan 4 02:21:00 2019 New Revision: 342753 URL: https://svnweb.freebsd.org/changeset/base/342753 Log: MFC r342171: asmc: Add support for mid-2011 Macmini 5,2 PR: 225911 Submitted by: trev Reported by: trev Modified: stable/12/sys/dev/asmc/asmc.c stable/12/sys/dev/asmc/asmcvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/asmc/asmc.c ============================================================================== --- stable/12/sys/dev/asmc/asmc.c Fri Jan 4 02:20:34 2019 (r342752) +++ stable/12/sys/dev/asmc/asmc.c Fri Jan 4 02:21:00 2019 (r342753) @@ -260,6 +260,15 @@ struct asmc_model asmc_models[] = { ASMC_MM31_TEMPS, ASMC_MM31_TEMPNAMES, ASMC_MM31_TEMPDESCS }, + /* The Mac Mini 5,2 has no SMS */ + { + "Macmini5,2", "Apple SMC Mac Mini 5,2", + NULL, NULL, NULL, + ASMC_FAN_FUNCS2, + NULL, NULL, NULL, + ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS + }, + /* Idem for the MacPro */ { "MacPro2", "Apple SMC Mac Pro (8-core)", Modified: stable/12/sys/dev/asmc/asmcvar.h ============================================================================== --- stable/12/sys/dev/asmc/asmcvar.h Fri Jan 4 02:20:34 2019 (r342752) +++ stable/12/sys/dev/asmc/asmcvar.h Fri Jan 4 02:21:00 2019 (r342753) @@ -339,6 +339,41 @@ struct asmc_softc { "Northbridge Proximity Temperature", \ "Wireless Module Proximity Temperature", } +#define ASMC_MM52_TEMPS { "TA0P", "TA1P", \ + "TC0D", "TC0P", \ + "TG0D", "TG1D", \ + "TG0P", "TG0M", \ + "TI0P", \ + "TM0S", "TMBS", \ + "TM0P", "TP0P", \ + "TPCD", "Tp0C", \ + "TW0P", NULL } + +#define ASMC_MM52_TEMPNAMES { "ambient_air_proximity", "ambient_cpu_pch_wireless_dimm", \ + "cpu_die", "cpu_proximity", \ + "gpu_diode1", "gpu_diode2", \ + "gpu_proximity", "gpu_integrated_switcher", \ + "thunderbolt_proximity", \ + "memory_slot1", "memory_slot2", \ + "memory_proximity", "pch_controller_proximity", \ + "pch_controller_die", "pwr_supply", \ + "wireless_proximity", } + +#define ASMC_MM52_TEMPDESCS { "Ambient Air Proximity Temperature", \ + "Combo Ambient CPU PCH Wireless DIMM Temperature", \ + "CPU Die Temperature", "CPU Proximity Temperature", \ + "GPU Diode 1 Temperature" , "GPU Diode 2 Temperature", \ + "GPU Proximity Temperature", \ + "Integrated Graphics/GPU Switcher Temperature", \ + "Thunderbolt Proximity Temperature", \ + "Memory Slot 1 Temperature", \ + "Memory Slot 2 Temperature", \ + "Memory Slots Proximity Temperature", \ + "Platform Controller Hub Proximity Temperature", \ + "Platform Controller Hub Die Temperature", \ + "Power Supply Temperature", \ + "Wireless Module Proximity Temperature", } + #define ASMC_MP_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ From owner-svn-src-all@freebsd.org Fri Jan 4 02:48:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CAAD143FDC0; Fri, 4 Jan 2019 02:48:44 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF67474EFF; Fri, 4 Jan 2019 02:48:43 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA7862A5A6; Fri, 4 Jan 2019 02:48:43 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x042mhql078285; Fri, 4 Jan 2019 02:48:43 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x042mhOV078284; Fri, 4 Jan 2019 02:48:43 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201901040248.x042mhOV078284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 4 Jan 2019 02:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342754 - head/usr.bin/lam X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/usr.bin/lam X-SVN-Commit-Revision: 342754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF67474EFF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 04 Jan 2019 02:48:44 -0000 Author: allanjude Date: Fri Jan 4 02:48:43 2019 New Revision: 342754 URL: https://svnweb.freebsd.org/changeset/base/342754 Log: The lam(1) man page is unclear about the uppercase versions of the flags PR: 229571 Submitted by: Tim Chase Modified: head/usr.bin/lam/lam.1 Modified: head/usr.bin/lam/lam.1 ============================================================================== --- head/usr.bin/lam/lam.1 Fri Jan 4 02:21:00 2019 (r342753) +++ head/usr.bin/lam/lam.1 Fri Jan 4 02:48:43 2019 (r342754) @@ -58,14 +58,8 @@ are considered fragments of the single long output line into which they are assembled. The name `\fB\-\fP' means the standard input, and may be repeated. .Pp -Normally, each option affects only the -.Ar file -after it. -If the option letter is capitalized it affects all subsequent files -until it appears again uncapitalized. -The options are described below: .Bl -tag -width indent -.It Fl f Ar min . Ns Ar max +.It Fl f Ar min . Ns Ar max , Fl F Ar min . Ns Ar max Print line fragments according to the format string .Ar min . Ns Ar max , where @@ -78,21 +72,41 @@ If begins with a zero, zeros will be added to make up the field width, and if it begins with a `\-', the fragment will be left-adjusted within the field. -.It Fl p Ar min . Ns Ar max +Using +.Fl f +applies only to the next file while +.Fl F +applies to all subsequent files until it appears again uncapitalized. +.It Fl p Ar min . Ns Ar max , Fl P Ar min . Ns Ar max Like .Fl f , but pad this file's field when end-of-file is reached and other files are still active. -.It Fl s Ar sepstring +Using +.Fl p +applies only to the next file while +.Fl P +applies to all subsequent files until it appears again uncapitalized. +.It Fl s Ar sepstring , Fl S Ar sepstring Print .Ar sepstring before printing line fragments from the next file. This option may appear after the last file. -.It Fl t Ar c +Using +.Fl s +applies only to the next file while +.Fl S +applies to all subsequent files until it appears again uncapitalized. +.It Fl t Ar c , Fl T Ar c The input line terminator is .Ar c instead of a newline. The newline normally appended to each output line is omitted. +Using +.Fl t +applies only to the next file while +.Fl T +applies to all subsequent files until it appears again uncapitalized. .El .Pp To print files simultaneously for easy viewing use From owner-svn-src-all@freebsd.org Fri Jan 4 02:50:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36039143FEF7; Fri, 4 Jan 2019 02:50:19 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B614A75111; Fri, 4 Jan 2019 02:50:18 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAA7D2A5AC; Fri, 4 Jan 2019 02:50:18 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x042oI34078447; Fri, 4 Jan 2019 02:50:18 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x042oIlt078445; Fri, 4 Jan 2019 02:50:18 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201901040250.x042oIlt078445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 4 Jan 2019 02:50:18 +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: r342755 - stable/11/sys/dev/asmc X-SVN-Group: stable-11 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/11/sys/dev/asmc X-SVN-Commit-Revision: 342755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B614A75111 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 04 Jan 2019 02:50:19 -0000 Author: dab Date: Fri Jan 4 02:50:18 2019 New Revision: 342755 URL: https://svnweb.freebsd.org/changeset/base/342755 Log: MFC r342218: asmc: Add support for MacPro1,1 PR: 203431 Submitted by: jjr@alisa.org & holindho@saunalahti.fi Reported by: jjr@alisa.org Modified: stable/11/sys/dev/asmc/asmc.c stable/11/sys/dev/asmc/asmcvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/asmc/asmc.c ============================================================================== --- stable/11/sys/dev/asmc/asmc.c Fri Jan 4 02:48:43 2019 (r342754) +++ stable/11/sys/dev/asmc/asmc.c Fri Jan 4 02:50:18 2019 (r342755) @@ -272,13 +272,22 @@ struct asmc_model asmc_models[] = { ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS }, - /* Idem for the MacPro */ + /* Idem for the Mac Pro "Quad Core" (original) */ { + "MacPro1,1", "Apple SMC Mac Pro (Quad Core)", + NULL, NULL, NULL, + ASMC_FAN_FUNCS, + NULL, NULL, NULL, + ASMC_MP1_TEMPS, ASMC_MP1_TEMPNAMES, ASMC_MP1_TEMPDESCS + }, + + /* Idem for the Mac Pro (8-core) */ + { "MacPro2", "Apple SMC Mac Pro (8-core)", NULL, NULL, NULL, ASMC_FAN_FUNCS, NULL, NULL, NULL, - ASMC_MP_TEMPS, ASMC_MP_TEMPNAMES, ASMC_MP_TEMPDESCS + ASMC_MP2_TEMPS, ASMC_MP2_TEMPNAMES, ASMC_MP2_TEMPDESCS }, /* Idem for the MacPro 2010*/ Modified: stable/11/sys/dev/asmc/asmcvar.h ============================================================================== --- stable/11/sys/dev/asmc/asmcvar.h Fri Jan 4 02:48:43 2019 (r342754) +++ stable/11/sys/dev/asmc/asmcvar.h Fri Jan 4 02:50:18 2019 (r342755) @@ -372,7 +372,70 @@ struct asmc_softc { "Power Supply Temperature", \ "Wireless Module Proximity Temperature", } -#define ASMC_MP_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ +#define ASMC_MP1_TEMPS { "TA0P", \ + "TCAH", "TCBH", \ + "TC0P", "TC0C", "TC1C", \ + "TC2C", "TC3C", "THTG", \ + "TH0P", "TH1P", \ + "TH2P", "TH3P", \ + "TM0P", "TM1P", "TM2P", \ + "TM8P", "TM9P", "TMAP", \ + "TM0S", "TM1S", "TM2P", "TM3S", \ + "TM8S", "TM9S", "TMAS", "TMBS", \ + "TN0H", "TS0C", \ + "Tp0C", "Tp1C", "Tv0S", "Tv1S", NULL } + +#define ASMC_MP1_TEMPNAMES { "ambient", \ + "cpu_a_heatsink", "cpu_b_heatsink", \ + "cpu_a_proximity", "cpu_core0", "cpu_core1", \ + "cpu_core2", "cpu_core3", "THTG", \ + "hdd_bay0", "hdd_bay1", \ + "hdd_bay2", "hdd_bay3", \ + "memory_card_a_proximity0", \ + "memory_card_a_proximity1", \ + "memory_card_a_proximity2", \ + "memory_card_b_proximity0", \ + "memory_card_b_proximity1", \ + "memory_card_b_proximity2", \ + "memory_card_a_slot0", \ + "memory_card_a_slot1", \ + "memory_card_a_slot2", \ + "memory_card_a_slot3", \ + "memory_card_b_slot0", \ + "memory_card_b_slot1", \ + "memory_card_b_slot2", \ + "memory_card_b_slot3", \ + "mch_heatsink", "expansion_slots", \ + "power_supply_loc0", "power_supply_loc1", \ + "Tv0S", "Tv1S", } + +#define ASMC_MP1_TEMPDESCS { "Ambient Air", \ + "CPU A Heatsink", "CPU B Heatsink", \ + "CPU A Proximity", \ + "CPU Core 1", "CPU Core 2", \ + "CPU Core 3", "CPU Core 4", "THTG", \ + "Hard Drive Bay 1", "Hard Drive Bay 2", \ + "Hard Drive Bay 3", "Hard Drive Bay 4", \ + "Memory Riser A, Proximity 1", \ + "Memory Riser A, Proximity 2", \ + "Memory Riser A, Proximity 3", \ + "Memory Riser B, Proximity 1", \ + "Memory Riser B, Proximity 2", \ + "Memory Riser B, Proximity 3", \ + "Memory Riser A, Slot 1", \ + "Memory Riser A, Slot 2", \ + "Memory Riser A, Slot 3", \ + "Memory Riser A, Slot 4", \ + "Memory Riser B, Slot 1", \ + "Memory Riser B, Slot 2", \ + "Memory Riser B, Slot 3", \ + "Memory Riser B, Slot 4", \ + "MCH Heatsink", "Expansion Slots", \ + "Power Supply, Location 1", \ + "Power Supply, Location 2", \ + "Tv0S", "Tv1S", } + +#define ASMC_MP2_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ @@ -381,7 +444,7 @@ struct asmc_softc { "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", \ NULL } -#define ASMC_MP_TEMPNAMES { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ +#define ASMC_MP2_TEMPNAMES { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ @@ -389,7 +452,7 @@ struct asmc_softc { "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \ "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", } -#define ASMC_MP_TEMPDESCS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ +#define ASMC_MP2_TEMPDESCS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ From owner-svn-src-all@freebsd.org Fri Jan 4 02:50:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14FDC143FF89; Fri, 4 Jan 2019 02:50:57 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FD27753E2; Fri, 4 Jan 2019 02:50:56 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80CED2A5C9; Fri, 4 Jan 2019 02:50:56 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x042ouNU079337; Fri, 4 Jan 2019 02:50:56 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x042ouAa079335; Fri, 4 Jan 2019 02:50:56 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201901040250.x042ouAa079335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 4 Jan 2019 02:50: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: r342756 - stable/12/sys/dev/asmc X-SVN-Group: stable-12 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/12/sys/dev/asmc X-SVN-Commit-Revision: 342756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8FD27753E2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Jan 2019 02:50:57 -0000 Author: dab Date: Fri Jan 4 02:50:55 2019 New Revision: 342756 URL: https://svnweb.freebsd.org/changeset/base/342756 Log: MFC r342218: asmc: Add support for MacPro1,1 PR: 203431 Submitted by: jjr@alisa.org & holindho@saunalahti.fi Reported by: jjr@alisa.org Modified: stable/12/sys/dev/asmc/asmc.c stable/12/sys/dev/asmc/asmcvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/asmc/asmc.c ============================================================================== --- stable/12/sys/dev/asmc/asmc.c Fri Jan 4 02:50:18 2019 (r342755) +++ stable/12/sys/dev/asmc/asmc.c Fri Jan 4 02:50:55 2019 (r342756) @@ -269,13 +269,22 @@ struct asmc_model asmc_models[] = { ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS }, - /* Idem for the MacPro */ + /* Idem for the Mac Pro "Quad Core" (original) */ { + "MacPro1,1", "Apple SMC Mac Pro (Quad Core)", + NULL, NULL, NULL, + ASMC_FAN_FUNCS, + NULL, NULL, NULL, + ASMC_MP1_TEMPS, ASMC_MP1_TEMPNAMES, ASMC_MP1_TEMPDESCS + }, + + /* Idem for the Mac Pro (8-core) */ + { "MacPro2", "Apple SMC Mac Pro (8-core)", NULL, NULL, NULL, ASMC_FAN_FUNCS, NULL, NULL, NULL, - ASMC_MP_TEMPS, ASMC_MP_TEMPNAMES, ASMC_MP_TEMPDESCS + ASMC_MP2_TEMPS, ASMC_MP2_TEMPNAMES, ASMC_MP2_TEMPDESCS }, /* Idem for the MacPro 2010*/ Modified: stable/12/sys/dev/asmc/asmcvar.h ============================================================================== --- stable/12/sys/dev/asmc/asmcvar.h Fri Jan 4 02:50:18 2019 (r342755) +++ stable/12/sys/dev/asmc/asmcvar.h Fri Jan 4 02:50:55 2019 (r342756) @@ -374,7 +374,70 @@ struct asmc_softc { "Power Supply Temperature", \ "Wireless Module Proximity Temperature", } -#define ASMC_MP_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ +#define ASMC_MP1_TEMPS { "TA0P", \ + "TCAH", "TCBH", \ + "TC0P", "TC0C", "TC1C", \ + "TC2C", "TC3C", "THTG", \ + "TH0P", "TH1P", \ + "TH2P", "TH3P", \ + "TM0P", "TM1P", "TM2P", \ + "TM8P", "TM9P", "TMAP", \ + "TM0S", "TM1S", "TM2P", "TM3S", \ + "TM8S", "TM9S", "TMAS", "TMBS", \ + "TN0H", "TS0C", \ + "Tp0C", "Tp1C", "Tv0S", "Tv1S", NULL } + +#define ASMC_MP1_TEMPNAMES { "ambient", \ + "cpu_a_heatsink", "cpu_b_heatsink", \ + "cpu_a_proximity", "cpu_core0", "cpu_core1", \ + "cpu_core2", "cpu_core3", "THTG", \ + "hdd_bay0", "hdd_bay1", \ + "hdd_bay2", "hdd_bay3", \ + "memory_card_a_proximity0", \ + "memory_card_a_proximity1", \ + "memory_card_a_proximity2", \ + "memory_card_b_proximity0", \ + "memory_card_b_proximity1", \ + "memory_card_b_proximity2", \ + "memory_card_a_slot0", \ + "memory_card_a_slot1", \ + "memory_card_a_slot2", \ + "memory_card_a_slot3", \ + "memory_card_b_slot0", \ + "memory_card_b_slot1", \ + "memory_card_b_slot2", \ + "memory_card_b_slot3", \ + "mch_heatsink", "expansion_slots", \ + "power_supply_loc0", "power_supply_loc1", \ + "Tv0S", "Tv1S", } + +#define ASMC_MP1_TEMPDESCS { "Ambient Air", \ + "CPU A Heatsink", "CPU B Heatsink", \ + "CPU A Proximity", \ + "CPU Core 1", "CPU Core 2", \ + "CPU Core 3", "CPU Core 4", "THTG", \ + "Hard Drive Bay 1", "Hard Drive Bay 2", \ + "Hard Drive Bay 3", "Hard Drive Bay 4", \ + "Memory Riser A, Proximity 1", \ + "Memory Riser A, Proximity 2", \ + "Memory Riser A, Proximity 3", \ + "Memory Riser B, Proximity 1", \ + "Memory Riser B, Proximity 2", \ + "Memory Riser B, Proximity 3", \ + "Memory Riser A, Slot 1", \ + "Memory Riser A, Slot 2", \ + "Memory Riser A, Slot 3", \ + "Memory Riser A, Slot 4", \ + "Memory Riser B, Slot 1", \ + "Memory Riser B, Slot 2", \ + "Memory Riser B, Slot 3", \ + "Memory Riser B, Slot 4", \ + "MCH Heatsink", "Expansion Slots", \ + "Power Supply, Location 1", \ + "Power Supply, Location 2", \ + "Tv0S", "Tv1S", } + +#define ASMC_MP2_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ @@ -383,7 +446,7 @@ struct asmc_softc { "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", \ NULL } -#define ASMC_MP_TEMPNAMES { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ +#define ASMC_MP2_TEMPNAMES { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ @@ -391,7 +454,7 @@ struct asmc_softc { "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \ "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", } -#define ASMC_MP_TEMPDESCS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ +#define ASMC_MP2_TEMPDESCS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \ "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ From owner-svn-src-all@freebsd.org Fri Jan 4 03:13:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B564114409C2; Fri, 4 Jan 2019 03:13: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 59959763CE; Fri, 4 Jan 2019 03:13: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 4646A2AB50; Fri, 4 Jan 2019 03:13: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 x043DPUj094939; Fri, 4 Jan 2019 03:13:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x043DPFm094938; Fri, 4 Jan 2019 03:13:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901040313.x043DPFm094938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 4 Jan 2019 03:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342757 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 342757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59959763CE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.998,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: Fri, 04 Jan 2019 03:13:25 -0000 Author: kevans Date: Fri Jan 4 03:13:24 2019 New Revision: 342757 URL: https://svnweb.freebsd.org/changeset/base/342757 Log: getopt_long(3): fix case of malformed long opt When presented with an arg string like '-l-', getopt_long will successfully parse out the 'l' short option, then proceed to match '--' against the first longopts entry as it later does a strncmp with len=0. This latter bit is arguably another bug in itself, but presumably not a practical issue as all callers of parse_long_options are already doing the right thing (except this one pointed out). An opt string like '-l-' should be considered malformed and throw a bad argument rather than behaving as if '--' were passed. It cannot possibly do what the invoker expects, and it's probably the result of a typo (ls -l- a) rather than any intent. Reported by: Tony Overfield Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18616 Modified: head/lib/libc/stdlib/getopt_long.c Modified: head/lib/libc/stdlib/getopt_long.c ============================================================================== --- head/lib/libc/stdlib/getopt_long.c Fri Jan 4 02:50:55 2019 (r342756) +++ head/lib/libc/stdlib/getopt_long.c Fri Jan 4 03:13:24 2019 (r342757) @@ -481,6 +481,8 @@ start: #endif if (*place == '-') { place++; /* --foo long option */ + if (*place == '\0') + return (BADARG); /* malformed option */ #ifdef GNU_COMPATIBLE dash_prefix = DD_PREFIX; #endif From owner-svn-src-all@freebsd.org Fri Jan 4 04:15:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55C051441A22; Fri, 4 Jan 2019 04:15:18 +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 EE3D477C94; Fri, 4 Jan 2019 04:15:17 +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 DADA62B57E; Fri, 4 Jan 2019 04:15:17 +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 x044FHXc027084; Fri, 4 Jan 2019 04:15:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x044FHED027083; Fri, 4 Jan 2019 04:15:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201901040415.x044FHED027083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 4 Jan 2019 04:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342758 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 342758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EE3D477C94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Jan 2019 04:15:18 -0000 Author: np Date: Fri Jan 4 04:15:17 2019 New Revision: 342758 URL: https://svnweb.freebsd.org/changeset/base/342758 Log: cxgbe(4): Clear FW_OK if the firmware reports an error. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Jan 4 03:13:24 2019 (r342757) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Jan 4 04:15:17 2019 (r342758) @@ -211,9 +211,11 @@ static void t4_report_fw_error(struct adapter *adap) u32 pcie_fw; pcie_fw = t4_read_reg(adap, A_PCIE_FW); - if (pcie_fw & F_PCIE_FW_ERR) + if (pcie_fw & F_PCIE_FW_ERR) { CH_ERR(adap, "Firmware reports adapter error: %s\n", reason[G_PCIE_FW_EVAL(pcie_fw)]); + adap->flags &= ~FW_OK; + } } /* From owner-svn-src-all@freebsd.org Fri Jan 4 04:26:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AD571441CC9; Fri, 4 Jan 2019 04:26:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F1228014C; Fri, 4 Jan 2019 04:26:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA2AA2B729; Fri, 4 Jan 2019 04:26:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x044QdYw032428; Fri, 4 Jan 2019 04:26:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x044QdF8032426; Fri, 4 Jan 2019 04:26:39 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901040426.x044QdF8032426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 4 Jan 2019 04:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342759 - in head/sys/dev/rtwn: rtl8188e rtl8188e/pci rtl8192c X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: rtl8188e rtl8188e/pci rtl8192c X-SVN-Commit-Revision: 342759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F1228014C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,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, 04 Jan 2019 04:26:40 -0000 Author: avos Date: Fri Jan 4 04:26:39 2019 New Revision: 342759 URL: https://svnweb.freebsd.org/changeset/base/342759 Log: rtwn_pci(4): sync r88ee_power_on() with OpenBSD Tested with RTL8188EE, STA mode Submitted by: Farhan Khan MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18727 Modified: head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c head/sys/dev/rtwn/rtl8188e/r88e_reg.h head/sys/dev/rtwn/rtl8192c/r92c_reg.h Modified: head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c Fri Jan 4 04:15:17 2019 (r342758) +++ head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c Fri Jan 4 04:26:39 2019 (r342759) @@ -84,8 +84,15 @@ r88ee_power_on(struct rtwn_softc *sc) { int ntries; - /* Wait for power ready bit. */ - for (ntries = 0; ntries < 5000; ntries++) { + /* Disable XTAL output for power saving. */ + rtwn_setbits_1(sc, R88E_XCK_OUT_CTRL, R88E_XCK_OUT_CTRL_EN, 0); + + /* Unlock ISO/CLK/Power control register. */ + rtwn_setbits_2(sc, R92C_APS_FSMCO, R92C_APS_FSMCO_APDM_HPDN, 0); + rtwn_write_1(sc, R92C_RSV_CTRL, 0); + + /* Wait for power ready bit */ + for(ntries = 0; ntries < 5000; ntries++) { if (rtwn_read_4(sc, R92C_APS_FSMCO) & R92C_APS_FSMCO_SUS_HOST) break; rtwn_delay(sc, 10); @@ -96,9 +103,6 @@ r88ee_power_on(struct rtwn_softc *sc) return (ETIMEDOUT); } - /* Unlock ISO/CLK/Power control register. */ - rtwn_write_1(sc, R92C_RSV_CTRL, 0); - /* Reset BB. */ rtwn_setbits_1(sc, R92C_SYS_FUNC_EN, R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST, 0); @@ -114,6 +118,7 @@ r88ee_power_on(struct rtwn_softc *sc) rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, R92C_APS_FSMCO_AFSM_HSUS | R92C_APS_FSMCO_AFSM_PCIE, 0, 1); + /* Auto-enable WLAN */ rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, 0, R92C_APS_FSMCO_APFM_ONMAC, 1); for (ntries = 0; ntries < 5000; ntries++) { @@ -129,6 +134,12 @@ r88ee_power_on(struct rtwn_softc *sc) /* Enable LDO normal mode. */ rtwn_setbits_1(sc, R92C_LPLDO_CTRL, R92C_LPLDO_CTRL_SLEEP, 0); + + rtwn_setbits_1(sc, R92C_APS_FSMCO, 0, R92C_APS_FSMCO_PDN_EN); + rtwn_setbits_1(sc, R92C_PCIE_CTRL_REG + 2, 0, 0x04); + rtwn_setbits_1(sc, R92C_AFE_XTAL_CTRL_EXT + 1, 0, 0x02); + rtwn_setbits_1(sc, R92C_SYS_CLKR, 0, 0x08); + rtwn_setbits_2(sc, R92C_GPIO_MUXCFG, R92C_GPIO_MUXCFG_ENSIC, 0); /* Enable MAC DMA/WMAC/SCHEDULE/SEC blocks. */ rtwn_write_2(sc, R92C_CR, 0); Modified: head/sys/dev/rtwn/rtl8188e/r88e_reg.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_reg.h Fri Jan 4 04:15:17 2019 (r342758) +++ head/sys/dev/rtwn/rtl8188e/r88e_reg.h Fri Jan 4 04:26:39 2019 (r342759) @@ -32,6 +32,7 @@ #define R88E_HISR 0x0b4 #define R88E_HIMRE 0x0b8 #define R88E_HISRE 0x0bc +#define R88E_XCK_OUT_CTRL 0x07c /* MAC General Configuration. */ #define R88E_32K_CTRL 0x194 #define R88E_HMEBOX_EXT(idx) (0x1f0 + (idx) * 4) @@ -121,5 +122,8 @@ #define R88E_RF_T_METER_VAL_M 0x0fc00 #define R88E_RF_T_METER_VAL_S 10 #define R88E_RF_T_METER_START 0x30000 + +/* Bits for R88E_XCK_OUT_CTRL. */ +#define R88E_XCK_OUT_CTRL_EN 1 #endif /* R88E_REG_H */ Modified: head/sys/dev/rtwn/rtl8192c/r92c_reg.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_reg.h Fri Jan 4 04:15:17 2019 (r342758) +++ head/sys/dev/rtwn/rtl8192c/r92c_reg.h Fri Jan 4 04:26:39 2019 (r342759) @@ -66,6 +66,7 @@ #define R92C_HSIMR 0x058 #define R92C_HSISR 0x05c #define R92C_MULTI_FUNC_CTRL 0x068 +#define R92C_AFE_XTAL_CTRL_EXT 0x078 #define R92C_LDO_SWR_CTRL 0x07c #define R92C_MCUFWDL 0x080 #define R92C_HMEBOX_EXT(idx) (0x088 + (idx) * 2) @@ -347,6 +348,7 @@ /* Bits for R92C_GPIO_MUXCFG. */ #define R92C_GPIO_MUXCFG_ENBT 0x0020 +#define R92C_GPIO_MUXCFG_ENSIC 0x1000 /* Bits for R92C_LEDCFG0. */ #define R92C_LEDCFG0_DIS 0x08 From owner-svn-src-all@freebsd.org Fri Jan 4 14:42:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3E90142DF07; Fri, 4 Jan 2019 14:42: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 48AAF6C0B2; Fri, 4 Jan 2019 14:42: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 391522074; Fri, 4 Jan 2019 14:42: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 x04EgbOw053442; Fri, 4 Jan 2019 14:42:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04EgbJr053441; Fri, 4 Jan 2019 14:42:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901041442.x04EgbJr053441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 4 Jan 2019 14:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342760 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 342760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48AAF6C0B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 04 Jan 2019 14:42:37 -0000 Author: emaste Date: Fri Jan 4 14:42:36 2019 New Revision: 342760 URL: https://svnweb.freebsd.org/changeset/base/342760 Log: newvers: avoid clearing svn revision information with nested VCS dirs Consider the case where FreeBSD is checked out via Subversion with a (perhaps unrelated) .git or .hg directory at a higher level - for example, .../.git .../src/freebsd Previously newvers obtained the SVN revision information via svnversion, and then tried to obtain the SVN revision corresponding to the git or hg commit, overwriting the existing information. As a short term fix use a different variable for hg-svn or git-svn information, setting $svn from hg or git info only if not empty. Reported by: Matthias Apitz Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri Jan 4 04:26:39 2019 (r342759) +++ head/sys/conf/newvers.sh Fri Jan 4 14:42:36 2019 (r342760) @@ -244,21 +244,21 @@ fi if [ -n "$git_cmd" ] ; then git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` - svn=`$git_cmd svn find-rev $git 2>/dev/null` - if [ -n "$svn" ] ; then - svn=" r${svn}" + gitsvn=`$git_cmd svn find-rev $git 2>/dev/null` + if [ -n "$gitsvn" ] ; then + svn=" r${gitsvn}" git="=${git}" else - svn=`$git_cmd log --grep '^git-svn-id:' | \ + gitsvn=`$git_cmd log --grep '^git-svn-id:' | \ grep '^ git-svn-id:' | head -1 | \ sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` - if [ -z "$svn" ] ; then - svn=`$git_cmd log --format='format:%N' | \ + if [ -z "$gitsvn" ] ; then + gitsvn=`$git_cmd log --format='format:%N' | \ grep '^svn ' | head -1 | \ sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'` fi - if [ -n "$svn" ] ; then - svn=" r${svn}" + if [ -n "$gitsvn" ] ; then + svn=" r${gitsvn}" git="+${git}" else git=" ${git}" @@ -295,10 +295,10 @@ fi if [ -n "$hg_cmd" ] ; then hg=`$hg_cmd id 2>/dev/null` - svn=`$hg_cmd svn info 2>/dev/null | \ + hgsvn=`$hg_cmd svn info 2>/dev/null | \ awk -F': ' '/Revision/ { print $2 }'` - if [ -n "$svn" ] ; then - svn=" r${svn}" + if [ -n "$hgsvn" ] ; then + svn=" r${hgsvn}" fi if [ -n "$hg" ] ; then hg=" ${hg}" From owner-svn-src-all@freebsd.org Fri Jan 4 15:03:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAE01142E956; Fri, 4 Jan 2019 15:03: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 605456CDDA; Fri, 4 Jan 2019 15:03: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 525ED23D5; Fri, 4 Jan 2019 15:03: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 x04F3VEe063767; Fri, 4 Jan 2019 15:03:31 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04F3VGe063766; Fri, 4 Jan 2019 15:03:31 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201901041503.x04F3VGe063766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Fri, 4 Jan 2019 15:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342761 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 342761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 605456CDDA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Jan 2019 15:03:32 -0000 Author: chuck Date: Fri Jan 4 15:03:30 2019 New Revision: 342761 URL: https://svnweb.freebsd.org/changeset/base/342761 Log: Fix bhyve's NVMe queue bookkeeping Many size / length parameters in NVMe are "0's based", meaning, a value of 0x0 represents 1, 0x1 represents 2, etc.. While this leads to an efficient encoding, it can lead to subtle bugs. With respect to queues, these parameters include: - Maximum number of queue entries - Maximum number of queues - Number of Completion Queues - Number of Submission Queues To be consistent, convert all 0's based values from the host to 1's based value internally. Likewise, covert internal 1's based values to 0's based values when returned to the host. This fixes an off-by-one bug when creating IO queues and simplifies some of the code. Note that this bug is masked by another bug. While in the neighborhood, - fix an erroneous queue ID check (checking CQ count when deleting SQ) - check for queue ID of 0x0 in a few places where this is illegal - clean up the Set Features, Number of Queues command and check for illegal values Reviewed by: imp, araujo Approved by: imp (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D18702 Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Fri Jan 4 14:42:36 2019 (r342760) +++ head/usr.sbin/bhyve/pci_nvme.c Fri Jan 4 15:03:30 2019 (r342761) @@ -93,6 +93,16 @@ static int nvme_debug = 0; /* helpers */ +/* Convert a zero-based value into a one-based value */ +#define ONE_BASED(zero) ((zero) + 1) +/* Convert a one-based value into a zero-based value */ +#define ZERO_BASED(one) ((one) - 1) + +/* Encode number of SQ's and CQ's for Set/Get Features */ +#define NVME_FEATURE_NUM_QUEUES(sc) \ + (ZERO_BASED((sc)->num_squeues) & 0xffff) | \ + (ZERO_BASED((sc)->num_cqueues) & 0xffff) << 16; + #define NVME_DOORBELL_OFFSET offsetof(struct nvme_registers, doorbell) enum nvme_controller_register_offsets { @@ -192,8 +202,8 @@ struct pci_nvme_softc { struct pci_nvme_blockstore nvstore; - uint16_t max_qentries; /* max entries per queue */ - uint32_t max_queues; + uint16_t max_qentries; /* max entries per queue */ + uint32_t max_queues; /* max number of IO SQ's or CQ's */ uint32_t num_cqueues; uint32_t num_squeues; @@ -203,7 +213,10 @@ struct pci_nvme_softc { uint32_t ioslots; sem_t iosemlock; - /* status and guest memory mapped queues */ + /* + * Memory mapped Submission and Completion queues + * Each array includes both Admin and IO queues + */ struct nvme_completion_queue *compl_queues; struct nvme_submission_queue *submit_queues; @@ -357,7 +370,7 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) { DPRINTF(("%s\r\n", __func__)); - sc->regs.cap_lo = (sc->max_qentries & NVME_CAP_LO_REG_MQES_MASK) | + sc->regs.cap_lo = (ZERO_BASED(sc->max_qentries) & NVME_CAP_LO_REG_MQES_MASK) | (1 << NVME_CAP_LO_REG_CQR_SHIFT) | (60 << NVME_CAP_LO_REG_TO_SHIFT); @@ -370,7 +383,7 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) sc->num_cqueues = sc->num_squeues = sc->max_queues; if (sc->submit_queues != NULL) { - for (int i = 0; i <= sc->max_queues; i++) { + for (int i = 0; i < sc->num_squeues + 1; i++) { /* * The Admin Submission Queue is at index 0. * It must not be changed at reset otherwise the @@ -380,26 +393,31 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) sc->submit_queues[i].qbase = NULL; sc->submit_queues[i].size = 0; sc->submit_queues[i].cqid = 0; - - sc->compl_queues[i].qbase = NULL; - sc->compl_queues[i].size = 0; } sc->submit_queues[i].tail = 0; sc->submit_queues[i].head = 0; sc->submit_queues[i].busy = 0; - - sc->compl_queues[i].tail = 0; - sc->compl_queues[i].head = 0; } } else - sc->submit_queues = calloc(sc->max_queues + 1, + sc->submit_queues = calloc(sc->num_squeues + 1, sizeof(struct nvme_submission_queue)); - if (sc->compl_queues == NULL) { - sc->compl_queues = calloc(sc->max_queues + 1, + if (sc->compl_queues != NULL) { + for (int i = 0; i < sc->num_cqueues + 1; i++) { + /* See Admin Submission Queue note above */ + if (i != 0) { + sc->compl_queues[i].qbase = NULL; + sc->compl_queues[i].size = 0; + } + + sc->compl_queues[i].tail = 0; + sc->compl_queues[i].head = 0; + } + } else { + sc->compl_queues = calloc(sc->num_cqueues + 1, sizeof(struct nvme_completion_queue)); - for (int i = 0; i <= sc->num_cqueues; i++) + for (int i = 0; i < sc->num_cqueues + 1; i++) pthread_mutex_init(&sc->compl_queues[i].mtx, NULL); } } @@ -443,7 +461,7 @@ nvme_opc_delete_io_sq(struct pci_nvme_softc* sc, struc uint16_t qid = command->cdw10 & 0xffff; DPRINTF(("%s DELETE_IO_SQ %u\r\n", __func__, qid)); - if (qid == 0 || qid > sc->num_cqueues) { + if (qid == 0 || qid > sc->num_squeues) { WPRINTF(("%s NOT PERMITTED queue id %u / num_squeues %u\r\n", __func__, qid, sc->num_squeues)); pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, @@ -464,7 +482,7 @@ nvme_opc_create_io_sq(struct pci_nvme_softc* sc, struc uint16_t qid = command->cdw10 & 0xffff; struct nvme_submission_queue *nsq; - if (qid > sc->num_squeues) { + if ((qid == 0) || (qid > sc->num_squeues)) { WPRINTF(("%s queue index %u > num_squeues %u\r\n", __func__, qid, sc->num_squeues)); pci_nvme_status_tc(&compl->status, @@ -474,7 +492,7 @@ nvme_opc_create_io_sq(struct pci_nvme_softc* sc, struc } nsq = &sc->submit_queues[qid]; - nsq->size = ((command->cdw10 >> 16) & 0xffff) + 1; + nsq->size = ONE_BASED((command->cdw10 >> 16) & 0xffff); nsq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, sizeof(struct nvme_command) * (size_t)nsq->size); @@ -529,7 +547,7 @@ nvme_opc_create_io_cq(struct pci_nvme_softc* sc, struc uint16_t qid = command->cdw10 & 0xffff; struct nvme_completion_queue *ncq; - if (qid > sc->num_cqueues) { + if ((qid == 0) || (qid > sc->num_cqueues)) { WPRINTF(("%s queue index %u > num_cqueues %u\r\n", __func__, qid, sc->num_cqueues)); pci_nvme_status_tc(&compl->status, @@ -541,7 +559,7 @@ nvme_opc_create_io_cq(struct pci_nvme_softc* sc, struc ncq = &sc->compl_queues[qid]; ncq->intr_en = (command->cdw11 & NVME_CMD_CDW11_IEN) >> 1; ncq->intr_vec = (command->cdw11 >> 16) & 0xffff; - ncq->size = ((command->cdw10 >> 16) & 0xffff) + 1; + ncq->size = ONE_BASED((command->cdw10 >> 16) & 0xffff); ncq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, @@ -649,6 +667,45 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nv } static int +nvme_set_feature_queues(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + uint16_t nqr; /* Number of Queues Requested */ + + nqr = command->cdw11 & 0xFFFF; + if (nqr == 0xffff) { + WPRINTF(("%s: Illegal NSQR value %#x\n", __func__, nqr)); + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + return (-1); + } + + sc->num_squeues = ONE_BASED(nqr); + if (sc->num_squeues > sc->max_queues) { + DPRINTF(("NSQR=%u is greater than max %u\n", sc->num_squeues, + sc->max_queues)); + sc->num_squeues = sc->max_queues; + } + + nqr = (command->cdw11 >> 16) & 0xFFFF; + if (nqr == 0xffff) { + WPRINTF(("%s: Illegal NCQR value %#x\n", __func__, nqr)); + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + return (-1); + } + + sc->num_cqueues = ONE_BASED(nqr); + if (sc->num_cqueues > sc->max_queues) { + DPRINTF(("NCQR=%u is greater than max %u\n", sc->num_cqueues, + sc->max_queues)); + sc->num_cqueues = sc->max_queues; + } + + compl->cdw0 = NVME_FEATURE_NUM_QUEUES(sc); + + return (0); +} + +static int nvme_opc_set_features(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { @@ -678,19 +735,7 @@ nvme_opc_set_features(struct pci_nvme_softc* sc, struc DPRINTF((" volatile write cache 0x%x\r\n", command->cdw11)); break; case NVME_FEAT_NUMBER_OF_QUEUES: - sc->num_squeues = command->cdw11 & 0xFFFF; - sc->num_cqueues = (command->cdw11 >> 16) & 0xFFFF; - DPRINTF((" number of queues (submit %u, completion %u)\r\n", - sc->num_squeues, sc->num_cqueues)); - - if (sc->num_squeues == 0 || sc->num_squeues > sc->max_queues) - sc->num_squeues = sc->max_queues; - if (sc->num_cqueues == 0 || sc->num_cqueues > sc->max_queues) - sc->num_cqueues = sc->max_queues; - - compl->cdw0 = (sc->num_squeues & 0xFFFF) | - ((sc->num_cqueues & 0xFFFF) << 16); - + nvme_set_feature_queues(sc, command, compl); break; case NVME_FEAT_INTERRUPT_COALESCING: DPRINTF((" interrupt coalescing 0x%x\r\n", command->cdw11)); @@ -706,7 +751,7 @@ nvme_opc_set_features(struct pci_nvme_softc* sc, struc DPRINTF((" interrupt vector configuration 0x%x\r\n", command->cdw11)); - for (uint32_t i = 0; i <= sc->num_cqueues; i++) { + for (uint32_t i = 0; i < sc->num_cqueues + 1; i++) { if (sc->compl_queues[i].intr_vec == iv) { if (command->cdw11 & (1 << 16)) sc->compl_queues[i].intr_en |= @@ -788,17 +833,8 @@ nvme_opc_get_features(struct pci_nvme_softc* sc, struc DPRINTF((" volatile write cache\r\n")); break; case NVME_FEAT_NUMBER_OF_QUEUES: - compl->cdw0 = 0; - if (sc->num_squeues == 0) - compl->cdw0 |= sc->max_queues & 0xFFFF; - else - compl->cdw0 |= sc->num_squeues & 0xFFFF; + compl->cdw0 = NVME_FEATURE_NUM_QUEUES(sc); - if (sc->num_cqueues == 0) - compl->cdw0 |= (sc->max_queues & 0xFFFF) << 16; - else - compl->cdw0 |= (sc->num_cqueues & 0xFFFF) << 16; - DPRINTF((" number of queues (submit %u, completion %u)\r\n", compl->cdw0 & 0xFFFF, (compl->cdw0 >> 16) & 0xFFFF)); @@ -1812,7 +1848,7 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p /* allocate size of nvme registers + doorbell space for all queues */ pci_membar_sz = sizeof(struct nvme_registers) + - 2*sizeof(uint32_t)*(sc->max_queues); + 2*sizeof(uint32_t)*(sc->max_queues + 1); DPRINTF(("nvme membar size: %u\r\n", pci_membar_sz)); @@ -1822,7 +1858,7 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p goto done; } - error = pci_emul_add_msixcap(pi, sc->max_queues, NVME_MSIX_BAR); + error = pci_emul_add_msixcap(pi, sc->max_queues + 1, NVME_MSIX_BAR); if (error) { WPRINTF(("%s pci add msixcap failed\r\n", __func__)); goto done; From owner-svn-src-all@freebsd.org Fri Jan 4 15:03:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C445142E97F; Fri, 4 Jan 2019 15:03:43 +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 A87B56CE1C; Fri, 4 Jan 2019 15:03: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 9D27323D6; Fri, 4 Jan 2019 15:03:35 +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 x04F3ZQP063813; Fri, 4 Jan 2019 15:03:35 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04F3Zk5063812; Fri, 4 Jan 2019 15:03:35 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201901041503.x04F3Zk5063812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Fri, 4 Jan 2019 15:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342762 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 342762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A87B56CE1C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 04 Jan 2019 15:03:43 -0000 Author: chuck Date: Fri Jan 4 15:03:35 2019 New Revision: 342762 URL: https://svnweb.freebsd.org/changeset/base/342762 Log: Fix bhyve's NVMe Completion Queue entry values The function which processes Admin commands was not returning the Command Specific value in Completion Queue Entry, Dword 0 (CDW0). This effects commands such as Set Features, Number of Queues which returns the number of queues supported by the device in CDW0. In this case, the host will only create 1 queue pair (Number of Queues is zero based). This also masked a bug in the queue counting logic. Reviewed by: imp, araujo Approved by: imp (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D18703 Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Fri Jan 4 15:03:30 2019 (r342761) +++ head/usr.sbin/bhyve/pci_nvme.c Fri Jan 4 15:03:35 2019 (r342762) @@ -983,6 +983,7 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u cq = &sc->compl_queues[0]; cp = &(cq->qbase)[cq->tail]; + cp->cdw0 = compl.cdw0; cp->sqid = 0; cp->sqhd = sqhead; cp->cid = cmd->cid; From owner-svn-src-all@freebsd.org Fri Jan 4 16:47:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3B591431288; Fri, 4 Jan 2019 16:47: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 699B970180; Fri, 4 Jan 2019 16:47: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 5A79A36E3; Fri, 4 Jan 2019 16:47: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 x04GlaRt017052; Fri, 4 Jan 2019 16:47:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04GlatK017051; Fri, 4 Jan 2019 16:47:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901041647.x04GlatK017051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 4 Jan 2019 16:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342763 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 342763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 699B970180 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Jan 2019 16:47:37 -0000 Author: emaste Date: Fri Jan 4 16:47:35 2019 New Revision: 342763 URL: https://svnweb.freebsd.org/changeset/base/342763 Log: newvers: retire p4 version support Perforce no longer offers a FreeBSD client and it not a viable VCS for FreeBSD development. Remove p4 version logic to simplify newvers.sh in advance of other changes. Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri Jan 4 15:03:35 2019 (r342762) +++ head/sys/conf/newvers.sh Fri Jan 4 16:47:35 2019 (r342763) @@ -202,12 +202,6 @@ if [ -z "${svnversion}" ] && [ -x /usr/bin/svnlitevers fi fi -for dir in /usr/bin /usr/local/bin; do - if [ -x "${dir}/p4" ] && [ -z ${p4_cmd} ] ; then - p4_cmd=${dir}/p4 - fi -done - if findvcs .git; then for dir in /usr/bin /usr/local/bin; do if [ -x "${dir}/git" ] ; then @@ -274,25 +268,6 @@ if [ -n "$git_cmd" ] ; then fi fi -if [ -n "$p4_cmd" ] ; then - p4version=`cd ${SYSDIR} && $p4_cmd changes -m1 "./...#have" 2>&1 | \ - awk '{ print $2 }'` - case "$p4version" in - [0-9]*) - p4version=" ${p4version}" - p4opened=`cd ${SYSDIR} && $p4_cmd opened ./... 2>&1` - case "$p4opened" in - File*) ;; - //*) - p4version="${p4version}+edit" - modified=true - ;; - esac - ;; - *) unset p4version ;; - esac -fi - if [ -n "$hg_cmd" ] ; then hg=`$hg_cmd id 2>/dev/null` hgsvn=`$hg_cmd svn info 2>/dev/null | \ @@ -320,10 +295,10 @@ done shift $((OPTIND - 1)) if [ -z "${include_metadata}" ]; then - VERINFO="${VERSION}${svn}${git}${hg}${p4version} ${i}" + VERINFO="${VERSION}${svn}${git}${hg} ${i}" VERSTR="${VERINFO}\\n" else - VERINFO="${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}" + VERINFO="${VERSION} #${v}${svn}${git}${hg}: ${t}" VERSTR="${VERINFO}\\n ${u}@${h}:${d}\\n" fi From owner-svn-src-all@freebsd.org Fri Jan 4 17:08:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FC4E1432529; Fri, 4 Jan 2019 17:08:46 +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 32A55719D1; Fri, 4 Jan 2019 17:08:46 +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 24B153AFF; Fri, 4 Jan 2019 17:08:46 +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 x04H8k1e027549; Fri, 4 Jan 2019 17:08:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04H8kTJ027548; Fri, 4 Jan 2019 17:08:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901041708.x04H8kTJ027548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Jan 2019 17:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342764 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 32A55719D1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 04 Jan 2019 17:08:46 -0000 Author: markj Date: Fri Jan 4 17:08:45 2019 New Revision: 342764 URL: https://svnweb.freebsd.org/changeset/base/342764 Log: Clear PGA_WRITEABLE in pmap_remove_pages(). Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18731 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Fri Jan 4 16:47:35 2019 (r342763) +++ head/sys/riscv/riscv/pmap.c Fri Jan 4 17:08:45 2019 (r342764) @@ -2754,6 +2754,9 @@ pmap_remove_pages(pmap_t pmap) pmap_resident_count_dec(pmap, 1); TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; + if (TAILQ_EMPTY(&m->md.pv_list) && + (m->aflags & PGA_WRITEABLE) != 0) + vm_page_aflag_clear(m, PGA_WRITEABLE); pmap_unuse_l3(pmap, pv->pv_va, ptepde, &free); freed++; From owner-svn-src-all@freebsd.org Fri Jan 4 17:10:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46AD61432660; Fri, 4 Jan 2019 17:10:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E15D971B9C; Fri, 4 Jan 2019 17:10:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7C1E3B0C; Fri, 4 Jan 2019 17:10:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04HAGIF027683; Fri, 4 Jan 2019 17:10:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04HAGiV027682; Fri, 4 Jan 2019 17:10:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901041710.x04HAGiV027682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Jan 2019 17:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342765 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E15D971B9C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 04 Jan 2019 17:10:17 -0000 Author: markj Date: Fri Jan 4 17:10:16 2019 New Revision: 342765 URL: https://svnweb.freebsd.org/changeset/base/342765 Log: Fix dirty bit handling in pmap_remove_write(). Reviewed by: jhb, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18732 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Fri Jan 4 17:08:45 2019 (r342764) +++ head/sys/riscv/riscv/pmap.c Fri Jan 4 17:10:16 2019 (r342765) @@ -2947,15 +2947,13 @@ retry_pv_loop: } } l3 = pmap_l3(pmap, pv->pv_va); -retry: oldl3 = pmap_load(l3); - +retry: if ((oldl3 & PTE_W) != 0) { - newl3 = oldl3 & ~PTE_W; - if (!atomic_cmpset_long(l3, oldl3, newl3)) + newl3 = oldl3 & ~(PTE_D | PTE_W); + if (!atomic_fcmpset_long(l3, &oldl3, newl3)) goto retry; - /* TODO: check for PTE_D? */ - if ((oldl3 & PTE_A) != 0) + if ((oldl3 & PTE_D) != 0) vm_page_dirty(m); pmap_invalidate_page(pmap, pv->pv_va); } From owner-svn-src-all@freebsd.org Fri Jan 4 17:14:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67ECB1432965; Fri, 4 Jan 2019 17:14:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B5BA72025; Fri, 4 Jan 2019 17:14:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2D0A3CE0; Fri, 4 Jan 2019 17:14:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04HEoxT032650; Fri, 4 Jan 2019 17:14:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04HEoNL032649; Fri, 4 Jan 2019 17:14:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901041714.x04HEoNL032649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Jan 2019 17:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342766 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B5BA72025 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 04 Jan 2019 17:14:51 -0000 Author: markj Date: Fri Jan 4 17:14:50 2019 New Revision: 342766 URL: https://svnweb.freebsd.org/changeset/base/342766 Log: Don't enable interrupts in init_secondary(). The MI kernel assumes that interrupts will not be enabled on APs until after the first context switch. In particular, the problem was causing occasional deadlocks during boot. Remove an unneeded intr_disable() added in r335005. Reviewed by: jhb (previous version) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18738 Modified: head/sys/riscv/riscv/mp_machdep.c Modified: head/sys/riscv/riscv/mp_machdep.c ============================================================================== --- head/sys/riscv/riscv/mp_machdep.c Fri Jan 4 17:10:16 2019 (r342765) +++ head/sys/riscv/riscv/mp_machdep.c Fri Jan 4 17:14:50 2019 (r342766) @@ -227,7 +227,6 @@ init_secondary(uint64_t cpu) __asm __volatile("mv gp, %0" :: "r"(pcpup)); /* Workaround: make sure wfi doesn't halt the hart */ - intr_disable(); csr_set(sie, SIE_SSIE); csr_set(sip, SIE_SSIE); @@ -252,9 +251,6 @@ init_secondary(uint64_t cpu) /* Start per-CPU event timers. */ cpu_initclocks_ap(); - - /* Enable interrupts */ - intr_enable(); /* Enable external (PLIC) interrupts */ csr_set(sie, SIE_SEIE); From owner-svn-src-all@freebsd.org Fri Jan 4 17:25:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 112F51432E56; Fri, 4 Jan 2019 17:25: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 ADB17727B8; Fri, 4 Jan 2019 17:25:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B5513E97; Fri, 4 Jan 2019 17:25:48 +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 x04HPm0i037653; Fri, 4 Jan 2019 17:25:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04HPmIt037652; Fri, 4 Jan 2019 17:25:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901041725.x04HPmIt037652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Jan 2019 17:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342767 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 342767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADB17727B8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Jan 2019 17:25:49 -0000 Author: kib Date: Fri Jan 4 17:25:47 2019 New Revision: 342767 URL: https://svnweb.freebsd.org/changeset/base/342767 Log: x86: Report per-cpu IPI TLB shootdown generation in ddb 'show pcpu' output. It is useful for inspecting tlb shootdown hangs. The smp_tlb_generation value is available using regular ddb data inspection commands. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/db_interface.c head/sys/i386/i386/db_interface.c Modified: head/sys/amd64/amd64/db_interface.c ============================================================================== --- head/sys/amd64/amd64/db_interface.c Fri Jan 4 17:14:50 2019 (r342766) +++ head/sys/amd64/amd64/db_interface.c Fri Jan 4 17:25:47 2019 (r342767) @@ -104,4 +104,5 @@ db_show_mdpcpu(struct pcpu *pc) db_printf("gs32p = %p\n", pc->pc_gs32p); db_printf("ldt = %p\n", pc->pc_ldt); db_printf("tss = %p\n", pc->pc_tss); + db_printf("tlb gen = %u\n", pc->pc_smp_tlb_done); } Modified: head/sys/i386/i386/db_interface.c ============================================================================== --- head/sys/i386/i386/db_interface.c Fri Jan 4 17:14:50 2019 (r342766) +++ head/sys/i386/i386/db_interface.c Fri Jan 4 17:25:47 2019 (r342767) @@ -118,4 +118,5 @@ db_show_mdpcpu(struct pcpu *pc) db_printf("trampstk = 0x%x\n", pc->pc_trampstk); db_printf("kesp0 = 0x%x\n", pc->pc_kesp0); db_printf("common_tssp = 0x%x\n", (u_int)pc->pc_common_tssp); + db_printf("tlb gen = %u\n", pc->pc_smp_tlb_done); } From owner-svn-src-all@freebsd.org Fri Jan 4 17:31:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B29A81433063; Fri, 4 Jan 2019 17:31:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58F1F72C8F; Fri, 4 Jan 2019 17:31:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B0824059; Fri, 4 Jan 2019 17:31:51 +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 x04HVp4l038867; Fri, 4 Jan 2019 17:31:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04HVosS038863; Fri, 4 Jan 2019 17:31:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901041731.x04HVosS038863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Jan 2019 17:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342768 - in head: lib/libc/sys sys/kern sys/netinet sys/ofed/drivers/infiniband/ulp/sdp X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: lib/libc/sys sys/kern sys/netinet sys/ofed/drivers/infiniband/ulp/sdp X-SVN-Commit-Revision: 342768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 58F1F72C8F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 04 Jan 2019 17:31:51 -0000 Author: markj Date: Fri Jan 4 17:31:50 2019 New Revision: 342768 URL: https://svnweb.freebsd.org/changeset/base/342768 Log: Support MSG_DONTWAIT in send*(2). As it does for recv*(2), MSG_DONTWAIT indicates that the call should not block, returning EAGAIN instead. Linux and OpenBSD both implement this, so the change makes porting easier, especially since we do not return EINVAL or so when unrecognized flags are specified. Submitted by: Greg V Reviewed by: tuexen MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18728 Modified: head/lib/libc/sys/send.2 head/sys/kern/uipc_socket.c head/sys/netinet/sctp_output.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Modified: head/lib/libc/sys/send.2 ============================================================================== --- head/lib/libc/sys/send.2 Fri Jan 4 17:25:47 2019 (r342767) +++ head/lib/libc/sys/send.2 Fri Jan 4 17:31:50 2019 (r342768) @@ -28,7 +28,7 @@ .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd August 19, 2018 +.Dd January 4, 2019 .Dt SEND 2 .Os .Sh NAME @@ -121,7 +121,8 @@ argument may include one or more of the following: .Bd -literal #define MSG_OOB 0x00001 /* process out-of-band data */ #define MSG_DONTROUTE 0x00004 /* bypass routing, use direct interface */ -#define MSG_EOR 0x00008 /* data completes record */ +#define MSG_EOR 0x00008 /* data completes record */ +#define MSG_DONTWAIT 0x00080 /* do not block */ #define MSG_EOF 0x00100 /* data completes transaction */ #define MSG_NOSIGNAL 0x20000 /* do not generate SIGPIPE on EOF */ .Ed @@ -138,6 +139,9 @@ data. .Dv MSG_EOR is used to indicate a record mark for protocols which support the concept. +The +.Dv MSG_DONTWAIT +flag request the call to return when it would block otherwise. .Dv MSG_EOF requests that the sender side of a socket be shut down, and that an appropriate indication be sent at the end of the specified data; @@ -201,8 +205,9 @@ An invalid user space address was specified for an arg The socket requires that message be sent atomically, and the size of the message to be sent made this impossible. .It Bq Er EAGAIN -The socket is marked non-blocking and the requested operation -would block. +The socket is marked non-blocking, or +.Dv MSG_DONTWAIT +is specified, and the requested operation would block. .It Bq Er ENOBUFS The system was unable to allocate an internal buffer. The operation may succeed when buffers become available. Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Jan 4 17:25:47 2019 (r342767) +++ head/sys/kern/uipc_socket.c Fri Jan 4 17:31:50 2019 (r342768) @@ -1522,7 +1522,8 @@ restart: } if (space < resid + clen && (atomic || space < so->so_snd.sb_lowat || space < clen)) { - if ((so->so_state & SS_NBIO) || (flags & MSG_NBIO)) { + if ((so->so_state & SS_NBIO) || + (flags & (MSG_NBIO | MSG_DONTWAIT)) != 0) { SOCKBUF_UNLOCK(&so->so_snd); error = EWOULDBLOCK; goto release; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Jan 4 17:25:47 2019 (r342767) +++ head/sys/netinet/sctp_output.c Fri Jan 4 17:31:50 2019 (r342768) @@ -12836,7 +12836,7 @@ sctp_lower_sosend(struct socket *so, } } if (SCTP_SO_IS_NBIO(so) - || (flags & MSG_NBIO) + || (flags & (MSG_NBIO | MSG_DONTWAIT)) != 0 ) { non_blocking = 1; } Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jan 4 17:25:47 2019 (r342767) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jan 4 17:31:50 2019 (r342768) @@ -1124,7 +1124,8 @@ restart: } if (space < resid && (atomic || space < so->so_snd.sb_lowat)) { - if ((so->so_state & SS_NBIO) || (flags & MSG_NBIO)) { + if ((so->so_state & SS_NBIO) || + (flags & (MSG_NBIO | MSG_DONTWAIT)) != 0) { SOCKBUF_UNLOCK(&so->so_snd); error = EWOULDBLOCK; goto release; From owner-svn-src-all@freebsd.org Fri Jan 4 17:33:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A5E1433252; Fri, 4 Jan 2019 17:33: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 DF66872EC4; Fri, 4 Jan 2019 17:33:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D181040A7; Fri, 4 Jan 2019 17:33: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 x04HX7uD042892; Fri, 4 Jan 2019 17:33:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04HX7nD042891; Fri, 4 Jan 2019 17:33:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901041733.x04HX7nD042891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Jan 2019 17:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342769 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 342769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF66872EC4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 04 Jan 2019 17:33:08 -0000 Author: kib Date: Fri Jan 4 17:33:07 2019 New Revision: 342769 URL: https://svnweb.freebsd.org/changeset/base/342769 Log: i386: Use atomic 64bit load to read PDE value from PAE pagetables in pmap_kextract(). pmap_kextract() can race with promotion/demotion on the kernel page table, in which case current non-atomic 64bit read would see torn value, breaking pmap_kextract(). pmap_kextract() would correctly handle either promoted or demoted PDE, but not a mix where one word is from a different state. It requires PAE and > 4G memory to reproduce. We observed this in real loads, both for intensive use of malloc(9)/free(9) where vtoslab() returned invalid pointer to the slab, and with the use of busdma_bounce, where incorrect page was bounced. In collaboration with: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18714 Modified: head/sys/i386/include/pmap.h Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Fri Jan 4 17:31:50 2019 (r342768) +++ head/sys/i386/include/pmap.h Fri Jan 4 17:33:07 2019 (r342769) @@ -234,6 +234,32 @@ extern pd_entry_t *IdlePTD; /* physical address of "Id */ extern pt_entry_t *KPTmap; +#if (defined(PAE) || defined(PAE_TABLES)) + +#define pde_cmpset(pdep, old, new) atomic_cmpset_64_i586(pdep, old, new) +#define pte_load_store(ptep, pte) atomic_swap_64_i586(ptep, pte) +#define pte_load_clear(ptep) atomic_swap_64_i586(ptep, 0) +#define pte_store(ptep, pte) atomic_store_rel_64_i586(ptep, pte) +#define pte_load(ptep) atomic_load_acq_64_i586(ptep) + +extern pt_entry_t pg_nx; + +#else /* !(PAE || PAE_TABLES) */ + +#define pde_cmpset(pdep, old, new) atomic_cmpset_int(pdep, old, new) +#define pte_load_store(ptep, pte) atomic_swap_int(ptep, pte) +#define pte_load_clear(ptep) atomic_swap_int(ptep, 0) +#define pte_store(ptep, pte) do { \ + *(u_int *)(ptep) = (u_int)(pte); \ +} while (0) +#define pte_load(ptep) atomic_load_acq_int(ptep) + +#endif /* !(PAE || PAE_TABLES) */ + +#define pte_clear(ptep) pte_store(ptep, 0) + +#define pde_store(pdep, pde) pte_store(pdep, pde) + /* * Extract from the kernel page table the physical address that is mapped by * the given virtual address "va". @@ -245,7 +271,7 @@ pmap_kextract(vm_offset_t va) { vm_paddr_t pa; - if ((pa = PTD[va >> PDRSHIFT]) & PG_PS) { + if ((pa = pte_load(&PTD[va >> PDRSHIFT])) & PG_PS) { pa = (pa & PG_PS_FRAME) | (va & PDRMASK); } else { /* @@ -260,30 +286,6 @@ pmap_kextract(vm_offset_t va) } return (pa); } - -#if (defined(PAE) || defined(PAE_TABLES)) - -#define pde_cmpset(pdep, old, new) atomic_cmpset_64_i586(pdep, old, new) -#define pte_load_store(ptep, pte) atomic_swap_64_i586(ptep, pte) -#define pte_load_clear(ptep) atomic_swap_64_i586(ptep, 0) -#define pte_store(ptep, pte) atomic_store_rel_64_i586(ptep, pte) - -extern pt_entry_t pg_nx; - -#else /* !(PAE || PAE_TABLES) */ - -#define pde_cmpset(pdep, old, new) atomic_cmpset_int(pdep, old, new) -#define pte_load_store(ptep, pte) atomic_swap_int(ptep, pte) -#define pte_load_clear(ptep) atomic_swap_int(ptep, 0) -#define pte_store(ptep, pte) do { \ - *(u_int *)(ptep) = (u_int)(pte); \ -} while (0) - -#endif /* !(PAE || PAE_TABLES) */ - -#define pte_clear(ptep) pte_store(ptep, 0) - -#define pde_store(pdep, pde) pte_store(pdep, pde) #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Fri Jan 4 18:21:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2935D143478F; Fri, 4 Jan 2019 18:21:50 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C37F474EA5; Fri, 4 Jan 2019 18:21:49 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5D34484A; Fri, 4 Jan 2019 18:21:49 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04ILnEF065697; Fri, 4 Jan 2019 18:21:49 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04ILn07065695; Fri, 4 Jan 2019 18:21:49 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201901041821.x04ILn07065695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 4 Jan 2019 18:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342770 - head/sys/dev/asmc X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/sys/dev/asmc X-SVN-Commit-Revision: 342770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C37F474EA5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 04 Jan 2019 18:21:50 -0000 Author: dab Date: Fri Jan 4 18:21:49 2019 New Revision: 342770 URL: https://svnweb.freebsd.org/changeset/base/342770 Log: asmc: Patch to add MacBook Pro 9,2 support PR: 211513 Submitted by: William Theesfeld Jr Reported by: William Theesfeld Jr MFC after: 1 week Modified: head/sys/dev/asmc/asmc.c head/sys/dev/asmc/asmcvar.h Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Fri Jan 4 17:33:07 2019 (r342769) +++ head/sys/dev/asmc/asmc.c Fri Jan 4 18:21:49 2019 (r342770) @@ -231,6 +231,12 @@ struct asmc_model asmc_models[] = { }, { + "MacBookPro9,2", "Apple SMC MacBook Pro (mid 2012)", + ASMC_SMS_FUNCS_DISABLED, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, + ASMC_MBP9_TEMPS, ASMC_MBP9_TEMPNAMES, ASMC_MBP9_TEMPDESCS + }, + + { "MacBookPro11,2", "Apple SMC MacBook Pro Retina Core i7 (2013/2014)", ASMC_SMS_FUNCS_DISABLED, ASMC_FAN_FUNCS2, ASMC_LIGHT_FUNCS, ASMC_MBP112_TEMPS, ASMC_MBP112_TEMPNAMES, ASMC_MBP112_TEMPDESCS Modified: head/sys/dev/asmc/asmcvar.h ============================================================================== --- head/sys/dev/asmc/asmcvar.h Fri Jan 4 17:33:07 2019 (r342769) +++ head/sys/dev/asmc/asmcvar.h Fri Jan 4 18:21:49 2019 (r342770) @@ -257,6 +257,27 @@ struct asmc_softc { "TMBS", "TP0P", "TPCD", "TW0P", "Th1H", \ "Th2H", "Tm0P", "Ts0P", "Ts0S" } +#define ASMC_MBP9_TEMPS { "Ts0P", "Ts0S", "TA0P", "TB1T", "TB2T", \ + "TB0T", "TC1C", "TC2C", "TC0E", "TC0F", \ + "TC0J", "TC0P", "TCFC", "TCGC", "TCSA", \ + "TCTD", "TCXC", "TG1D", "TM0P", "TM0S", \ + "TPCD", NULL } + +#define ASMC_MBP9_TEMPNAMES { "Ts0P", "Ts0S", "TA0P", "TB1T", "TB2T", \ + "TB0T", "TC1C", "TC2C", "TC0E", "TC0F", \ + "TC0J", "TC0P", "TCFC", "TCGC", "TCSA", \ + "TCTD", "TCXC", "TG1D", "TM0P", "TM0S", \ + "TPCD" } + +#define ASMC_MBP9_TEMPDESCS { "Palm Rest", "Memory Proximity", "Airflow 1", \ + "Battery 1", "Battery 2", "Battery TS_MAX", \ + "CPU Core 1", "CPU Core 2", "CPU1", "CPU1", \ + "TC0J", "CPU 1 Proximity", "TCFC", \ + "PECI GPU", "PECI SA", "TCTD", "PECI CPU", \ + "GPU Die", "Memory Bank A1", "Memory Module A1", \ + "PCH Die" } + + #define ASMC_MBP112_TEMPS { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ From owner-svn-src-all@freebsd.org Fri Jan 4 18:31:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0178C1434BFD; Fri, 4 Jan 2019 18:31:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BBDA75466; Fri, 4 Jan 2019 18:31:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85B8149CC; Fri, 4 Jan 2019 18:31:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04IVJ9k071000; Fri, 4 Jan 2019 18:31:19 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04IVHa5070991; Fri, 4 Jan 2019 18:31:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201901041831.x04IVHa5070991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 4 Jan 2019 18:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342771 - in head: share/man/man4 sys/kern sys/powerpc/powernv sys/powerpc/powerpc sys/powerpc/ps3 sys/powerpc/pseries sys/sys sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man4 sys/kern sys/powerpc/powernv sys/powerpc/powerpc sys/powerpc/ps3 sys/powerpc/pseries sys/sys sys/x86/x86 X-SVN-Commit-Revision: 342771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9BBDA75466 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 04 Jan 2019 18:31:20 -0000 Author: cem Date: Fri Jan 4 18:31:17 2019 New Revision: 342771 URL: https://svnweb.freebsd.org/changeset/base/342771 Log: Expose threads-per-core and physical core count information With new sysctls (to the best of our ability do detect them). Restructured smp.4 slightly for clarity (keep relevant stuff closer to the top) while documenting. Reviewed by: markj, jhibbits (ppc parts) MFC after: 3 days Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D18322 Modified: head/share/man/man4/smp.4 head/sys/kern/subr_smp.c head/sys/powerpc/powernv/platform_powernv.c head/sys/powerpc/powerpc/mp_machdep.c head/sys/powerpc/ps3/platform_ps3.c head/sys/powerpc/pseries/platform_chrp.c head/sys/sys/smp.h head/sys/x86/x86/mp_x86.c Modified: head/share/man/man4/smp.4 ============================================================================== --- head/share/man/man4/smp.4 Fri Jan 4 18:21:49 2019 (r342770) +++ head/share/man/man4/smp.4 Fri Jan 4 18:31:17 2019 (r342771) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2018 +.Dd January 4, 2019 .Dt SMP 4 .Os .Sh NAME @@ -35,27 +35,6 @@ The .Nm kernel implements symmetric multi-processor support. -.Sh COMPATIBILITY -Support for multi-processor systems is present for all Tier-1 -architectures on -.Fx . -Currently, this includes amd64, i386 and sparc64. -Support is enabled using -.Cd options SMP . -It is permissible to use the SMP kernel configuration on non-SMP equipped -motherboards. -.Sh I386 NOTES -For i386 systems, the -.Nm -kernel supports motherboards that follow the Intel MP specification, -version 1.4. -In addition to -.Cd options SMP , -i386 also requires -.Cd device apic . -The -.Xr mptable 1 -command may be used to view the status of multi-processor support. .Pp .Nm support can be disabled by setting the loader tunable @@ -66,6 +45,13 @@ The number of CPUs detected by the system is available the read-only sysctl variable .Va hw.ncpu . .Pp +The number of online threads per CPU core is available in the read-only sysctl +variable +.Va kern.smp.threads_per_core . +The number of physical CPU cores detected by the system is available in the +read-only sysctl variable +.Va kern.smp.cores . +.Pp .Fx allows specific CPUs on a multi-processor system to be disabled. This can be done using the @@ -74,6 +60,12 @@ tunable, where X is the APIC ID of a CPU. Setting this tunable to 1 will result in the corresponding CPU being disabled. .Pp +.Fx +supports simultaneous multithreading on x86 and powerpc platforms. +On x86, the logical CPUs can be disabled by setting the +.Va machdep.hyperthreading_allowed +tunable to zero. +.Pp The .Xr sched_ule 4 scheduler implements CPU topology detection and adjusts the scheduling @@ -122,13 +114,26 @@ two quad-core processors is: .Pp This information is used internally by the kernel to schedule related tasks on CPUs that are closely grouped together. -.Pp -.Fx -supports hyperthreading on Intel CPU's on the i386 and AMD64 platforms. -Because using logical CPUs can cause performance penalties under certain loads, -the logical CPUs can be disabled by setting the -.Va machdep.hyperthreading_allowed -tunable to zero. +.Sh COMPATIBILITY +Support for multi-processor systems is present for all Tier-1 and Tier-2 +architectures on +.Fx . +Currently, this includes x86, powerpc, arm, and sparc64. +Support is enabled using +.Cd options SMP . +It is permissible to use the SMP kernel configuration on non-SMP hardware. +.Sh I386 NOTES +For i386 systems, the +.Nm +kernel supports motherboards that follow the Intel MP specification, +version 1.4. +In addition to +.Cd options SMP , +i386 also requires +.Cd device apic . +The +.Xr mptable 1 +command may be used to view the status of multi-processor support. .Sh SEE ALSO .Xr cpuset 1 , .Xr mptable 1 , @@ -166,3 +171,20 @@ in also introduced support for SMP on the sparc64 architecture. .Sh AUTHORS .An Steve Passe Aq Mt fsmp@FreeBSD.org +.Sh CAVEATS +The +.Va kern.smp.threads_per_core +and +.Va kern.smp.cores +sysctl variables are provided as a best-effort guess. +If an architecture or platform adds SMT and +.Fx +has not yet implemented detection, the reported values may be inaccurate. +In this case, +.Va kern.smp.threads_per_core +will report +.Dv 1 +and +.Va kern.smp.cores +will report the same value as +.Va hw.ncpu . Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/kern/subr_smp.c Fri Jan 4 18:31:17 2019 (r342771) @@ -98,6 +98,14 @@ int smp_cpus = 1; /* how many cpu's running */ SYSCTL_INT(_kern_smp, OID_AUTO, cpus, CTLFLAG_RD|CTLFLAG_CAPRD, &smp_cpus, 0, "Number of CPUs online"); +int smp_threads_per_core = 1; /* how many SMT threads are running per core */ +SYSCTL_INT(_kern_smp, OID_AUTO, threads_per_core, CTLFLAG_RD|CTLFLAG_CAPRD, + &smp_threads_per_core, 0, "Number of SMT threads online per core"); + +int mp_ncores = -1; /* how many physical cores running */ +SYSCTL_INT(_kern_smp, OID_AUTO, cores, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_ncores, 0, + "Number of CPUs online"); + int smp_topology = 0; /* Which topology we're using. */ SYSCTL_INT(_kern_smp, OID_AUTO, topology, CTLFLAG_RDTUN, &smp_topology, 0, "Topology override setting; 0 is default provided by hardware."); @@ -154,6 +162,7 @@ mp_start(void *dummy) /* Probe for MP hardware. */ if (smp_disabled != 0 || cpu_mp_probe() == 0) { + mp_ncores = 1; mp_ncpus = 1; CPU_SETOF(PCPU_GET(cpuid), &all_cpus); return; @@ -162,6 +171,11 @@ mp_start(void *dummy) cpu_mp_start(); printf("FreeBSD/SMP: Multiprocessor System Detected: %d CPUs\n", mp_ncpus); + + /* Provide a default for most architectures that don't have SMT/HTT. */ + if (mp_ncores < 0) + mp_ncores = mp_ncpus; + cpu_mp_announce(); } SYSINIT(cpu_mp, SI_SUB_CPU, SI_ORDER_THIRD, mp_start, NULL); @@ -823,6 +837,7 @@ static void mp_setvariables_for_up(void *dummy) { mp_ncpus = 1; + mp_ncores = 1; mp_maxid = PCPU_GET(cpuid); CPU_SETOF(mp_maxid, &all_cpus); KASSERT(PCPU_GET(cpuid) == 0, ("UP must have a CPU ID of zero")); Modified: head/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- head/sys/powerpc/powernv/platform_powernv.c Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/powerpc/powernv/platform_powernv.c Fri Jan 4 18:31:17 2019 (r342771) @@ -435,12 +435,16 @@ powernv_smp_topo(platform_t plat) break; } + smp_threads_per_core = nthreads; + if (mp_ncpus % nthreads != 0) { printf("WARNING: Irregular SMP topology. Performance may be " "suboptimal (%d threads, %d on first core)\n", mp_ncpus, nthreads); return (smp_topo_none()); } + + mp_ncores = mp_ncpus / nthreads; /* Don't do anything fancier for non-threaded SMP */ if (nthreads == 1) Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/powerpc/powerpc/mp_machdep.c Fri Jan 4 18:31:17 2019 (r342771) @@ -186,6 +186,11 @@ cpu_mp_start(void) next: error = platform_smp_next_cpu(&cpu); } + +#ifdef SMP + /* Probe mp_ncores and smp_threads_per_core as a side effect. */ + (void)cpu_topo(); +#endif } void Modified: head/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- head/sys/powerpc/ps3/platform_ps3.c Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/powerpc/ps3/platform_ps3.c Fri Jan 4 18:31:17 2019 (r342771) @@ -246,6 +246,8 @@ ps3_smp_start_cpu(platform_t plat, struct pcpu *pc) static struct cpu_group * ps3_smp_topo(platform_t plat) { + mp_ncores = 1; + smp_threads_per_core = 2; return (smp_topo_1level(CG_SHARE_L1, 2, CG_FLAG_SMT)); } #endif Modified: head/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- head/sys/powerpc/pseries/platform_chrp.c Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/powerpc/pseries/platform_chrp.c Fri Jan 4 18:31:17 2019 (r342771) @@ -517,6 +517,8 @@ chrp_smp_topo(platform_t plat) ncpus++; } + mp_ncores = ncores; + if (ncpus % ncores != 0) { printf("WARNING: Irregular SMP topology. Performance may be " "suboptimal (%d CPUS, %d cores)\n", ncpus, ncores); @@ -527,6 +529,7 @@ chrp_smp_topo(platform_t plat) if (ncpus == ncores) return (smp_topo_none()); + smp_threads_per_core = ncpus / ncores; return (smp_topo_1level(CG_SHARE_L1, ncpus / ncores, CG_FLAG_SMT)); } #endif Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/sys/smp.h Fri Jan 4 18:31:17 2019 (r342771) @@ -167,8 +167,10 @@ extern cpuset_t logical_cpus_mask; extern u_int mp_maxid; extern int mp_maxcpus; +extern int mp_ncores; extern int mp_ncpus; extern volatile int smp_started; +extern int smp_threads_per_core; extern cpuset_t all_cpus; extern cpuset_t cpuset_domain[MAXMEMDOM]; /* CPUs in each NUMA domain. */ Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/x86/x86/mp_x86.c Fri Jan 4 18:31:17 2019 (r342771) @@ -607,6 +607,7 @@ assign_cpu_ids(void) { struct topo_node *node; u_int smt_mask; + int nhyper; smt_mask = (1u << core_id_shift) - 1; @@ -615,6 +616,7 @@ assign_cpu_ids(void) * beyond MAXCPU. CPU 0 is always assigned to the BSP. */ mp_ncpus = 0; + nhyper = 0; TOPO_FOREACH(node, &topo_root) { if (node->type != TOPO_TYPE_PU) continue; @@ -642,6 +644,9 @@ assign_cpu_ids(void) continue; } + if (cpu_info[node->hwid].cpu_hyperthread) + nhyper++; + cpu_apic_ids[mp_ncpus] = node->hwid; apic_cpuids[node->hwid] = mp_ncpus; topo_set_pu_id(node, mp_ncpus); @@ -651,6 +656,9 @@ assign_cpu_ids(void) KASSERT(mp_maxid >= mp_ncpus - 1, ("%s: counters out of sync: max %d, count %d", __func__, mp_maxid, mp_ncpus)); + + mp_ncores = mp_ncpus - nhyper; + smp_threads_per_core = mp_ncpus / mp_ncores; } /* From owner-svn-src-all@freebsd.org Fri Jan 4 18:34:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BE0F1434E61; Fri, 4 Jan 2019 18:34:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2ACA75898; Fri, 4 Jan 2019 18:34:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F8FE4B40; Fri, 4 Jan 2019 18:34:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04IYidu074154; Fri, 4 Jan 2019 18:34:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04IYicA074153; Fri, 4 Jan 2019 18:34:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201901041834.x04IYicA074153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 4 Jan 2019 18:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342772 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 342772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B2ACA75898 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Jan 2019 18:34:45 -0000 Author: cem Date: Fri Jan 4 18:34:44 2019 New Revision: 342772 URL: https://svnweb.freebsd.org/changeset/base/342772 Log: Bump __FreeBSD_version for r342771 Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Jan 4 18:31:17 2019 (r342771) +++ head/sys/sys/param.h Fri Jan 4 18:34:44 2019 (r342772) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300007 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300008 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri Jan 4 18:35:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A4A81434EE7; Fri, 4 Jan 2019 18:35:26 +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 410FA75A1C; Fri, 4 Jan 2019 18:35:26 +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 30B8F4B42; Fri, 4 Jan 2019 18:35:26 +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 x04IZQgH074241; Fri, 4 Jan 2019 18:35:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04IZQsb074240; Fri, 4 Jan 2019 18:35:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901041835.x04IZQsb074240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 4 Jan 2019 18:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342773 - head/lib/csu/tests X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/csu/tests X-SVN-Commit-Revision: 342773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 410FA75A1C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Jan 2019 18:35:26 -0000 Author: emaste Date: Fri Jan 4 18:35:25 2019 New Revision: 342773 URL: https://svnweb.freebsd.org/changeset/base/342773 Log: Add explicit csu test dependency lib/csu/tests/dynamiclib requires libh_csu.so be built first. I'm not sure this is the most correct/best way to address this but it solves the issue in my testing. PR: 233734 Sponsored by: The FreeBSD Foundation Modified: head/lib/csu/tests/Makefile Modified: head/lib/csu/tests/Makefile ============================================================================== --- head/lib/csu/tests/Makefile Fri Jan 4 18:34:44 2019 (r342772) +++ head/lib/csu/tests/Makefile Fri Jan 4 18:35:25 2019 (r342773) @@ -5,4 +5,6 @@ TESTS_SUBDIRS= dynamic TESTS_SUBDIRS+= dynamiclib TESTS_SUBDIRS+= static +SUBDIR_DEPEND_dynamiclib=dso + .include From owner-svn-src-all@freebsd.org Fri Jan 4 18:38:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A066F143513E; Fri, 4 Jan 2019 18:38:28 +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 4589B75DB0; Fri, 4 Jan 2019 18:38:28 +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 336D14B44; Fri, 4 Jan 2019 18:38:28 +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 x04IcSni074419; Fri, 4 Jan 2019 18:38:28 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04IcSXf074418; Fri, 4 Jan 2019 18:38:28 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201901041838.x04IcSXf074418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Fri, 4 Jan 2019 18:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342774 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 342774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4589B75DB0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Jan 2019 18:38:29 -0000 Author: gallatin Date: Fri Jan 4 18:38:27 2019 New Revision: 342774 URL: https://svnweb.freebsd.org/changeset/base/342774 Log: Limit git history searches in newvers.sh newvers.sh takes upwards of 4-5 seconds to complete on trees checked out from github, due to searching the entire history for non-existent git-svn metadata. Similarly, if one does not check out notes, we again search the entire history for notes. That makes newvers.sh very slow for many github users. To fix this in a fair way, limit the history search to the last 10K commits: if you're more than 10K commits out of sync, then you've forked the project, and our SVN rev is no longer very important to you. Due to how git implements --grep in conjunction with -n, --grep has been removed for performance reasons (git does not seem to limit its search to the -n limit in this case, and takes just as long as it did with no limit). Reviewed by: emaste, imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18745 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri Jan 4 18:35:25 2019 (r342773) +++ head/sys/conf/newvers.sh Fri Jan 4 18:38:27 2019 (r342774) @@ -243,11 +243,15 @@ if [ -n "$git_cmd" ] ; then svn=" r${gitsvn}" git="=${git}" else - gitsvn=`$git_cmd log --grep '^git-svn-id:' | \ +# Log searches are limited to 10k commits to speed up failures. +# We assume that if a tree is more than 10k commits out-of-sync +# with FreeBSD, it has forked the the OS and the SVN rev no +# longer matters. + gitsvn=`$git_cmd log -n 10000 | grep '^ git-svn-id:' | head -1 | \ sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` if [ -z "$gitsvn" ] ; then - gitsvn=`$git_cmd log --format='format:%N' | \ + gitsvn=`$git_cmd log -n 10000 --format='format:%N' | \ grep '^svn ' | head -1 | \ sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'` fi From owner-svn-src-all@freebsd.org Fri Jan 4 19:07:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B1181435DA4; Fri, 4 Jan 2019 19:07:31 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B519576F78; Fri, 4 Jan 2019 19:07:30 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x04J7R7K084675; Fri, 4 Jan 2019 11:07:27 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x04J7Rse084674; Fri, 4 Jan 2019 11:07:27 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901041907.x04J7Rse084674@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r342771 - in head: share/man/man4 sys/kern sys/powerpc/powernv sys/powerpc/powerpc sys/powerpc/ps3 sys/powerpc/pseries sys/sys sys/x86/x86 In-Reply-To: <201901041831.x04IVHa5070991@repo.freebsd.org> To: Conrad Meyer Date: Fri, 4 Jan 2019 11:07:27 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: B519576F78 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; REPLY(-4.00)[]; 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, 04 Jan 2019 19:07:31 -0000 > Author: cem > Date: Fri Jan 4 18:31:17 2019 > New Revision: 342771 > URL: https://svnweb.freebsd.org/changeset/base/342771 > > Log: > Expose threads-per-core and physical core count information > > With new sysctls (to the best of our ability do detect them). Restructured > smp.4 slightly for clarity (keep relevant stuff closer to the top) while > documenting. > > Reviewed by: markj, jhibbits (ppc parts) > MFC after: 3 days > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D18322 > > Modified: > head/share/man/man4/smp.4 > head/sys/kern/subr_smp.c > head/sys/powerpc/powernv/platform_powernv.c > head/sys/powerpc/powerpc/mp_machdep.c > head/sys/powerpc/ps3/platform_ps3.c > head/sys/powerpc/pseries/platform_chrp.c > head/sys/sys/smp.h > head/sys/x86/x86/mp_x86.c Can you please alter this to match how topology is expressed by most tools, Sockets, Cores per socket, Threads per core. ncpu = S * C * T This matches how bhyve, qemu, kvm and others express this information. Thanks, Rod > Modified: head/share/man/man4/smp.4 > ============================================================================== > --- head/share/man/man4/smp.4 Fri Jan 4 18:21:49 2019 (r342770) > +++ head/share/man/man4/smp.4 Fri Jan 4 18:31:17 2019 (r342771) > @@ -23,7 +23,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January 6, 2018 > +.Dd January 4, 2019 > .Dt SMP 4 > .Os > .Sh NAME > @@ -35,27 +35,6 @@ > The > .Nm > kernel implements symmetric multi-processor support. > -.Sh COMPATIBILITY > -Support for multi-processor systems is present for all Tier-1 > -architectures on > -.Fx . > -Currently, this includes amd64, i386 and sparc64. > -Support is enabled using > -.Cd options SMP . > -It is permissible to use the SMP kernel configuration on non-SMP equipped > -motherboards. > -.Sh I386 NOTES > -For i386 systems, the > -.Nm > -kernel supports motherboards that follow the Intel MP specification, > -version 1.4. > -In addition to > -.Cd options SMP , > -i386 also requires > -.Cd device apic . > -The > -.Xr mptable 1 > -command may be used to view the status of multi-processor support. > .Pp > .Nm > support can be disabled by setting the loader tunable > @@ -66,6 +45,13 @@ The number of CPUs detected by the system is available > the read-only sysctl variable > .Va hw.ncpu . > .Pp > +The number of online threads per CPU core is available in the read-only sysctl > +variable > +.Va kern.smp.threads_per_core . > +The number of physical CPU cores detected by the system is available in the > +read-only sysctl variable > +.Va kern.smp.cores . > +.Pp > .Fx > allows specific CPUs on a multi-processor system to be disabled. > This can be done using the > @@ -74,6 +60,12 @@ tunable, where X is the APIC ID of a CPU. > Setting this tunable to 1 will result in the corresponding CPU being > disabled. > .Pp > +.Fx > +supports simultaneous multithreading on x86 and powerpc platforms. > +On x86, the logical CPUs can be disabled by setting the > +.Va machdep.hyperthreading_allowed > +tunable to zero. > +.Pp > The > .Xr sched_ule 4 > scheduler implements CPU topology detection and adjusts the scheduling > @@ -122,13 +114,26 @@ two quad-core processors is: > .Pp > This information is used internally by the kernel to schedule related > tasks on CPUs that are closely grouped together. > -.Pp > -.Fx > -supports hyperthreading on Intel CPU's on the i386 and AMD64 platforms. > -Because using logical CPUs can cause performance penalties under certain loads, > -the logical CPUs can be disabled by setting the > -.Va machdep.hyperthreading_allowed > -tunable to zero. > +.Sh COMPATIBILITY > +Support for multi-processor systems is present for all Tier-1 and Tier-2 > +architectures on > +.Fx . > +Currently, this includes x86, powerpc, arm, and sparc64. > +Support is enabled using > +.Cd options SMP . > +It is permissible to use the SMP kernel configuration on non-SMP hardware. > +.Sh I386 NOTES > +For i386 systems, the > +.Nm > +kernel supports motherboards that follow the Intel MP specification, > +version 1.4. > +In addition to > +.Cd options SMP , > +i386 also requires > +.Cd device apic . > +The > +.Xr mptable 1 > +command may be used to view the status of multi-processor support. > .Sh SEE ALSO > .Xr cpuset 1 , > .Xr mptable 1 , > @@ -166,3 +171,20 @@ in > also introduced support for SMP on the sparc64 architecture. > .Sh AUTHORS > .An Steve Passe Aq Mt fsmp@FreeBSD.org > +.Sh CAVEATS > +The > +.Va kern.smp.threads_per_core > +and > +.Va kern.smp.cores > +sysctl variables are provided as a best-effort guess. > +If an architecture or platform adds SMT and > +.Fx > +has not yet implemented detection, the reported values may be inaccurate. > +In this case, > +.Va kern.smp.threads_per_core > +will report > +.Dv 1 > +and > +.Va kern.smp.cores > +will report the same value as > +.Va hw.ncpu . > > Modified: head/sys/kern/subr_smp.c > ============================================================================== > --- head/sys/kern/subr_smp.c Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/kern/subr_smp.c Fri Jan 4 18:31:17 2019 (r342771) > @@ -98,6 +98,14 @@ int smp_cpus = 1; /* how many cpu's running */ > SYSCTL_INT(_kern_smp, OID_AUTO, cpus, CTLFLAG_RD|CTLFLAG_CAPRD, &smp_cpus, 0, > "Number of CPUs online"); > > +int smp_threads_per_core = 1; /* how many SMT threads are running per core */ > +SYSCTL_INT(_kern_smp, OID_AUTO, threads_per_core, CTLFLAG_RD|CTLFLAG_CAPRD, > + &smp_threads_per_core, 0, "Number of SMT threads online per core"); > + > +int mp_ncores = -1; /* how many physical cores running */ > +SYSCTL_INT(_kern_smp, OID_AUTO, cores, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_ncores, 0, > + "Number of CPUs online"); > + > int smp_topology = 0; /* Which topology we're using. */ > SYSCTL_INT(_kern_smp, OID_AUTO, topology, CTLFLAG_RDTUN, &smp_topology, 0, > "Topology override setting; 0 is default provided by hardware."); > @@ -154,6 +162,7 @@ mp_start(void *dummy) > > /* Probe for MP hardware. */ > if (smp_disabled != 0 || cpu_mp_probe() == 0) { > + mp_ncores = 1; > mp_ncpus = 1; > CPU_SETOF(PCPU_GET(cpuid), &all_cpus); > return; > @@ -162,6 +171,11 @@ mp_start(void *dummy) > cpu_mp_start(); > printf("FreeBSD/SMP: Multiprocessor System Detected: %d CPUs\n", > mp_ncpus); > + > + /* Provide a default for most architectures that don't have SMT/HTT. */ > + if (mp_ncores < 0) > + mp_ncores = mp_ncpus; > + > cpu_mp_announce(); > } > SYSINIT(cpu_mp, SI_SUB_CPU, SI_ORDER_THIRD, mp_start, NULL); > @@ -823,6 +837,7 @@ static void > mp_setvariables_for_up(void *dummy) > { > mp_ncpus = 1; > + mp_ncores = 1; > mp_maxid = PCPU_GET(cpuid); > CPU_SETOF(mp_maxid, &all_cpus); > KASSERT(PCPU_GET(cpuid) == 0, ("UP must have a CPU ID of zero")); > > Modified: head/sys/powerpc/powernv/platform_powernv.c > ============================================================================== > --- head/sys/powerpc/powernv/platform_powernv.c Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/powerpc/powernv/platform_powernv.c Fri Jan 4 18:31:17 2019 (r342771) > @@ -435,12 +435,16 @@ powernv_smp_topo(platform_t plat) > break; > } > > + smp_threads_per_core = nthreads; > + > if (mp_ncpus % nthreads != 0) { > printf("WARNING: Irregular SMP topology. Performance may be " > "suboptimal (%d threads, %d on first core)\n", > mp_ncpus, nthreads); > return (smp_topo_none()); > } > + > + mp_ncores = mp_ncpus / nthreads; > > /* Don't do anything fancier for non-threaded SMP */ > if (nthreads == 1) > > Modified: head/sys/powerpc/powerpc/mp_machdep.c > ============================================================================== > --- head/sys/powerpc/powerpc/mp_machdep.c Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/powerpc/powerpc/mp_machdep.c Fri Jan 4 18:31:17 2019 (r342771) > @@ -186,6 +186,11 @@ cpu_mp_start(void) > next: > error = platform_smp_next_cpu(&cpu); > } > + > +#ifdef SMP > + /* Probe mp_ncores and smp_threads_per_core as a side effect. */ > + (void)cpu_topo(); > +#endif > } > > void > > Modified: head/sys/powerpc/ps3/platform_ps3.c > ============================================================================== > --- head/sys/powerpc/ps3/platform_ps3.c Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/powerpc/ps3/platform_ps3.c Fri Jan 4 18:31:17 2019 (r342771) > @@ -246,6 +246,8 @@ ps3_smp_start_cpu(platform_t plat, struct pcpu *pc) > static struct cpu_group * > ps3_smp_topo(platform_t plat) > { > + mp_ncores = 1; > + smp_threads_per_core = 2; > return (smp_topo_1level(CG_SHARE_L1, 2, CG_FLAG_SMT)); > } > #endif > > Modified: head/sys/powerpc/pseries/platform_chrp.c > ============================================================================== > --- head/sys/powerpc/pseries/platform_chrp.c Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/powerpc/pseries/platform_chrp.c Fri Jan 4 18:31:17 2019 (r342771) > @@ -517,6 +517,8 @@ chrp_smp_topo(platform_t plat) > ncpus++; > } > > + mp_ncores = ncores; > + > if (ncpus % ncores != 0) { > printf("WARNING: Irregular SMP topology. Performance may be " > "suboptimal (%d CPUS, %d cores)\n", ncpus, ncores); > @@ -527,6 +529,7 @@ chrp_smp_topo(platform_t plat) > if (ncpus == ncores) > return (smp_topo_none()); > > + smp_threads_per_core = ncpus / ncores; > return (smp_topo_1level(CG_SHARE_L1, ncpus / ncores, CG_FLAG_SMT)); > } > #endif > > Modified: head/sys/sys/smp.h > ============================================================================== > --- head/sys/sys/smp.h Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/sys/smp.h Fri Jan 4 18:31:17 2019 (r342771) > @@ -167,8 +167,10 @@ extern cpuset_t logical_cpus_mask; > > extern u_int mp_maxid; > extern int mp_maxcpus; > +extern int mp_ncores; > extern int mp_ncpus; > extern volatile int smp_started; > +extern int smp_threads_per_core; > > extern cpuset_t all_cpus; > extern cpuset_t cpuset_domain[MAXMEMDOM]; /* CPUs in each NUMA domain. */ > > Modified: head/sys/x86/x86/mp_x86.c > ============================================================================== > --- head/sys/x86/x86/mp_x86.c Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/x86/x86/mp_x86.c Fri Jan 4 18:31:17 2019 (r342771) > @@ -607,6 +607,7 @@ assign_cpu_ids(void) > { > struct topo_node *node; > u_int smt_mask; > + int nhyper; > > smt_mask = (1u << core_id_shift) - 1; > > @@ -615,6 +616,7 @@ assign_cpu_ids(void) > * beyond MAXCPU. CPU 0 is always assigned to the BSP. > */ > mp_ncpus = 0; > + nhyper = 0; > TOPO_FOREACH(node, &topo_root) { > if (node->type != TOPO_TYPE_PU) > continue; > @@ -642,6 +644,9 @@ assign_cpu_ids(void) > continue; > } > > + if (cpu_info[node->hwid].cpu_hyperthread) > + nhyper++; > + > cpu_apic_ids[mp_ncpus] = node->hwid; > apic_cpuids[node->hwid] = mp_ncpus; > topo_set_pu_id(node, mp_ncpus); > @@ -651,6 +656,9 @@ assign_cpu_ids(void) > KASSERT(mp_maxid >= mp_ncpus - 1, > ("%s: counters out of sync: max %d, count %d", __func__, mp_maxid, > mp_ncpus)); > + > + mp_ncores = mp_ncpus - nhyper; > + smp_threads_per_core = mp_ncpus / mp_ncores; > } > > /* > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 4 19:10:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E8AC1435FE2; Fri, 4 Jan 2019 19:10:47 +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 45A1A77351; Fri, 4 Jan 2019 19:10:47 +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 36981508B; Fri, 4 Jan 2019 19:10:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04JAlrX090624; Fri, 4 Jan 2019 19:10:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04JAlmu090623; Fri, 4 Jan 2019 19:10:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901041910.x04JAlmu090623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Jan 2019 19:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342775 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 342775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45A1A77351 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 04 Jan 2019 19:10:47 -0000 Author: kib Date: Fri Jan 4 19:10:46 2019 New Revision: 342775 URL: https://svnweb.freebsd.org/changeset/base/342775 Log: Fix i386 LINT build after r342769. It seems that libkern/mcount.c is the only consumer of vm/pmap.h that does not include machine/atomic.h. Make it work by bringing machine/atomic.h when pmap.h is used for kernel non-asm .c file. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/include/pmap.h Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Fri Jan 4 18:38:27 2019 (r342774) +++ head/sys/i386/include/pmap.h Fri Jan 4 19:10:46 2019 (r342775) @@ -194,6 +194,8 @@ typedef uint32_t pt_entry_t; * Address of current address space page table maps and directories. */ #ifdef _KERNEL +#include + extern pt_entry_t PTmap[]; extern pd_entry_t PTD[]; extern pd_entry_t PTDpde[]; From owner-svn-src-all@freebsd.org Fri Jan 4 19:20:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98990143646C; Fri, 4 Jan 2019 19:20:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F79677A03; Fri, 4 Jan 2019 19:20:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30B59521E; Fri, 4 Jan 2019 19:20:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04JKKmo095598; Fri, 4 Jan 2019 19:20:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04JKKpN095597; Fri, 4 Jan 2019 19:20:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901041920.x04JKKpN095597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Jan 2019 19:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342776 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 342776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F79677A03 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Jan 2019 19:20:20 -0000 Author: markj Date: Fri Jan 4 19:20:19 2019 New Revision: 342776 URL: https://svnweb.freebsd.org/changeset/base/342776 Log: Disable savecore(8)'s libcasper support when WITHOUT_DYNAMICROOT=yes. This follows the example of other Capsicumized programs in /sbin. Reported by: Manfred Antar MFC with: r342699 Sponsored by: The FreeBSD Foundation Modified: head/sbin/savecore/Makefile Modified: head/sbin/savecore/Makefile ============================================================================== --- head/sbin/savecore/Makefile Fri Jan 4 19:10:46 2019 (r342775) +++ head/sbin/savecore/Makefile Fri Jan 4 19:20:19 2019 (r342776) @@ -11,7 +11,9 @@ MAN= savecore.8 .include -.if ${MK_CASPER} != "no" && !defined(RESCUE) +.if ${MK_DYNAMICROOT} == "no" +.warning ${PROG} built without libcasper support +.elif ${MK_CASPER} != "no" && !defined(RESCUE) CFLAGS+= -DWITH_CASPER LIBADD+= casper cap_fileargs cap_syslog .endif From owner-svn-src-all@freebsd.org Fri Jan 4 21:05:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EC151439D54; Fri, 4 Jan 2019 21:05:41 +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 29AEC84709; Fri, 4 Jan 2019 21:05:41 +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 E60D3647A; Fri, 4 Jan 2019 21:05:40 +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 x04L5enD054652; Fri, 4 Jan 2019 21:05:40 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04L5e02054650; Fri, 4 Jan 2019 21:05:40 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201901042105.x04L5e02054650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Fri, 4 Jan 2019 21:05: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: r342777 - in stable/12/sys: cam/nvme dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: in stable/12/sys: cam/nvme dev/nvme X-SVN-Commit-Revision: 342777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 29AEC84709 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.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 04 Jan 2019 21:05:41 -0000 Author: chuck Date: Fri Jan 4 21:05:40 2019 New Revision: 342777 URL: https://svnweb.freebsd.org/changeset/base/342777 Log: MFC r342046: nda(4) fix check for Dataset Management support Reported by: yuripv@yuripv.net Reviewed by: imp Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D18746 Modified: stable/12/sys/cam/nvme/nvme_da.c stable/12/sys/dev/nvme/nvme.h stable/12/sys/dev/nvme/nvme_ns.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/nvme/nvme_da.c ============================================================================== --- stable/12/sys/cam/nvme/nvme_da.c Fri Jan 4 19:20:19 2019 (r342776) +++ stable/12/sys/cam/nvme/nvme_da.c Fri Jan 4 21:05:40 2019 (r342777) @@ -787,7 +787,7 @@ ndaregister(struct cam_periph *periph, void *arg) disk->d_mediasize = (off_t)(disk->d_sectorsize * nsd->nsze); disk->d_delmaxsize = disk->d_mediasize; disk->d_flags = DISKFLAG_DIRECT_COMPLETION; -// if (cd->oncs.dsm) // XXX broken? + if (nvme_ctrlr_has_dataset_mgmt(cd)) disk->d_flags |= DISKFLAG_CANDELETE; vwc_present = (cd->vwc >> NVME_CTRLR_DATA_VWC_PRESENT_SHIFT) & NVME_CTRLR_DATA_VWC_PRESENT_MASK; Modified: stable/12/sys/dev/nvme/nvme.h ============================================================================== --- stable/12/sys/dev/nvme/nvme.h Fri Jan 4 19:20:19 2019 (r342776) +++ stable/12/sys/dev/nvme/nvme.h Fri Jan 4 21:05:40 2019 (r342777) @@ -1259,6 +1259,13 @@ void nvme_unregister_consumer(struct nvme_consumer *c device_t nvme_ctrlr_get_device(struct nvme_controller *ctrlr); const struct nvme_controller_data * nvme_ctrlr_get_data(struct nvme_controller *ctrlr); +static inline bool +nvme_ctrlr_has_dataset_mgmt(const struct nvme_controller_data *cd) +{ + /* Assumes cd was byte swapped by nvme_controller_data_swapbytes() */ + return ((cd->oncs >> NVME_CTRLR_DATA_ONCS_DSM_SHIFT) & + NVME_CTRLR_DATA_ONCS_DSM_MASK); +} /* Namespace helper functions */ uint32_t nvme_ns_get_max_io_xfer_size(struct nvme_namespace *ns); Modified: stable/12/sys/dev/nvme/nvme_ns.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ns.c Fri Jan 4 19:20:19 2019 (r342776) +++ stable/12/sys/dev/nvme/nvme_ns.c Fri Jan 4 21:05:40 2019 (r342777) @@ -498,8 +498,6 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t struct nvme_completion_poll_status status; int res; int unit; - uint16_t oncs; - uint8_t dsm; uint8_t flbas_fmt; uint8_t vwc_present; @@ -569,9 +567,7 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t return (ENXIO); } - oncs = ctrlr->cdata.oncs; - dsm = (oncs >> NVME_CTRLR_DATA_ONCS_DSM_SHIFT) & NVME_CTRLR_DATA_ONCS_DSM_MASK; - if (dsm) + if (nvme_ctrlr_has_dataset_mgmt(&ctrlr->cdata)) ns->flags |= NVME_NS_DEALLOCATE_SUPPORTED; vwc_present = (ctrlr->cdata.vwc >> NVME_CTRLR_DATA_VWC_PRESENT_SHIFT) & From owner-svn-src-all@freebsd.org Fri Jan 4 21:09:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADD8B1439EF4; Fri, 4 Jan 2019 21:09:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54BA2849E4; Fri, 4 Jan 2019 21:09:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B91D6481; Fri, 4 Jan 2019 21:09:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04L9d1Y054985; Fri, 4 Jan 2019 21:09:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04L9ced054983; Fri, 4 Jan 2019 21:09:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901042109.x04L9ced054983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 4 Jan 2019 21:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342778 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 342778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54BA2849E4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.970,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)[-0.999,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, 04 Jan 2019 21:09:39 -0000 Author: hselasky Date: Fri Jan 4 21:09:38 2019 New Revision: 342778 URL: https://svnweb.freebsd.org/changeset/base/342778 Log: Reduce timeout for reading the USB HUB port status to 1000ms and try to filter out dead USB HUB devices by implementing an error counter, so that the USB enumeration thread does not spend all its time reading from non-responding devices, blocking user-space access in the end. Tested by: Matthias Apitz MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Fri Jan 4 21:05:40 2019 (r342777) +++ head/sys/dev/usb/usb_hub.c Fri Jan 4 21:09:38 2019 (r342778) @@ -129,6 +129,8 @@ struct uhub_softc { int sc_disable_enumeration; int sc_disable_port_power; #endif + uint8_t sc_usb_port_errors; /* error counter */ +#define UHUB_USB_PORT_ERRORS_MAX 4 uint8_t sc_flags; #define UHUB_FLAG_DID_EXPLORE 0x01 }; @@ -587,13 +589,25 @@ uhub_read_port_status(struct uhub_softc *sc, uint8_t p struct usb_port_status ps; usb_error_t err; + if (sc->sc_usb_port_errors >= UHUB_USB_PORT_ERRORS_MAX) { + DPRINTFN(4, "port %d, HUB looks dead, too many errors\n", portno); + sc->sc_st.port_status = 0; + sc->sc_st.port_change = 0; + return (USB_ERR_TIMEOUT); + } + err = usbd_req_get_port_status( sc->sc_udev, NULL, &ps, portno); - /* update status regardless of error */ - - sc->sc_st.port_status = UGETW(ps.wPortStatus); - sc->sc_st.port_change = UGETW(ps.wPortChange); + if (err == 0) { + sc->sc_st.port_status = UGETW(ps.wPortStatus); + sc->sc_st.port_change = UGETW(ps.wPortChange); + sc->sc_usb_port_errors = 0; + } else { + sc->sc_st.port_status = 0; + sc->sc_st.port_change = 0; + sc->sc_usb_port_errors++; + } /* debugging print */ Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Fri Jan 4 21:05:40 2019 (r342777) +++ head/sys/dev/usb/usb_request.c Fri Jan 4 21:09:38 2019 (r342778) @@ -1601,8 +1601,9 @@ usbd_req_get_port_status(struct usb_device *udev, stru USETW(req.wValue, 0); req.wIndex[0] = port; req.wIndex[1] = 0; - USETW(req.wLength, sizeof *ps); - return (usbd_do_request(udev, mtx, &req, ps)); + USETW(req.wLength, sizeof(*ps)); + + return (usbd_do_request_flags(udev, mtx, &req, ps, 0, NULL, 1000)); } /*------------------------------------------------------------------------* From owner-svn-src-all@freebsd.org Fri Jan 4 21:12:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA0DE143A1A0; Fri, 4 Jan 2019 21:12:18 +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 7A72784E90; Fri, 4 Jan 2019 21:12:18 +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 6C8A5661E; Fri, 4 Jan 2019 21:12:18 +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 x04LCIDP056629; Fri, 4 Jan 2019 21:12:18 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04LCItG056628; Fri, 4 Jan 2019 21:12:18 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901042112.x04LCItG056628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 4 Jan 2019 21:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342779 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7A72784E90 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 04 Jan 2019 21:12:19 -0000 Author: kp Date: Fri Jan 4 21:12:17 2019 New Revision: 342779 URL: https://svnweb.freebsd.org/changeset/base/342779 Log: Remove unneeded NULL check for td_ucred td_ucred is always set, so we don't need the ternary expression to check for it. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Fri Jan 4 21:09:38 2019 (r342778) +++ head/sys/kern/kern_sig.c Fri Jan 4 21:12:17 2019 (r342779) @@ -3100,7 +3100,7 @@ killproc(struct proc *p, char *why) p->p_comm); log(LOG_ERR, "pid %d (%s), jid %d, uid %d, was killed: %s\n", p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id, - p->p_ucred ? p->p_ucred->cr_uid : -1, why); + p->p_ucred->cr_uid, why); proc_wkilled(p); kern_psignal(p, SIGKILL); } @@ -3146,7 +3146,7 @@ sigexit(struct thread *td, int sig) "pid %d (%s), jid %d, uid %d: exited on " "signal %d%s\n", p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id, - td->td_ucred ? td->td_ucred->cr_uid : -1, + td->td_ucred->cr_uid, sig &~ WCOREFLAG, sig & WCOREFLAG ? " (core dumped)" : ""); } else From owner-svn-src-all@freebsd.org Sat Jan 5 00:38:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA4861440080; Sat, 5 Jan 2019 00:38:23 +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 4FEC08BE7F; Sat, 5 Jan 2019 00:38:23 +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 422F38781; Sat, 5 Jan 2019 00:38:23 +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 x050cNin063478; Sat, 5 Jan 2019 00:38:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x050cNQC063477; Sat, 5 Jan 2019 00:38:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901050038.x050cNQC063477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 5 Jan 2019 00:38: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: r342780 - 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: 342780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FEC08BE7F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Jan 2019 00:38:24 -0000 Author: kib Date: Sat Jan 5 00:38:22 2019 New Revision: 342780 URL: https://svnweb.freebsd.org/changeset/base/342780 Log: MFC r342595: For hw.{physmem,realmem,usermem} MIBs, clamp instead of truncating. Modified: stable/12/sys/kern/kern_mib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_mib.c ============================================================================== --- stable/12/sys/kern/kern_mib.c Fri Jan 4 21:12:17 2019 (r342779) +++ stable/12/sys/kern/kern_mib.c Sat Jan 5 00:38:22 2019 (r342780) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -177,35 +178,45 @@ SYSCTL_PROC(_kern, KERN_ARND, arandom, static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) { - u_long val; + u_long val, p; - val = ctob(physmem); + p = SIZE_T_MAX >> PAGE_SHIFT; + if (physmem < p) + p = physmem; + val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } - SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_physmem, "LU", ""); + 0, 0, sysctl_hw_physmem, "LU", ""); static int sysctl_hw_realmem(SYSCTL_HANDLER_ARGS) { - u_long val; - val = ctob(realmem); + u_long val, p; + + p = SIZE_T_MAX >> PAGE_SHIFT; + if (realmem < p) + p = realmem; + val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } SYSCTL_PROC(_hw, HW_REALMEM, realmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_realmem, "LU", ""); + 0, 0, sysctl_hw_realmem, "LU", ""); + static int sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { - u_long val; + u_long val, p, p1; - val = ctob(physmem - vm_wire_count()); + p1 = physmem - vm_wire_count(); + p = SIZE_T_MAX >> PAGE_SHIFT; + if (p1 < p) + p = p1; + val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } - SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_usermem, "LU", ""); + 0, 0, sysctl_hw_usermem, "LU", ""); SYSCTL_LONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, ""); From owner-svn-src-all@freebsd.org Sat Jan 5 00:42:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23FBB14403B2; Sat, 5 Jan 2019 00:42:31 +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 BEB598C46C; Sat, 5 Jan 2019 00:42:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B11688924; Sat, 5 Jan 2019 00:42:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x050gUqe069014; Sat, 5 Jan 2019 00:42:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x050gUMu069013; Sat, 5 Jan 2019 00:42:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901050042.x050gUMu069013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 5 Jan 2019 00:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342781 - 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: 342781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BEB598C46C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Jan 2019 00:42:31 -0000 Author: kib Date: Sat Jan 5 00:42:30 2019 New Revision: 342781 URL: https://svnweb.freebsd.org/changeset/base/342781 Log: MFC r342595: For hw.{physmem,realmem,usermem} MIBs, clamp instead of truncating. Modified: stable/11/sys/kern/kern_mib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_mib.c ============================================================================== --- stable/11/sys/kern/kern_mib.c Sat Jan 5 00:38:22 2019 (r342780) +++ stable/11/sys/kern/kern_mib.c Sat Jan 5 00:42:30 2019 (r342781) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -173,35 +174,45 @@ SYSCTL_PROC(_kern, KERN_ARND, arandom, static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) { - u_long val; + u_long val, p; - val = ctob(physmem); + p = SIZE_T_MAX >> PAGE_SHIFT; + if (physmem < p) + p = physmem; + val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } - SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_physmem, "LU", ""); + 0, 0, sysctl_hw_physmem, "LU", ""); static int sysctl_hw_realmem(SYSCTL_HANDLER_ARGS) { - u_long val; - val = ctob(realmem); + u_long val, p; + + p = SIZE_T_MAX >> PAGE_SHIFT; + if (realmem < p) + p = realmem; + val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } SYSCTL_PROC(_hw, HW_REALMEM, realmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_realmem, "LU", ""); + 0, 0, sysctl_hw_realmem, "LU", ""); + static int sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { - u_long val; + u_long val, p, p1; - val = ctob(physmem - vm_cnt.v_wire_count); + p1 = physmem - vm_cnt.v_wire_count; + p = SIZE_T_MAX >> PAGE_SHIFT; + if (p1 < p) + p = p1; + val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } - SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_usermem, "LU", ""); + 0, 0, sysctl_hw_usermem, "LU", ""); SYSCTL_LONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, ""); From owner-svn-src-all@freebsd.org Sat Jan 5 05:20:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E61E1148B123; Sat, 5 Jan 2019 05:20:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96F7F6832E; Sat, 5 Jan 2019 05:20:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A030BE33; Sat, 5 Jan 2019 05:20: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 x055KdCo012857; Sat, 5 Jan 2019 05:20:39 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x055Ka8K012842; Sat, 5 Jan 2019 05:20:36 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901050520.x055Ka8K012842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 5 Jan 2019 05:20: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: r342783 - in stable/12: stand stand/powerpc/uboot stand/uboot/common sys/powerpc/aim sys/powerpc/booke sys/powerpc/include sys/powerpc/mpc85xx sys/powerpc/powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in stable/12: stand stand/powerpc/uboot stand/uboot/common sys/powerpc/aim sys/powerpc/booke sys/powerpc/include sys/powerpc/mpc85xx sys/powerpc/powerpc X-SVN-Commit-Revision: 342783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96F7F6832E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 05 Jan 2019 05:20:40 -0000 Author: jhibbits Date: Sat Jan 5 05:20:36 2019 New Revision: 342783 URL: https://svnweb.freebsd.org/changeset/base/342783 Log: MFC r341101-r341103, r341148, r341391, r341422-r341423, r341454, r341780-r341781, r341805, r342026 Make powerpc booke kernels boot from ubldr. r341101: powerpcspe: Don't crash the loader on ubldr with SPE instructions. r341102: powerpc: Prepare Book-E kernels for KERNBASE != run base r341103: powerpc: Fix the powerpc64 build post-r341102 r341148: powerpc: Don't include KERNBASE in genassym, it's unnecessary r341391: ubldr: Force 'usefdt' variable to 1 for powerpc r341422: powerpc/booke: Check for the metadata address by physical address r341423: powerpc: Check for a fdt in the metadata if it doesn't already exist r341454: powerpc: preload_addr_relocate is no longer necessary for booke r341780: powerpc/ubldr: Teach powerpc's ubldr to boot 64-bit kernels r341781: powerpc/booke: Replace a logical equivalent of pmap_kextract() with a real call r341805: powerpc/booke: Don't get and use the load offset for TOC on APs r342026: powerpc/booke: Change KERNBASE to be physical load address Added: stable/12/stand/powerpc/uboot/ppc64_elf_freebsd.c - copied unchanged from r341781, head/stand/powerpc/uboot/ppc64_elf_freebsd.c Modified: stable/12/stand/defs.mk stable/12/stand/powerpc/uboot/Makefile stable/12/stand/powerpc/uboot/conf.c stable/12/stand/uboot/common/main.c stable/12/sys/powerpc/aim/locore32.S stable/12/sys/powerpc/aim/locore64.S stable/12/sys/powerpc/booke/booke_machdep.c stable/12/sys/powerpc/booke/locore.S stable/12/sys/powerpc/booke/pmap.c stable/12/sys/powerpc/include/vmparam.h stable/12/sys/powerpc/mpc85xx/platform_mpc85xx.c stable/12/sys/powerpc/powerpc/genassym.c stable/12/sys/powerpc/powerpc/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/defs.mk ============================================================================== --- stable/12/stand/defs.mk Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/stand/defs.mk Sat Jan 5 05:20:36 2019 (r342783) @@ -115,6 +115,11 @@ CFLAGS+= -march=rv64imac -mabi=lp64 CFLAGS+= -msoft-float .endif +# -msoft-float seems to be insufficient for powerpcspe +.if ${MACHINE_ARCH} == "powerpcspe" +CFLAGS+= -mno-spe +.endif + .if ${MACHINE_CPUARCH} == "i386" || (${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1) CFLAGS+= -march=i386 CFLAGS.gcc+= -mpreferred-stack-boundary=2 Modified: stable/12/stand/powerpc/uboot/Makefile ============================================================================== --- stable/12/stand/powerpc/uboot/Makefile Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/stand/powerpc/uboot/Makefile Sat Jan 5 05:20:36 2019 (r342783) @@ -16,7 +16,7 @@ NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= start.S conf.c vers.c +SRCS= start.S conf.c vers.c ppc64_elf_freebsd.c SRCS+= ucmpdi2.c # Always add MI sources Modified: stable/12/stand/powerpc/uboot/conf.c ============================================================================== --- stable/12/stand/powerpc/uboot/conf.c Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/stand/powerpc/uboot/conf.c Sat Jan 5 05:20:36 2019 (r342783) @@ -95,9 +95,11 @@ struct netif_driver *netif_drivers[] = { * Sort formats so that those that can detect based on arguments * rather than reading the file go first. */ +extern struct file_format uboot_elf64; struct file_format *file_formats[] = { &uboot_elf, + &uboot_elf64, NULL }; Copied: stable/12/stand/powerpc/uboot/ppc64_elf_freebsd.c (from r341781, head/stand/powerpc/uboot/ppc64_elf_freebsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/stand/powerpc/uboot/ppc64_elf_freebsd.c Sat Jan 5 05:20:36 2019 (r342783, copy of r341781, head/stand/powerpc/uboot/ppc64_elf_freebsd.c) @@ -0,0 +1,101 @@ +/*- + * Copyright (c) 2001 Benno Rice + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#define __ELF_WORD_SIZE 64 + +#include +#include + +#include +#include +#include + +#include + +#include "bootstrap.h" +#include "libuboot.h" + +vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb); +extern char end[]; +extern vm_offset_t reloc; /* From /conf.c */ + +int +ppc64_uboot_elf_loadfile(char *filename, uint64_t dest, + struct preloaded_file **result) +{ + int r; + + r = __elfN(loadfile)(filename, dest, result); + if (r != 0) + return (r); + + /* + * No need to sync the icache for modules: this will + * be done by the kernel after relocation. + */ + if (!strcmp((*result)->f_type, "elf kernel")) + __syncicache((void *) (*result)->f_addr, (*result)->f_size); + return (0); +} + +int +ppc64_uboot_elf_exec(struct preloaded_file *fp) +{ + struct file_metadata *fmp; + vm_offset_t mdp, dtbp; + Elf_Ehdr *e; + int error; + void (*entry)(void *); + + if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) { + return(EFTYPE); + } + e = (Elf_Ehdr *)&fmp->md_data; + + /* Handle function descriptor for ELFv1 kernels */ + if ((e->e_flags & 3) == 2) + entry = (void (*)(void*))(intptr_t)e->e_entry; + else + entry = *(void (*)(void*))(uint64_t *)(intptr_t)e->e_entry; + + if ((error = md_load64(fp->f_args, &mdp, &dtbp)) != 0) + return (error); + + dev_cleanup(); + printf("Kernel args: %s\n", fp->f_args); + + (*entry)((void *)mdp); + panic("exec returned"); +} + +struct file_format uboot_elf64 = +{ + ppc64_uboot_elf_loadfile, + ppc64_uboot_elf_exec +}; Modified: stable/12/stand/uboot/common/main.c ============================================================================== --- stable/12/stand/uboot/common/main.c Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/stand/uboot/common/main.c Sat Jan 5 05:20:36 2019 (r342783) @@ -497,6 +497,9 @@ main(int argc, char **argv) do_interact: setenv("LINES", "24", 1); /* optional */ setenv("prompt", "loader>", 1); +#ifdef __powerpc__ + setenv("usefdt", "1", 1); +#endif archsw.arch_loadaddr = uboot_loadaddr; archsw.arch_getdev = uboot_getdev; Modified: stable/12/sys/powerpc/aim/locore32.S ============================================================================== --- stable/12/sys/powerpc/aim/locore32.S Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/sys/powerpc/aim/locore32.S Sat Jan 5 05:20:36 2019 (r342783) @@ -33,6 +33,7 @@ #include #include #include +#include #include "opt_platform.h" /* Locate the per-CPU data structure */ Modified: stable/12/sys/powerpc/aim/locore64.S ============================================================================== --- stable/12/sys/powerpc/aim/locore64.S Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/sys/powerpc/aim/locore64.S Sat Jan 5 05:20:36 2019 (r342783) @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef _CALL_ELF .abiversion _CALL_ELF Modified: stable/12/sys/powerpc/booke/booke_machdep.c ============================================================================== --- stable/12/sys/powerpc/booke/booke_machdep.c Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/sys/powerpc/booke/booke_machdep.c Sat Jan 5 05:20:36 2019 (r342783) @@ -158,6 +158,7 @@ extern unsigned char __sbss_start[]; extern unsigned char __sbss_end[]; extern unsigned char _end[]; extern vm_offset_t __endkernel; +extern vm_paddr_t kernload; /* * Bootinfo is passed to us by legacy loaders. Save the address of the @@ -350,7 +351,7 @@ booke_init(u_long arg1, u_long arg2) end += fdt_totalsize((void *)dtbp); __endkernel = end; mdp = NULL; - } else if (arg1 > (uintptr_t)btext) /* FreeBSD loader */ + } else if (arg1 > (uintptr_t)kernload) /* FreeBSD loader */ mdp = (void *)arg1; else /* U-Boot */ mdp = NULL; Modified: stable/12/sys/powerpc/booke/locore.S ============================================================================== --- stable/12/sys/powerpc/booke/locore.S Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/sys/powerpc/booke/locore.S Sat Jan 5 05:20:36 2019 (r342783) @@ -113,7 +113,7 @@ __start: * - Create temp entry in the second AS (make sure it's not TLB[1]) * - Switch to temp mapping * - Map 64MB of RAM in TLB1[1] - * - Use AS=1, set EPN to KERNBASE and RPN to kernel load address + * - Use AS=0, set EPN to VM_MIN_KERNEL_ADDRESS and RPN to kernel load address * - Switch to TLB1[1] mapping * - Invalidate temp mapping * @@ -238,7 +238,7 @@ __start: mtspr SPR_MAS1, %r3 /* note TS was not filled, so it's TS=0 */ isync - LOAD_ADDR(%r3, KERNBASE) + LOAD_ADDR(%r3, VM_MIN_KERNEL_ADDRESS) ori %r3, %r3, (_TLB_ENTRY_SHARED | MAS2_M)@l /* WIMGE = 0b00100 */ mtspr SPR_MAS2, %r3 isync @@ -471,7 +471,7 @@ bp_kernload: mtspr SPR_MAS1, %r3 /* note TS was not filled, so it's TS=0 */ isync - LOAD_ADDR(%r3, KERNBASE) + LOAD_ADDR(%r3, VM_MIN_KERNEL_ADDRESS) ori %r3, %r3, (_TLB_ENTRY_SHARED | MAS2_M)@l /* WIMGE = 0b00100 */ mtspr SPR_MAS2, %r3 isync @@ -526,8 +526,8 @@ bp_kernload: 7: /* - * At this point we're running at virtual addresses KERNBASE and beyond so - * it's allowed to directly access all locations the kernel was linked + * At this point we're running at virtual addresses VM_MIN_KERNEL_ADDRESS and + * beyond so it's allowed to directly access all locations the kernel was linked * against. */ @@ -549,14 +549,9 @@ bp_kernload: add %r2,%r1,%r2 mtspr SPR_SPRG8, %r2 - /* Get load offset */ - ld %r31,-0x8000(%r2) /* First TOC entry is TOC base */ - subf %r31,%r31,%r2 /* Subtract from real TOC base to get base */ - /* Set up the stack pointer */ ld %r1,TOC_REF(tmpstack)(%r2) addi %r1,%r1,TMPSTACKSZ-96 - add %r1,%r1,%r31 #else /* * Setup a temporary stack Modified: stable/12/sys/powerpc/booke/pmap.c ============================================================================== --- stable/12/sys/powerpc/booke/pmap.c Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/sys/powerpc/booke/pmap.c Sat Jan 5 05:20:36 2019 (r342783) @@ -1748,13 +1748,6 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o data_start = round_page(kernelend); data_end = data_start; - /* - * Addresses of preloaded modules (like file systems) use - * physical addresses. Make sure we relocate those into - * virtual addresses. - */ - preload_addr_relocate = kernstart - kernload; - /* Allocate the dynamic per-cpu area. */ dpcpu = (void *)data_end; data_end += DPCPU_SIZE; Modified: stable/12/sys/powerpc/include/vmparam.h ============================================================================== --- stable/12/sys/powerpc/include/vmparam.h Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/sys/powerpc/include/vmparam.h Sat Jan 5 05:20:36 2019 (r342783) @@ -106,13 +106,18 @@ #define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE #ifdef __powerpc64__ +#ifndef LOCORE #define VM_MIN_KERNEL_ADDRESS 0xe000000000000000UL #define VM_MAX_KERNEL_ADDRESS 0xe0000007ffffffffUL +#else +#define VM_MIN_KERNEL_ADDRESS 0xe000000000000000 +#define VM_MAX_KERNEL_ADDRESS 0xe0000007ffffffff +#endif #define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS #endif #ifdef AIM -#define KERNBASE 0x00100100UL /* start of kernel virtual */ +#define KERNBASE 0x00100100 /* start of kernel virtual */ #ifndef __powerpc64__ #define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)KERNEL_SR << ADDR_SR_SHFT) @@ -128,16 +133,9 @@ #else /* Book-E */ -#ifdef __powerpc64__ -#ifndef LOCORE -#define KERNBASE 0xe000000000000100UL /* start of kernel virtual */ -#else -#define KERNBASE 0xe000000000000100 /* start of kernel virtual */ -#endif -#else -#define KERNBASE 0xc0000000 /* start of kernel virtual */ - -#define VM_MIN_KERNEL_ADDRESS KERNBASE +#define KERNBASE 0x04000100 /* start of kernel physical */ +#ifndef __powerpc64__ +#define VM_MIN_KERNEL_ADDRESS 0xc0000000 #define VM_MAX_KERNEL_ADDRESS 0xffffefff #define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS #endif Modified: stable/12/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- stable/12/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Jan 5 05:20:36 2019 (r342783) @@ -68,6 +68,7 @@ extern void *ap_pcpu; extern vm_paddr_t kernload; /* Kernel physical load address */ extern uint8_t __boot_page[]; /* Boot page body */ extern uint32_t bp_kernload; +extern vm_offset_t __startkernel; struct cpu_release { uint32_t entry_h; @@ -346,7 +347,7 @@ mpc85xx_smp_start_cpu_epapr(platform_t plat, struct pc rel_va = rel_page + (rel_pa & PAGE_MASK); pmap_kenter(rel_page, rel_pa & ~PAGE_MASK); rel = (struct cpu_release *)rel_va; - bptr = ((vm_paddr_t)(uintptr_t)__boot_page - KERNBASE) + kernload; + bptr = pmap_kextract((uintptr_t)__boot_page); cpu_flush_dcache(__DEVOLATILE(struct cpu_release *,rel), sizeof(*rel)); rel->pir = pc->pc_cpuid; __asm __volatile("sync"); rel->entry_h = (bptr >> 32); @@ -415,7 +416,7 @@ mpc85xx_smp_start_cpu(platform_t plat, struct pcpu *pc /* Flush caches to have our changes hit DRAM. */ cpu_flush_dcache(__boot_page, 4096); - bptr = ((vm_paddr_t)(uintptr_t)__boot_page - KERNBASE) + kernload; + bptr = pmap_kextract((uintptr_t)__boot_page); KASSERT((bptr & 0xfff) == 0, ("%s: boot page is not aligned (%#jx)", __func__, (uintmax_t)bptr)); if (mpc85xx_is_qoriq()) { Modified: stable/12/sys/powerpc/powerpc/genassym.c ============================================================================== --- stable/12/sys/powerpc/powerpc/genassym.c Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/sys/powerpc/powerpc/genassym.c Sat Jan 5 05:20:36 2019 (r342783) @@ -225,7 +225,6 @@ ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); ASSYM(SF_UC, offsetof(struct sigframe, sf_uc)); -ASSYM(KERNBASE, KERNBASE); ASSYM(DMAP_BASE_ADDRESS, DMAP_BASE_ADDRESS); ASSYM(MAXCOMLEN, MAXCOMLEN); Modified: stable/12/sys/powerpc/powerpc/machdep.c ============================================================================== --- stable/12/sys/powerpc/powerpc/machdep.c Sat Jan 5 04:43:22 2019 (r342782) +++ stable/12/sys/powerpc/powerpc/machdep.c Sat Jan 5 05:20:36 2019 (r342783) @@ -137,6 +137,10 @@ int cacheline_size = 32; #endif int hw_direct_map = 1; +#ifdef BOOKE +extern vm_paddr_t kernload; +#endif + extern void *ap_pcpu; struct pcpu __pcpu[MAXCPU]; @@ -295,6 +299,8 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs #ifdef AIM if ((uintptr_t)&powerpc_init > DMAP_BASE_ADDRESS) md_offset = DMAP_BASE_ADDRESS; +#else /* BOOKE */ + md_offset = VM_MIN_KERNEL_ADDRESS - kernload; #endif preload_metadata = mdp; @@ -309,6 +315,11 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs if (envp != NULL) envp += md_offset; init_static_kenv(envp, 0); + if (fdt == 0) { + fdt = MD_FETCH(kmdp, MODINFOMD_DTBP, uintptr_t); + if (fdt != 0) + fdt += md_offset; + } kernelendphys = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); if (kernelendphys != 0) From owner-svn-src-all@freebsd.org Sat Jan 5 04:43:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 850511489D83; Sat, 5 Jan 2019 04:43:23 +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 293FB971E1; Sat, 5 Jan 2019 04:43:23 +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 15930B727; Sat, 5 Jan 2019 04:43:23 +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 x054hMjD096689; Sat, 5 Jan 2019 04:43:22 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x054hMj1096687; Sat, 5 Jan 2019 04:43:22 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901050443.x054hMj1096687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 5 Jan 2019 04:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342782 - in stable/12/sys: conf powerpc/booke X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in stable/12/sys: conf powerpc/booke X-SVN-Commit-Revision: 342782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 293FB971E1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Jan 2019 04:43:23 -0000 Author: jhibbits Date: Sat Jan 5 04:43:22 2019 New Revision: 342782 URL: https://svnweb.freebsd.org/changeset/base/342782 Log: MFC r341751-r341752, r342025, r342107 r341751: powerpc/SPE: Reload vector registers after efdabs/efdnabs/efdneg r341752: powerpc/SPE: Copy lower part of source register to target for efdabs/efdnabs/efdneg r342025: powerpcspe: Fix GPR handling in SPE exception handler r342107: powerpcspe: Don't require FPU_EMU for powerpcspe IEEE emulation Modified: stable/12/sys/conf/files.powerpc stable/12/sys/powerpc/booke/spe.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/files.powerpc ============================================================================== --- stable/12/sys/conf/files.powerpc Sat Jan 5 00:42:30 2019 (r342781) +++ stable/12/sys/conf/files.powerpc Sat Jan 5 04:43:22 2019 (r342782) @@ -126,15 +126,15 @@ powerpc/cpufreq/mpc85xx_jog.c optional cpufreq mpc85xx powerpc/cpufreq/pcr.c optional cpufreq aim powerpc/cpufreq/pmcr.c optional cpufreq aim powerpc64 powerpc/cpufreq/pmufreq.c optional cpufreq aim pmu -powerpc/fpu/fpu_add.c optional fpu_emu -powerpc/fpu/fpu_compare.c optional fpu_emu -powerpc/fpu/fpu_div.c optional fpu_emu +powerpc/fpu/fpu_add.c optional fpu_emu | powerpcspe +powerpc/fpu/fpu_compare.c optional fpu_emu | powerpcspe +powerpc/fpu/fpu_div.c optional fpu_emu | powerpcspe powerpc/fpu/fpu_emu.c optional fpu_emu -powerpc/fpu/fpu_explode.c optional fpu_emu -powerpc/fpu/fpu_implode.c optional fpu_emu -powerpc/fpu/fpu_mul.c optional fpu_emu +powerpc/fpu/fpu_explode.c optional fpu_emu | powerpcspe +powerpc/fpu/fpu_implode.c optional fpu_emu | powerpcspe +powerpc/fpu/fpu_mul.c optional fpu_emu | powerpcspe powerpc/fpu/fpu_sqrt.c optional fpu_emu -powerpc/fpu/fpu_subr.c optional fpu_emu +powerpc/fpu/fpu_subr.c optional fpu_emu | powerpcspe powerpc/mambo/mambocall.S optional mambo powerpc/mambo/mambo.c optional mambo powerpc/mambo/mambo_console.c optional mambo Modified: stable/12/sys/powerpc/booke/spe.c ============================================================================== --- stable/12/sys/powerpc/booke/spe.c Sat Jan 5 00:42:30 2019 (r342781) +++ stable/12/sys/powerpc/booke/spe.c Sat Jan 5 04:43:22 2019 (r342782) @@ -66,7 +66,6 @@ save_vec_int(struct thread *td) */ msr = mfmsr(); mtmsr(msr | PSL_VEC); - isync(); /* * Save the vector registers and SPEFSCR to the PCB @@ -419,6 +418,52 @@ spe_explode(struct fpemu *fe, struct fpn *fp, uint32_t return (0); } +/* + * Save the high word of a 64-bit GPR for manipulation in the exception handler. + */ +static uint32_t +spe_save_reg_high(int reg) +{ + uint32_t vec[2]; +#define EVSTDW(n) case n: __asm ("evstdw %1,0(%0)" \ + :: "b"(vec), "n"(n)); break; + switch (reg) { + EVSTDW(0); EVSTDW(1); EVSTDW(2); EVSTDW(3); + EVSTDW(4); EVSTDW(5); EVSTDW(6); EVSTDW(7); + EVSTDW(8); EVSTDW(9); EVSTDW(10); EVSTDW(11); + EVSTDW(12); EVSTDW(13); EVSTDW(14); EVSTDW(15); + EVSTDW(16); EVSTDW(17); EVSTDW(18); EVSTDW(19); + EVSTDW(20); EVSTDW(21); EVSTDW(22); EVSTDW(23); + EVSTDW(24); EVSTDW(25); EVSTDW(26); EVSTDW(27); + EVSTDW(28); EVSTDW(29); EVSTDW(30); EVSTDW(31); + } +#undef EVSTDW + + return (vec[0]); +} + +/* + * Load the given value into the high word of the requested register. + */ +static void +spe_load_reg_high(int reg, uint32_t val) +{ +#define EVLDW(n) case n: __asm __volatile("evmergelo "#n",%0,0," \ + :: "r"(val)); break; + switch (reg) { + EVLDW(1); EVLDW(2); EVLDW(3); EVLDW(4); + EVLDW(5); EVLDW(6); EVLDW(7); EVLDW(8); + EVLDW(9); EVLDW(10); EVLDW(11); EVLDW(12); + EVLDW(13); EVLDW(14); EVLDW(15); EVLDW(16); + EVLDW(17); EVLDW(18); EVLDW(19); EVLDW(20); + EVLDW(21); EVLDW(22); EVLDW(23); EVLDW(24); + EVLDW(25); EVLDW(26); EVLDW(27); EVLDW(28); + EVLDW(29); EVLDW(30); EVLDW(31); EVLDW(0); + } +#undef EVLDW + +} + void spe_handle_fpdata(struct trapframe *frame) { @@ -426,11 +471,12 @@ spe_handle_fpdata(struct trapframe *frame) struct fpn *result; uint32_t instr, instr_sec_op; uint32_t cr_shift, ra, rb, rd, src; - uint32_t high, low, res; /* For vector operations. */ + uint32_t high, low, res, tmp; /* For vector operations. */ uint32_t spefscr = 0; uint32_t ftod_res[2]; int width; /* Single, Double, Vector, Integer */ int err; + uint32_t msr; err = fueword32((void *)frame->srr0, &instr); @@ -441,6 +487,7 @@ spe_handle_fpdata(struct trapframe *frame) if ((instr >> OPC_SHIFT) != SPE_OPC) return; + msr = mfmsr(); /* * 'cr' field is the upper 3 bits of rd. Magically, since a) rd is 5 * bits, b) each 'cr' field is 4 bits, and c) Only the 'GT' bit is @@ -460,32 +507,35 @@ spe_handle_fpdata(struct trapframe *frame) width = NONE; switch (src) { case SPE: - save_vec_nodrop(curthread); + mtmsr(msr | PSL_VEC); switch (instr_sec_op) { case EVFSABS: - curthread->td_pcb->pcb_vec.vr[rd][0] = - curthread->td_pcb->pcb_vec.vr[ra][0] & ~(1U << 31); + high = spe_save_reg_high(ra) & ~(1U << 31); frame->fixreg[rd] = frame->fixreg[ra] & ~(1U << 31); + spe_load_reg_high(rd, high); break; case EVFSNABS: - curthread->td_pcb->pcb_vec.vr[rd][0] = - curthread->td_pcb->pcb_vec.vr[ra][0] | (1U << 31); + high = spe_save_reg_high(ra) | (1U << 31); frame->fixreg[rd] = frame->fixreg[ra] | (1U << 31); + spe_load_reg_high(rd, high); break; case EVFSNEG: - curthread->td_pcb->pcb_vec.vr[rd][0] = - curthread->td_pcb->pcb_vec.vr[ra][0] ^ (1U << 31); + high = spe_save_reg_high(ra) ^ (1U << 31); frame->fixreg[rd] = frame->fixreg[ra] ^ (1U << 31); + spe_load_reg_high(rd, high); break; default: /* High word */ spe_explode(&fpemu, &fpemu.fe_f1, SINGLE, - curthread->td_pcb->pcb_vec.vr[ra][0], 0); + spe_save_reg_high(ra), 0); spe_explode(&fpemu, &fpemu.fe_f2, SINGLE, - curthread->td_pcb->pcb_vec.vr[rb][0], 0); + spe_save_reg_high(rb), 0); high = spe_emu_instr(instr_sec_op, &fpemu, &result, - &curthread->td_pcb->pcb_vec.vr[rd][0]); + &tmp); + if (high < 0) + spe_load_reg_high(rd, tmp); + spefscr = fpscr_to_spefscr(fpemu.fe_cx) << 16; /* Clear the fpemu to start over on the lower bits. */ memset(&fpemu, 0, sizeof(fpemu)); @@ -508,7 +558,6 @@ spe_handle_fpdata(struct trapframe *frame) width = VECTOR; break; } - enable_vec(curthread); goto end; case SPFP: @@ -524,8 +573,7 @@ spe_handle_fpdata(struct trapframe *frame) break; case EFSCFD: spe_explode(&fpemu, &fpemu.fe_f3, DOUBLE, - curthread->td_pcb->pcb_vec.vr[rb][0], - frame->fixreg[rb]); + spe_save_reg_high(rb), frame->fixreg[rb]); result = &fpemu.fe_f3; width = SINGLE; break; @@ -538,19 +586,22 @@ spe_handle_fpdata(struct trapframe *frame) } break; case DPFP: - save_vec_nodrop(curthread); + mtmsr(msr | PSL_VEC); switch (instr_sec_op) { case EFDABS: - curthread->td_pcb->pcb_vec.vr[rd][0] = - curthread->td_pcb->pcb_vec.vr[ra][0] & ~(1U << 31); + high = spe_save_reg_high(ra) & ~(1U << 31); + frame->fixreg[rd] = frame->fixreg[ra]; + spe_load_reg_high(rd, high); break; case EFDNABS: - curthread->td_pcb->pcb_vec.vr[rd][0] = - curthread->td_pcb->pcb_vec.vr[ra][0] | (1U << 31); + high = spe_save_reg_high(ra) | (1U << 31); + frame->fixreg[rd] = frame->fixreg[ra]; + spe_load_reg_high(rd, high); break; case EFDNEG: - curthread->td_pcb->pcb_vec.vr[rd][0] = - curthread->td_pcb->pcb_vec.vr[ra][0] ^ (1U << 31); + high = spe_save_reg_high(ra) ^ (1U << 31); + frame->fixreg[rd] = frame->fixreg[ra]; + spe_load_reg_high(rd, high); break; case EFDCFS: spe_explode(&fpemu, &fpemu.fe_f3, SINGLE, @@ -560,11 +611,9 @@ spe_handle_fpdata(struct trapframe *frame) break; default: spe_explode(&fpemu, &fpemu.fe_f1, DOUBLE, - curthread->td_pcb->pcb_vec.vr[ra][0], - frame->fixreg[ra]); + spe_save_reg_high(ra), frame->fixreg[ra]); spe_explode(&fpemu, &fpemu.fe_f2, DOUBLE, - curthread->td_pcb->pcb_vec.vr[rb][0], - frame->fixreg[rb]); + spe_save_reg_high(rb), frame->fixreg[rb]); width = DOUBLE; } break; @@ -603,10 +652,8 @@ spe_handle_fpdata(struct trapframe *frame) frame->fixreg[rd] = fpu_ftos(&fpemu, result); break; case DOUBLE: - curthread->td_pcb->pcb_vec.vr[rd][0] = - fpu_ftod(&fpemu, result, ftod_res); + spe_load_reg_high(rd, fpu_ftod(&fpemu, result, ftod_res)); frame->fixreg[rd] = ftod_res[1]; - enable_vec(curthread); break; default: panic("Unknown storage width %d", width); @@ -618,6 +665,7 @@ end: spefscr |= (mfspr(SPR_SPEFSCR) & ~SPEFSCR_FINVS); mtspr(SPR_SPEFSCR, spefscr); frame->srr0 += 4; + mtmsr(msr); return; } From owner-svn-src-all@freebsd.org Sat Jan 5 05:50:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45944148C774; Sat, 5 Jan 2019 05:50:17 +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 E22B06AAC5; Sat, 5 Jan 2019 05:50:16 +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 D0059C353; Sat, 5 Jan 2019 05:50:16 +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 x055oG7g028214; Sat, 5 Jan 2019 05:50:16 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x055oGW7028213; Sat, 5 Jan 2019 05:50:16 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901050550.x055oGW7028213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 5 Jan 2019 05:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342784 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 342784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E22B06AAC5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 05 Jan 2019 05:50:17 -0000 Author: kp Date: Sat Jan 5 05:50:16 2019 New Revision: 342784 URL: https://svnweb.freebsd.org/changeset/base/342784 Log: pf: Remove references to pflow from the pf.conf man page pflow no longer exists. It was removed as part of a pf update back in 2012 (r240233). PR: 223957 MFC after: 1 week Modified: head/share/man/man5/pf.conf.5 Modified: head/share/man/man5/pf.conf.5 ============================================================================== --- head/share/man/man5/pf.conf.5 Sat Jan 5 05:20:36 2019 (r342783) +++ head/share/man/man5/pf.conf.5 Sat Jan 5 05:50:16 2019 (r342784) @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 27, 2018 +.Dd January 5, 2019 .Dt PF.CONF 5 .Os .Sh NAME @@ -547,7 +547,7 @@ without an explicit .Ar keep state . For example: .Bd -literal -offset indent -set state-defaults pflow, no-sync +set state-defaults no-sync .Ed .It Ar set hostid The 32-bit @@ -2136,10 +2136,6 @@ easier. This is intended to be used in situations where one does not see all packets of a connection, e.g. in asymmetric routing situations. Cannot be used with modulate or synproxy state. -.It Ar pflow -States created by this rule are exported on the -.Xr pflow 4 -interface. .El .Pp Multiple options can be specified, separated by commas: @@ -3009,7 +3005,7 @@ tos = ( "lowdelay" | "throughput" | "reliab [ "0x" ] number ) state-opts = state-opt [ [ "," ] state-opts ] -state-opt = ( "max" number | "no-sync" | timeout | "sloppy" | "pflow" | +state-opt = ( "max" number | "no-sync" | timeout | "sloppy" | "source-track" [ ( "rule" | "global" ) ] | "max-src-nodes" number | "max-src-states" number | "max-src-conn" number | @@ -3072,7 +3068,6 @@ Service name database. .Xr ip 4 , .Xr ip6 4 , .Xr pf 4 , -.Xr pflow 4 , .Xr pfsync 4 , .Xr tcp 4 , .Xr udp 4 , From owner-svn-src-all@freebsd.org Sat Jan 5 07:20:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E729B14905F7; Sat, 5 Jan 2019 07:20:00 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D8206E013; Sat, 5 Jan 2019 07:20:00 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E99ED2E6; Sat, 5 Jan 2019 07:20:00 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x057K0W8074398; Sat, 5 Jan 2019 07:20:00 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x057K0As074397; Sat, 5 Jan 2019 07:20:00 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201901050720.x057K0As074397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 5 Jan 2019 07:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342785 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 342785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D8206E013 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 05 Jan 2019 07:20:01 -0000 Author: tsoome Date: Sat Jan 5 07:20:00 2019 New Revision: 342785 URL: https://svnweb.freebsd.org/changeset/base/342785 Log: With buggy int13 ah=15, we can mis-identify the floppy devices. We have no option than trust INT13 ah=08 return code during the init phase. PR: 234460 Reported by: Oleh Hushchenkov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18723 Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sat Jan 5 05:50:16 2019 (r342784) +++ head/stand/i386/libi386/biosdisk.c Sat Jan 5 07:20:00 2019 (r342785) @@ -136,6 +136,8 @@ static int bd_ioctl(struct open_file *f, u_long cmd, v static int bd_print(int verbose); static int cd_print(int verbose); static int fd_print(int verbose); +static void bd_reset_disk(int); +static int bd_get_diskinfo_std(struct bdinfo *); struct devsw biosfd = { .dv_name = "fd", @@ -252,20 +254,52 @@ bd_unit2bios(struct i386_devdesc *dev) } /* + * Use INT13 AH=15 - Read Drive Type. + */ +static int +fd_count(void) +{ + int drive; + + for (drive = 0; drive < MAXBDDEV; drive++) { + bd_reset_disk(drive); + + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x1500; + v86.edx = drive; + v86int(); + + if (V86_CY(v86.efl)) + break; + + if ((v86.eax & 0x300) == 0) + break; + } + + return (drive); +} + +/* * Quiz the BIOS for disk devices, save a little info about them. */ static int fd_init(void) { - int unit; + int unit, numfd; bdinfo_t *bd; - for (unit = 0; unit < MAXBDDEV; unit++) { + numfd = fd_count(); + for (unit = 0; unit < numfd; unit++) { if ((bd = calloc(1, sizeof(*bd))) == NULL) break; + + bd->bd_sectorsize = BIOSDISK_SECSIZE; bd->bd_flags = BD_FLOPPY; bd->bd_unit = unit; - if (!bd_int13probe(bd)) { + + /* Use std diskinfo for floppy drive */ + if (bd_get_diskinfo_std(bd) != 0) { free(bd); break; } @@ -382,6 +416,10 @@ bc_add(int biosdev) static int bd_check_extensions(int unit) { + /* do not use ext calls for floppy devices */ + if (unit < 0x80) + return (0); + /* Determine if we can use EDD with this device. */ v86.ctl = V86_FLAGS; v86.addr = 0x13; From owner-svn-src-all@freebsd.org Sat Jan 5 15:09:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 742D4149DA8F; Sat, 5 Jan 2019 15:09:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B27285E1A; Sat, 5 Jan 2019 15:09:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10DE81A3DE; Sat, 5 Jan 2019 15:09:51 +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 x05F9oF8022015; Sat, 5 Jan 2019 15:09:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05F9obQ022014; Sat, 5 Jan 2019 15:09:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901051509.x05F9obQ022014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 5 Jan 2019 15:09: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: r342786 - stable/12/share/man/man3 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/share/man/man3 X-SVN-Commit-Revision: 342786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B27285E1A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Jan 2019 15:09:51 -0000 Author: markj Date: Sat Jan 5 15:09:50 2019 New Revision: 342786 URL: https://svnweb.freebsd.org/changeset/base/342786 Log: MFC r342688: Typo. Modified: stable/12/share/man/man3/timeradd.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man3/timeradd.3 ============================================================================== --- stable/12/share/man/man3/timeradd.3 Sat Jan 5 07:20:00 2019 (r342785) +++ stable/12/share/man/man3/timeradd.3 Sat Jan 5 15:09:50 2019 (r342786) @@ -94,7 +94,7 @@ structure is defined in as: .Bd -literal struct timespec { - time_t tv_nsec; /* seconds */ + time_t tv_sec; /* seconds */ long tv_nsec; /* and nanoseconds */ }; .Ed From owner-svn-src-all@freebsd.org Sat Jan 5 15:28:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1970149E7AF; Sat, 5 Jan 2019 15:28:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45E3786FC0; Sat, 5 Jan 2019 15:28:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38CD11A737; Sat, 5 Jan 2019 15:28:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x05FSLr2032770; Sat, 5 Jan 2019 15:28:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05FSLRx032769; Sat, 5 Jan 2019 15:28:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901051528.x05FSLRx032769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 5 Jan 2019 15:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342787 - head/sys/dev/tws X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/tws X-SVN-Commit-Revision: 342787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45E3786FC0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,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, 05 Jan 2019 15:28:21 -0000 Author: markj Date: Sat Jan 5 15:28:20 2019 New Revision: 342787 URL: https://svnweb.freebsd.org/changeset/base/342787 Log: Add a bounds check to the tws(4) passthrough ioctl handler. tws_passthru() was doing a copyin of a user-specified request without validating its length, so a malicious request could overrun the buffer. By default, the tws(4) device file is only accessible as root. admbug: 825 Reported by: Anonymous of the Shellphish Grill Team Reviewed by: delphij MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18536 Modified: head/sys/dev/tws/tws_user.c Modified: head/sys/dev/tws/tws_user.c ============================================================================== --- head/sys/dev/tws/tws_user.c Sat Jan 5 15:09:50 2019 (r342786) +++ head/sys/dev/tws/tws_user.c Sat Jan 5 15:28:20 2019 (r342787) @@ -92,9 +92,13 @@ tws_passthru(struct tws_softc *sc, void *buf) struct tws_request *req; struct tws_ioctl_no_data_buf *ubuf = (struct tws_ioctl_no_data_buf *)buf; int error; + u_int32_t buffer_length; u_int16_t lun4; - + buffer_length = roundup2(ubuf->driver_pkt.buffer_length, 512); + if ( buffer_length > TWS_MAX_IO_SIZE ) { + return(EINVAL); + } if ( tws_get_state(sc) != TWS_ONLINE) { return(EBUSY); } @@ -118,7 +122,7 @@ tws_passthru(struct tws_softc *sc, void *buf) } } while(1); - req->length = (ubuf->driver_pkt.buffer_length + 511) & ~511; + req->length = buffer_length; TWS_TRACE_DEBUG(sc, "datal,rid", req->length, req->request_id); if ( req->length ) { req->data = sc->ioctl_data_mem; From owner-svn-src-all@freebsd.org Sat Jan 5 16:05:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CB98149FA80; Sat, 5 Jan 2019 16:05:41 +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 0A94B889E7; Sat, 5 Jan 2019 16:05:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDD9F1ADEA; Sat, 5 Jan 2019 16:05:40 +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 x05G5eCU054485; Sat, 5 Jan 2019 16:05:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05G5dj8054476; Sat, 5 Jan 2019 16:05:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901051605.x05G5dj8054476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 5 Jan 2019 16:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342788 - in head: sbin/rtsol usr.sbin/rtsold X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: sbin/rtsol usr.sbin/rtsold X-SVN-Commit-Revision: 342788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A94B889E7 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)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2019 16:05:41 -0000 Author: markj Date: Sat Jan 5 16:05:39 2019 New Revision: 342788 URL: https://svnweb.freebsd.org/changeset/base/342788 Log: Capsicumize rtsol(8) and rtsold(8). These programs parse ND6 Router Advertisement messages; rtsold(8) has required an SA, SA-14:20.rtsold, for a bug in this code. Thus, they are good candidates for sandboxing. The approach taken is to run the main executable in capability mode and use Casper services to provide functionality that cannot be implemented within the sandbox. In particular, several custom services were required. - A Casper service is used to send Router Solicitation messages on a raw ICMP6 socket. Initially I took the approach of creating a socket for each interface upon startup, and connect(2)ing it to the all-routers multicast group for the interface. This permits the use of sendmsg(2) in capability mode, but only works if the interface's link is up when rtsol(d) starts. So, instead, the rtsold.sendmsg service is used to transmit RS messages on behalf of the main process. One could alternately define a service which simply creates and connects a socket for each destination address, and returns the socket to the sandboxed process. However, to implement rtsold's -m option we also need to read the ND6 default router list, and this cannot be done in capability mode. - rtsold may execute resolvconf(8) in response to RDNSS and DNSSL options in received RA messages. A Casper service is used to fork and exec resolvconf(8), and to reap the child process. - A service is used to determine whether a given interface's link-local address is useable (i.e., not duplicated or undergoing DAD). This information is supplied by getifaddrs(3), which reads a sysctl not available in capability mode. The SIOCGIFCONF socket ioctl provides equivalent information and can be used in capability mode, but I decided against it for now because of some limitations of that interface. In addition to these new services, cap_syslog(3) is used to send messages to syslogd. Reviewed by: oshogbo Tested by: bz (previous versions) MFC after: 2 months Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17572 Added: head/usr.sbin/rtsold/cap_llflags.c (contents, props changed) head/usr.sbin/rtsold/cap_script.c (contents, props changed) head/usr.sbin/rtsold/cap_sendmsg.c (contents, props changed) Deleted: head/usr.sbin/rtsold/probe.c Modified: head/sbin/rtsol/Makefile head/usr.sbin/rtsold/Makefile head/usr.sbin/rtsold/dump.c head/usr.sbin/rtsold/if.c head/usr.sbin/rtsold/rtsock.c head/usr.sbin/rtsold/rtsol.c head/usr.sbin/rtsold/rtsold.c head/usr.sbin/rtsold/rtsold.h Modified: head/sbin/rtsol/Makefile ============================================================================== --- head/sbin/rtsol/Makefile Sat Jan 5 15:28:20 2019 (r342787) +++ head/sbin/rtsol/Makefile Sat Jan 5 16:05:39 2019 (r342788) @@ -18,10 +18,24 @@ PACKAGE=runtime PROG= rtsol -SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c +SRCS= cap_llflags.c \ + cap_script.c \ + cap_sendmsg.c \ + dump.c \ + if.c \ + rtsol.c \ + rtsold.c \ + rtsock.c MAN= +LIBADD= util -WARNS?= 3 -CFLAGS+= -DSMALL +.include + +.if ${MK_DYNAMICROOT} == "no" +.warning ${PROG} built without libcasper support +.elif ${MK_CASPER} != "no" && !defined(RESCUE) +CFLAGS+= -DWITH_CASPER +LIBADD+= cap_syslog casper nv +.endif .include Modified: head/usr.sbin/rtsold/Makefile ============================================================================== --- head/usr.sbin/rtsold/Makefile Sat Jan 5 15:28:20 2019 (r342787) +++ head/usr.sbin/rtsold/Makefile Sat Jan 5 16:05:39 2019 (r342788) @@ -17,8 +17,22 @@ PROG= rtsold MAN= rtsold.8 MLINKS= rtsold.8 rtsol.8 -SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c +SRCS= cap_llflags.c \ + cap_script.c \ + cap_sendmsg.c \ + dump.c \ + if.c \ + rtsock.c \ + rtsol.c \ + rtsold.c -WARNS?= 3 +LIBADD= util + +.include + +.if ${MK_CASPER} != "no" +CFLAGS+= -DWITH_CASPER +LIBADD+= casper cap_syslog nv +.endif .include Added: head/usr.sbin/rtsold/cap_llflags.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/rtsold/cap_llflags.c Sat Jan 5 16:05:39 2019 (r342788) @@ -0,0 +1,157 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +/* + * A service to fetch the flags for the link-local IPv6 address on the specified + * interface. This cannot easily be done in capability mode because we need to + * use the routing socket sysctl API to find the link-local address of a + * particular interface. The SIOCGIFCONF ioctl is one other option, but as + * currently implemented it is less flexible (it cannot report the required + * buffer length), and hard-codes a buffer length limit. + */ + +static int +llflags_get(const char *ifname, int *flagsp) +{ + struct in6_ifreq ifr6; + struct ifaddrs *ifap, *ifa; + struct sockaddr_in6 *sin6; + int error, s; + + s = socket(PF_INET6, SOCK_DGRAM, 0); + if (s < 0) + return (-1); + + if (getifaddrs(&ifap) != 0) + return (-1); + error = -1; + for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) { + if (strcmp(ifa->ifa_name, ifname) != 0) + continue; + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + + sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr; + if (!IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) + continue; + + memset(&ifr6, 0, sizeof(ifr6)); + if (strlcpy(ifr6.ifr_name, ifname, sizeof(ifr6.ifr_name)) >= + sizeof(ifr6.ifr_name)) { + freeifaddrs(ifap); + errno = EINVAL; + return (-1); + } + memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); + if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { + error = errno; + freeifaddrs(ifap); + errno = error; + return (-1); + } + + *flagsp = ifr6.ifr_ifru.ifru_flags6; + error = 0; + break; + } + (void)close(s); + freeifaddrs(ifap); + if (error == -1) + errno = ENOENT; + return (error); +} + +int +cap_llflags_get(cap_channel_t *cap, const char *ifname, int *flagsp) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "get"); + nvlist_add_string(nvl, "ifname", ifname); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + *flagsp = (int)nvlist_get_number(nvl, "flags"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (llflags_get(ifname, flagsp)); +#endif +} + +#ifdef WITH_CASPER +static int +llflags_command(const char *cmd, const nvlist_t *limits __unused, + nvlist_t *nvlin, nvlist_t *nvlout) +{ + const char *ifname; + int flags; + + if (strcmp(cmd, "get") != 0) + return (EINVAL); + ifname = nvlist_get_string(nvlin, "ifname"); + if (llflags_get(ifname, &flags) != 0) + return (errno); + nvlist_add_number(nvlout, "flags", flags); + return (0); +} + +CREATE_SERVICE("rtsold.llflags", NULL, llflags_command, 0); +#endif /* WITH_CASPER */ Added: head/usr.sbin/rtsold/cap_script.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/rtsold/cap_script.c Sat Jan 5 16:05:39 2019 (r342788) @@ -0,0 +1,236 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +/* + * Run the script and return the write end of a pipe to the main process. + * Return -1 and set errno on error. + */ +static int +script_run(char **argv) +{ + pid_t pid; + int fd[2], null; + + if (pipe(fd) != 0) + return (-1); + if ((pid = fork()) < 0) + return (-1); + if (pid == 0) { + (void)close(fd[1]); + null = open("/dev/null", O_RDWR); + if (null < 0) + _exit(1); + if (dup2(fd[0], STDIN_FILENO) != STDIN_FILENO) + _exit(1); + + closefrom(3); + (void)execve(argv[0], argv, NULL); + _exit(1); + } else + (void)close(fd[0]); + + return (fd[1]); +} + +int +cap_script_run(cap_channel_t *cap, const char *const *argv) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + size_t argc; + int error, wfd; + + for (argc = 0; argv[argc] != NULL; argc++) + ; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "script_run"); + nvlist_add_string_array(nvl, "argv", argv, argc); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + wfd = nvlist_take_descriptor(nvl, "fd"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? wfd : -1); +#else + (void)cap; + return (script_run(__DECONST(char **, argv))); +#endif +} + +/* + * Wait for a child process to exit, and return its status. + * Return -1 and set errno upon error. + */ +static int +script_wait(int *statusp) +{ + int error; + + error = wait(statusp); + return (error >= 0 ? 0 : -1); +} + +int +cap_script_wait(cap_channel_t *cap, int *statusp) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "script_wait"); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + *statusp = (int)nvlist_get_number(nvl, "status"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (script_wait(statusp)); +#endif +} + +#ifdef WITH_CASPER +static int +script_command(const char *cmd, const nvlist_t *limits, nvlist_t *nvlin, + nvlist_t *nvlout) +{ + cap_rights_t rights; + const char *const *iargv, *const *scripts; + char **argv; + size_t argc, i, nscripts; + int fd, status; + + if (strcmp(cmd, "script_wait") == 0) { + /* Wait for the result of a previous "script_run" command. */ + if (script_wait(&status) == -1) + return (errno); + nvlist_add_number(nvlout, "status", status); + return (0); + } + if (strcmp(cmd, "script_run") != 0) + return (EINVAL); + + /* + * Validate the argv against the limits specified at initialization + * time. + */ + iargv = nvlist_get_string_array(nvlin, "argv", &argc); + if (argc == 0) + return (EINVAL); + scripts = nvlist_get_string_array(limits, "scripts", &nscripts); + for (i = 0; i < nscripts; i++) + if (strcmp(iargv[0], scripts[i]) == 0) + break; + if (i == nscripts) + return (EINVAL); + + /* + * The nvlist API does not permit NULL pointers in an array, so we have + * to add the nul terminator ourselves. Yuck. + */ + argv = calloc(argc + 1, sizeof(*argv)); + if (argv == NULL) + return (errno); + memcpy(argv, iargv, sizeof(*argv) * argc); + + fd = script_run(argv); + if (fd < 0) + return (errno); + + (void)caph_rights_limit(fd, cap_rights_init(&rights, CAP_WRITE)); + nvlist_move_descriptor(nvlout, "fd", fd); + return (0); +} + +static int +script_limit(const nvlist_t *oldlimits, const nvlist_t *newlimits __unused) +{ + const char *name; + void *cookie; + int nvtype; + bool hasscripts; + + /* Limits may only be set once. */ + if (oldlimits != NULL) + return (ENOTCAPABLE); + + cookie = NULL; + hasscripts = false; + while ((name = nvlist_next(newlimits, &nvtype, &cookie)) != NULL) { + if (nvtype == NV_TYPE_STRING_ARRAY && + strcmp(name, "scripts") == 0) + hasscripts = true; + else + return (EINVAL); + } + if (!hasscripts) + return (EINVAL); + return (0); +} + +CREATE_SERVICE("rtsold.script", script_limit, script_command, 0); +#endif /* WITH_CASPER */ Added: head/usr.sbin/rtsold/cap_sendmsg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/rtsold/cap_sendmsg.c Sat Jan 5 16:05:39 2019 (r342788) @@ -0,0 +1,282 @@ +/* $KAME: probe.c,v 1.17 2003/10/05 00:09:36 itojun Exp $ */ + +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (C) 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +static int +getsocket(int *sockp, int proto) +{ + cap_rights_t rights; + int sock; + + if (*sockp >= 0) + return (0); + + if ((sock = socket(AF_INET6, SOCK_RAW, proto)) < 0) + return (-1); + cap_rights_init(&rights, CAP_CONNECT, CAP_SEND); + if (caph_rights_limit(sock, &rights) != 0) + return (-1); + *sockp = sock; + + return (0); +} + +static ssize_t +sendpacket(int sock, struct sockaddr_in6 *dst, uint32_t ifindex, int hoplimit, + const void *data, size_t len) +{ + uint8_t cmsg[CMSG_SPACE(sizeof(struct in6_pktinfo)) + + CMSG_SPACE(sizeof(int))]; + struct msghdr hdr; + struct iovec iov; + struct in6_pktinfo *pi; + struct cmsghdr *cm; + + memset(&hdr, 0, sizeof(hdr)); + hdr.msg_name = dst; + hdr.msg_namelen = sizeof(*dst); + hdr.msg_iov = &iov; + hdr.msg_iovlen = 1; + hdr.msg_control = cmsg; + hdr.msg_controllen = sizeof(cmsg); + + iov.iov_base = __DECONST(void *, data); + iov.iov_len = len; + + /* Specify the outbound interface. */ + cm = CMSG_FIRSTHDR(&hdr); + cm->cmsg_level = IPPROTO_IPV6; + cm->cmsg_type = IPV6_PKTINFO; + cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); + pi = (struct in6_pktinfo *)(void *)CMSG_DATA(cm); + memset(&pi->ipi6_addr, 0, sizeof(pi->ipi6_addr)); /*XXX*/ + pi->ipi6_ifindex = ifindex; + + /* Specify the hop limit of the packet for safety. */ + cm = CMSG_NXTHDR(&hdr, cm); + cm->cmsg_level = IPPROTO_IPV6; + cm->cmsg_type = IPV6_HOPLIMIT; + cm->cmsg_len = CMSG_LEN(sizeof(int)); + memcpy(CMSG_DATA(cm), &hoplimit, sizeof(int)); + + return (sendmsg(sock, &hdr, 0)); +} + +static int +probe_defrouters(uint32_t ifindex, uint32_t linkid) +{ + static int probesock = -1; + struct sockaddr_in6 dst; + struct in6_defrouter *p, *ep; + char *buf; + size_t len; + int mib[4]; + + if (ifindex == 0) + return (0); + if (getsocket(&probesock, IPPROTO_NONE) != 0) + return (-1); + + mib[0] = CTL_NET; + mib[1] = PF_INET6; + mib[2] = IPPROTO_ICMPV6; + mib[3] = ICMPV6CTL_ND6_DRLIST; + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) + return (-1); + if (len == 0) + return (0); + + memset(&dst, 0, sizeof(dst)); + dst.sin6_family = AF_INET6; + dst.sin6_len = sizeof(dst); + + buf = malloc(len); + if (buf == NULL) + return (-1); + if (sysctl(mib, nitems(mib), buf, &len, NULL, 0) < 0) + return (-1); + ep = (struct in6_defrouter *)(void *)(buf + len); + for (p = (struct in6_defrouter *)(void *)buf; p < ep; p++) { + if (ifindex != p->if_index) + continue; + if (!IN6_IS_ADDR_LINKLOCAL(&p->rtaddr.sin6_addr)) + continue; + dst.sin6_addr = p->rtaddr.sin6_addr; + dst.sin6_scope_id = linkid; + (void)sendpacket(probesock, &dst, ifindex, 1, NULL, 0); + } + free(buf); + + return (0); +} + +static int +rssend(uint32_t ifindex, uint32_t linkid, const void *data, size_t len) +{ + static int rssock = -1; + struct sockaddr_in6 dst; + ssize_t n; + + if (getsocket(&rssock, IPPROTO_ICMPV6) != 0) + return (-1); + + memset(&dst, 0, sizeof(dst)); + dst.sin6_family = AF_INET6; + dst.sin6_len = sizeof(dst); + dst.sin6_addr = (struct in6_addr)IN6ADDR_LINKLOCAL_ALLROUTERS_INIT; + dst.sin6_scope_id = linkid; + + n = sendpacket(rssock, &dst, ifindex, 255, data, len); + if (n < 0 || (size_t)n != len) + return (-1); + return (0); +} + +int +cap_probe_defrouters(cap_channel_t *cap, struct ifinfo *ifinfo) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "probe_defrouters"); + nvlist_add_number(nvl, "ifindex", ifinfo->sdl->sdl_index); + nvlist_add_number(nvl, "linkid", ifinfo->linkid); + + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (errno); + error = (int)dnvlist_get_number(nvl, "error", 0); + nvlist_destroy(nvl); + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (probe_defrouters(ifinfo->sdl->sdl_index, ifinfo->linkid)); +#endif +} + +int +cap_rssend(cap_channel_t *cap, struct ifinfo *ifinfo) +{ + int error; + +#ifdef WITH_CASPER + nvlist_t *nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "rssend"); + nvlist_add_number(nvl, "ifindex", ifinfo->sdl->sdl_index); + nvlist_add_number(nvl, "linkid", ifinfo->linkid); + nvlist_add_binary(nvl, "data", ifinfo->rs_data, ifinfo->rs_datalen); + + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (errno); + error = (int)dnvlist_get_number(nvl, "error", 0); + nvlist_destroy(nvl); + errno = error; +#else + (void)cap; + error = rssend(ifinfo->sdl->sdl_index, ifinfo->linkid, ifinfo->rs_data, + ifinfo->rs_datalen); +#endif + + ifinfo->probes++; + if (error != 0 && (errno != ENETDOWN || dflag > 0)) { + error = errno; + warnmsg(LOG_ERR, __func__, "sendmsg on %s: %s", + ifinfo->ifname, strerror(errno)); + errno = error; + } + return (error == 0 ? 0 : -1); +} + +#ifdef WITH_CASPER +static int +sendmsg_command(const char *cmd, const nvlist_t *limits __unused, nvlist_t *nvlin, + nvlist_t *nvlout __unused) +{ + const void *data; + size_t len; + uint32_t ifindex, linkid; + int error; + + if (strcmp(cmd, "probe_defrouters") != 0 && + strcmp(cmd, "rssend") != 0) + return (EINVAL); + + ifindex = (uint32_t)nvlist_get_number(nvlin, "ifindex"); + linkid = (uint32_t)nvlist_get_number(nvlin, "linkid"); + if (strcmp(cmd, "probe_defrouters") == 0) { + error = probe_defrouters(ifindex, linkid); + } else { + data = nvlist_get_binary(nvlin, "data", &len); + error = rssend(ifindex, linkid, data, len); + } + if (error != 0) + return (errno); + return (0); +} + +CREATE_SERVICE("rtsold.sendmsg", NULL, sendmsg_command, 0); +#endif /* WITH_CASPER */ Modified: head/usr.sbin/rtsold/dump.c ============================================================================== --- head/usr.sbin/rtsold/dump.c Sat Jan 5 15:28:20 2019 (r342787) +++ head/usr.sbin/rtsold/dump.c Sat Jan 5 16:05:39 2019 (r342788) @@ -34,6 +34,7 @@ */ #include +#include #include #include @@ -42,21 +43,20 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include +#include #include "rtsold.h" -static FILE *fp; +static const char * const ifstatstr[] = + { "IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE" }; -static void dump_interface_status(void); -static const char * const ifstatstr[] = {"IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE"}; - -static void -dump_interface_status(void) +void +rtsold_dump(FILE *fp) { struct ifinfo *ifi; struct rainfo *rai; @@ -64,8 +64,14 @@ dump_interface_status(void) struct timespec now; char ntopbuf[INET6_ADDRSTRLEN]; - clock_gettime(CLOCK_MONOTONIC_FAST, &now); + if (fseek(fp, 0, SEEK_SET) != 0) { + warnmsg(LOG_ERR, __func__, "fseek(): %s", strerror(errno)); + return; + } + (void)ftruncate(fileno(fp), 0); + (void)clock_gettime(CLOCK_MONOTONIC_FAST, &now); + TAILQ_FOREACH(ifi, &ifinfo_head, ifi_next) { fprintf(fp, "Interface %s\n", ifi->ifname); fprintf(fp, " probe interval: "); @@ -121,18 +127,28 @@ dump_interface_status(void) fprintf(fp, "\n"); } } + fflush(fp); } -void -rtsold_dump_file(const char *dumpfile) +FILE * +rtsold_init_dumpfile(const char *dumpfile) { + cap_rights_t rights; + FILE *fp; + if ((fp = fopen(dumpfile, "w")) == NULL) { - warnmsg(LOG_WARNING, __func__, "open a dump file(%s): %s", + warnmsg(LOG_WARNING, __func__, "opening a dump file(%s): %s", dumpfile, strerror(errno)); - return; + return (NULL); } - dump_interface_status(); - fclose(fp); + + cap_rights_init(&rights, CAP_FSTAT, CAP_FTRUNCATE, CAP_SEEK, CAP_WRITE); + if (caph_rights_limit(fileno(fp), &rights) != 0) { + warnmsg(LOG_WARNING, __func__, "caph_rights_limit(%s): %s", + dumpfile, strerror(errno)); + return (NULL); + } + return (fp); } const char * Modified: head/usr.sbin/rtsold/if.c ============================================================================== --- head/usr.sbin/rtsold/if.c Sat Jan 5 15:28:20 2019 (r342787) +++ head/usr.sbin/rtsold/if.c Sat Jan 5 16:05:39 2019 (r342788) @@ -34,10 +34,11 @@ */ #include -#include -#include +#include #include #include +#include +#include #include #include @@ -51,6 +52,7 @@ #include #include +#include #include #include #include @@ -63,16 +65,28 @@ #include "rtsold.h" static int ifsock; - -static int get_llflag(const char *); static void get_rtaddrs(int, struct sockaddr *, struct sockaddr **); int ifinit(void) { - ifsock = rssock; + cap_rights_t rights; + int sock; - return(0); + sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); + if (sock < 0) { + warnmsg(LOG_ERR, __func__, "socket(): %s", + strerror(errno)); + return (-1); + } + if (caph_rights_limit(sock, cap_rights_init(&rights, CAP_IOCTL)) < 0) { + warnmsg(LOG_ERR, __func__, "caph_rights_limit(): %s", + strerror(errno)); + (void)close(sock); + return (-1); + } + ifsock = sock; + return (0); } int @@ -150,10 +164,9 @@ interface_up(char *name) } close(s); - llflag = get_llflag(name); - if (llflag < 0) { + if (cap_llflags_get(capllflags, name, &llflag) != 0) { warnmsg(LOG_WARNING, __func__, - "get_llflag() failed, anyway I'll try"); + "cap_llflags_get() failed, anyway I'll try"); return (0); } @@ -273,8 +286,6 @@ lladdropt_fill(struct sockaddr_dl *sdl, struct nd_opt_ "unsupported link type(%d)", sdl->sdl_type); exit(1); } - - return; } struct sockaddr_dl * @@ -331,58 +342,6 @@ if_nametosdl(char *name) free(buf); return (ret_sdl); } - -/*------------------------------------------------------------*/ - -/* get ia6_flags for link-local addr on if. returns -1 on error. */ -static int -get_llflag(const char *name) -{ - struct ifaddrs *ifap, *ifa; - struct in6_ifreq ifr6; - struct sockaddr_in6 *sin6; - int s; - - if ((s = socket(PF_INET6, SOCK_DGRAM, 0)) < 0) { - warnmsg(LOG_ERR, __func__, "socket(SOCK_DGRAM): %s", - strerror(errno)); - exit(1); - } - if (getifaddrs(&ifap) != 0) { - warnmsg(LOG_ERR, __func__, "getifaddrs: %s", - strerror(errno)); - exit(1); - } - - for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - if (strlen(ifa->ifa_name) != strlen(name) || - strncmp(ifa->ifa_name, name, strlen(name)) != 0) - continue; - if (ifa->ifa_addr->sa_family != AF_INET6) - continue; - sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr; - if (!IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) - continue; - - memset(&ifr6, 0, sizeof(ifr6)); - strlcpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); - memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); - if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { - warnmsg(LOG_ERR, __func__, - "ioctl(SIOCGIFAFLAG_IN6): %s", strerror(errno)); - exit(1); - } - - freeifaddrs(ifap); - close(s); - return (ifr6.ifr_ifru.ifru_flags6); - } - - freeifaddrs(ifap); - close(s); - return (-1); -} - static void get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info) Modified: head/usr.sbin/rtsold/rtsock.c ============================================================================== --- head/usr.sbin/rtsold/rtsock.c Sat Jan 5 15:28:20 2019 (r342787) +++ head/usr.sbin/rtsold/rtsock.c Sat Jan 5 16:05:39 2019 (r342788) @@ -33,10 +33,11 @@ */ #include +#include +#include #include -#include #include -#include +#include #include #include @@ -46,6 +47,7 @@ #include #include +#include #include #include #include @@ -72,8 +74,20 @@ static struct { int rtsock_open(void) { + cap_rights_t rights; + int error, s; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 5 19:32:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C004141E9A4; Sat, 5 Jan 2019 19:32:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A612E8FBC5; Sat, 5 Jan 2019 19:32:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 983251D161; Sat, 5 Jan 2019 19:32:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x05JWns8065186; Sat, 5 Jan 2019 19:32:49 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05JWnLr065183; Sat, 5 Jan 2019 19:32:49 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201901051932.x05JWnLr065183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 5 Jan 2019 19:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342789 - stable/11/sys/dev/e1000 X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/11/sys/dev/e1000 X-SVN-Commit-Revision: 342789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A612E8FBC5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Jan 2019 19:32:50 -0000 Author: marius Date: Sat Jan 5 19:32:48 2019 New Revision: 342789 URL: https://svnweb.freebsd.org/changeset/base/342789 Log: MFC: r336610 (partial), r339207, r339267 - Or in the DMA coalescing Rx threshold so the other bits set in E1000_DMACR remain intact as intended in igb_init_dmac(). [1] - Fix igb corrupting checksums with BPF and VLAN In stable/11, this merely syncs the code with head as the problem was introduced with r311849 in the latter and then fixed by r339207 with a different approach than the code used pre-r311849 and in stable/11. - Use mbuf defines to construct csum offload masks rather than literals Reported by: Coverity CID: 1304929 [1] Modified: stable/11/sys/dev/e1000/if_em.h stable/11/sys/dev/e1000/if_igb.c stable/11/sys/dev/e1000/if_lem.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/e1000/if_em.h ============================================================================== --- stable/11/sys/dev/e1000/if_em.h Sat Jan 5 16:05:39 2019 (r342788) +++ stable/11/sys/dev/e1000/if_em.h Sat Jan 5 19:32:48 2019 (r342789) @@ -277,7 +277,7 @@ #define EM_MSIX_LINK 0x01000000 /* For 82574 use */ #define ETH_ZLEN 60 #define ETH_ADDR_LEN 6 -#define CSUM_OFFLOAD 7 /* Offload bits in mbuf flag */ +#define CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP) /* Offload bits in mbuf flag */ /* * 82574 has a nonstandard address for EIAC Modified: stable/11/sys/dev/e1000/if_igb.c ============================================================================== --- stable/11/sys/dev/e1000/if_igb.c Sat Jan 5 16:05:39 2019 (r342788) +++ stable/11/sys/dev/e1000/if_igb.c Sat Jan 5 19:32:48 2019 (r342789) @@ -2957,7 +2957,7 @@ igb_init_dmac(struct adapter *adapter, u32 pba) dmac = pba - 10; reg = E1000_READ_REG(hw, E1000_DMACR); reg &= ~E1000_DMACR_DMACTHR_MASK; - reg = ((dmac << E1000_DMACR_DMACTHR_SHIFT) + reg |= ((dmac << E1000_DMACR_DMACTHR_SHIFT) & E1000_DMACR_DMACTHR_MASK); /* transition to L0x or L1 if available..*/ @@ -3908,7 +3908,6 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, int ehdrlen, ip_hlen = 0; u16 etype; u8 ipproto = 0; - int offload = TRUE; int ctxd = txr->next_avail_desc; u16 vtag = 0; @@ -3916,9 +3915,6 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, if (mp->m_pkthdr.csum_flags & CSUM_TSO) return (igb_tso_setup(txr, mp, cmd_type_len, olinfo_status)); - if ((mp->m_pkthdr.csum_flags & CSUM_OFFLOAD) == 0) - offload = FALSE; - /* Indicate the whole packet as payload when not doing TSO */ *olinfo_status |= mp->m_pkthdr.len << E1000_ADVTXD_PAYLEN_SHIFT; @@ -3933,8 +3929,9 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, if (mp->m_flags & M_VLANTAG) { vtag = htole16(mp->m_pkthdr.ether_vtag); vlan_macip_lens |= (vtag << E1000_ADVTXD_VLAN_SHIFT); - } else if (offload == FALSE) /* ... no offload to do */ + } else if ((mp->m_pkthdr.csum_flags & CSUM_OFFLOAD) == 0) { return (0); + } /* * Determine where frame payload starts. @@ -3968,7 +3965,6 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_IPV6; break; default: - offload = FALSE; break; } @@ -3978,38 +3974,40 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, switch (ipproto) { case IPPROTO_TCP: #if __FreeBSD_version >= 1000000 - if (mp->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP)) + if (mp->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP)) { #else - if (mp->m_pkthdr.csum_flags & CSUM_TCP) + if (mp->m_pkthdr.csum_flags & CSUM_TCP) { #endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_TCP; + *olinfo_status |= E1000_TXD_POPTS_TXSM << 8; + } break; case IPPROTO_UDP: #if __FreeBSD_version >= 1000000 - if (mp->m_pkthdr.csum_flags & (CSUM_IP_UDP | CSUM_IP6_UDP)) + if (mp->m_pkthdr.csum_flags & (CSUM_IP_UDP | CSUM_IP6_UDP)) { #else - if (mp->m_pkthdr.csum_flags & CSUM_UDP) + if (mp->m_pkthdr.csum_flags & CSUM_UDP) { #endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_UDP; + *olinfo_status |= E1000_TXD_POPTS_TXSM << 8; + } break; #if __FreeBSD_version >= 800000 case IPPROTO_SCTP: #if __FreeBSD_version >= 1000000 - if (mp->m_pkthdr.csum_flags & (CSUM_IP_SCTP | CSUM_IP6_SCTP)) + if (mp->m_pkthdr.csum_flags & (CSUM_IP_SCTP | CSUM_IP6_SCTP)) { #else - if (mp->m_pkthdr.csum_flags & CSUM_SCTP) + if (mp->m_pkthdr.csum_flags & CSUM_SCTP) { #endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_SCTP; + *olinfo_status |= E1000_TXD_POPTS_TXSM << 8; + } break; #endif default: - offload = FALSE; break; } - - if (offload) /* For the TX descriptor setup */ - *olinfo_status |= E1000_TXD_POPTS_TXSM << 8; /* 82575 needs the queue index added */ if (adapter->hw.mac.type == e1000_82575) Modified: stable/11/sys/dev/e1000/if_lem.h ============================================================================== --- stable/11/sys/dev/e1000/if_lem.h Sat Jan 5 16:05:39 2019 (r342788) +++ stable/11/sys/dev/e1000/if_lem.h Sat Jan 5 19:32:48 2019 (r342789) @@ -241,7 +241,7 @@ #define EM_MSIX_MASK 0x01F00000 /* For 82574 use */ #define ETH_ZLEN 60 #define ETH_ADDR_LEN 6 -#define CSUM_OFFLOAD 7 /* Offload bits in mbuf flag */ +#define CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP) /* Offload bits in mbuf flag */ /* * 82574 has a nonstandard address for EIAC From owner-svn-src-all@freebsd.org Sat Jan 5 19:35:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EFD5141EB53; Sat, 5 Jan 2019 19:35:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C661E8FE8C; Sat, 5 Jan 2019 19:35:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBA451D166; Sat, 5 Jan 2019 19:35:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x05JZBrA065568; Sat, 5 Jan 2019 19:35:11 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05JZBq2065565; Sat, 5 Jan 2019 19:35:11 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201901051935.x05JZBq2065565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 5 Jan 2019 19:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342790 - stable/10/sys/dev/e1000 X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/sys/dev/e1000 X-SVN-Commit-Revision: 342790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C661E8FE8C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Jan 2019 19:35:12 -0000 Author: marius Date: Sat Jan 5 19:35:10 2019 New Revision: 342790 URL: https://svnweb.freebsd.org/changeset/base/342790 Log: MFC: r336610 (partial), r339207, r339267 - Or in the DMA coalescing Rx threshold so the other bits set in E1000_DMACR remain intact as intended in igb_init_dmac(). [1] - Fix igb corrupting checksums with BPF and VLAN In stable/11, this merely syncs the code with head as the problem was introduced with r311849 in the latter and then fixed by r339207 with a different approach than the code used pre-r311849 and in stable/11. - Use mbuf defines to construct csum offload masks rather than literals MF11: r340148 Don't use 9k jumbo clusters Reported by: Coverity CID: 1304929 [1] Modified: stable/10/sys/dev/e1000/if_em.c stable/10/sys/dev/e1000/if_igb.c stable/10/sys/dev/e1000/if_lem.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/if_em.c ============================================================================== --- stable/10/sys/dev/e1000/if_em.c Sat Jan 5 19:32:48 2019 (r342789) +++ stable/10/sys/dev/e1000/if_em.c Sat Jan 5 19:35:10 2019 (r342790) @@ -1435,10 +1435,15 @@ em_init_locked(struct adapter *adapter) */ if (adapter->hw.mac.max_frame_size <= 2048) adapter->rx_mbuf_sz = MCLBYTES; +#ifndef CONTIGMALLOC_WORKS + else + adapter->rx_mbuf_sz = MJUMPAGESIZE; +#else else if (adapter->hw.mac.max_frame_size <= 4096) adapter->rx_mbuf_sz = MJUMPAGESIZE; else adapter->rx_mbuf_sz = MJUM9BYTES; +#endif /* Prepare receive descriptors and buffers */ if (em_setup_receive_structures(adapter)) { Modified: stable/10/sys/dev/e1000/if_igb.c ============================================================================== --- stable/10/sys/dev/e1000/if_igb.c Sat Jan 5 19:32:48 2019 (r342789) +++ stable/10/sys/dev/e1000/if_igb.c Sat Jan 5 19:35:10 2019 (r342790) @@ -1309,10 +1309,15 @@ igb_init_locked(struct adapter *adapter) */ if (adapter->max_frame_size <= 2048) adapter->rx_mbuf_sz = MCLBYTES; +#ifndef CONTIGMALLOC_WORKS + else + adapter->rx_mbuf_sz = MJUMPAGESIZE; +#else else if (adapter->max_frame_size <= 4096) adapter->rx_mbuf_sz = MJUMPAGESIZE; else adapter->rx_mbuf_sz = MJUM9BYTES; +#endif /* Prepare receive descriptors and buffers */ if (igb_setup_receive_structures(adapter)) { @@ -2857,7 +2862,7 @@ igb_init_dmac(struct adapter *adapter, u32 pba) dmac = pba - 10; reg = E1000_READ_REG(hw, E1000_DMACR); reg &= ~E1000_DMACR_DMACTHR_MASK; - reg = ((dmac << E1000_DMACR_DMACTHR_SHIFT) + reg |= ((dmac << E1000_DMACR_DMACTHR_SHIFT) & E1000_DMACR_DMACTHR_MASK); /* transition to L0x or L1 if available..*/ @@ -3807,7 +3812,6 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, int ehdrlen, ip_hlen = 0; u16 etype; u8 ipproto = 0; - int offload = TRUE; int ctxd = txr->next_avail_desc; u16 vtag = 0; @@ -3815,9 +3819,6 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, if (mp->m_pkthdr.csum_flags & CSUM_TSO) return (igb_tso_setup(txr, mp, cmd_type_len, olinfo_status)); - if ((mp->m_pkthdr.csum_flags & CSUM_OFFLOAD) == 0) - offload = FALSE; - /* Indicate the whole packet as payload when not doing TSO */ *olinfo_status |= mp->m_pkthdr.len << E1000_ADVTXD_PAYLEN_SHIFT; @@ -3832,8 +3833,9 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, if (mp->m_flags & M_VLANTAG) { vtag = htole16(mp->m_pkthdr.ether_vtag); vlan_macip_lens |= (vtag << E1000_ADVTXD_VLAN_SHIFT); - } else if (offload == FALSE) /* ... no offload to do */ + } else if ((mp->m_pkthdr.csum_flags & CSUM_OFFLOAD) == 0) { return (0); + } /* * Determine where frame payload starts. @@ -3867,7 +3869,6 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_IPV6; break; default: - offload = FALSE; break; } @@ -3877,38 +3878,40 @@ igb_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp, switch (ipproto) { case IPPROTO_TCP: #if __FreeBSD_version >= 1000000 - if (mp->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP)) + if (mp->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP)) { #else - if (mp->m_pkthdr.csum_flags & CSUM_TCP) + if (mp->m_pkthdr.csum_flags & CSUM_TCP) { #endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_TCP; + *olinfo_status |= E1000_TXD_POPTS_TXSM << 8; + } break; case IPPROTO_UDP: #if __FreeBSD_version >= 1000000 - if (mp->m_pkthdr.csum_flags & (CSUM_IP_UDP | CSUM_IP6_UDP)) + if (mp->m_pkthdr.csum_flags & (CSUM_IP_UDP | CSUM_IP6_UDP)) { #else - if (mp->m_pkthdr.csum_flags & CSUM_UDP) + if (mp->m_pkthdr.csum_flags & CSUM_UDP) { #endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_UDP; + *olinfo_status |= E1000_TXD_POPTS_TXSM << 8; + } break; #if __FreeBSD_version >= 800000 case IPPROTO_SCTP: #if __FreeBSD_version >= 1000000 - if (mp->m_pkthdr.csum_flags & (CSUM_IP_SCTP | CSUM_IP6_SCTP)) + if (mp->m_pkthdr.csum_flags & (CSUM_IP_SCTP | CSUM_IP6_SCTP)) { #else - if (mp->m_pkthdr.csum_flags & CSUM_SCTP) + if (mp->m_pkthdr.csum_flags & CSUM_SCTP) { #endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_SCTP; + *olinfo_status |= E1000_TXD_POPTS_TXSM << 8; + } break; #endif default: - offload = FALSE; break; } - - if (offload) /* For the TX descriptor setup */ - *olinfo_status |= E1000_TXD_POPTS_TXSM << 8; /* 82575 needs the queue index added */ if (adapter->hw.mac.type == e1000_82575) Modified: stable/10/sys/dev/e1000/if_lem.h ============================================================================== --- stable/10/sys/dev/e1000/if_lem.h Sat Jan 5 19:32:48 2019 (r342789) +++ stable/10/sys/dev/e1000/if_lem.h Sat Jan 5 19:35:10 2019 (r342790) @@ -241,7 +241,7 @@ #define EM_MSIX_MASK 0x01F00000 /* For 82574 use */ #define ETH_ZLEN 60 #define ETH_ADDR_LEN 6 -#define CSUM_OFFLOAD 7 /* Offload bits in mbuf flag */ +#define CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP) /* Offload bits in mbuf flag */ /* * 82574 has a nonstandard address for EIAC From owner-svn-src-all@freebsd.org Sat Jan 5 19:49:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D44B8141F389; Sat, 5 Jan 2019 19:49:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D882569E0A; Sat, 5 Jan 2019 19:49:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x531.google.com with SMTP id m1so18925041pgq.8; Sat, 05 Jan 2019 11:49:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/j9h36X3hhe1v5pssCw0z0xQxWnQ/wIi1vaXi+hysUE=; b=HJVAV2JiS6So1xuBXfv03hOGPhbY62Aab8sFKfVBu7NHsA3h7SsEZW5TUQoVRC1JSU 0VxuW4VW/RQsij55GduYAx93fumgQ85TjEq7VhqEqVEladxksgaFw52835/8YsIvtlJe J7XzyOAQC5ybx6NdnZkhQPXTmhACMDDPxKYxRxapqszbpCr11yiHlIZbU1c7Suf14cIb Q89ovtAurqD0ZOfBbHXU/dHVabKwOytCc1YofZsq+fM3PU7LTj31i+GmulDoWeQOBoAO MHoYQor0lzEFxzoFHLlD0DWxVlKjC+U3989qne7BXm1qMAB7MmNfpRuR2UcGkFs9dRS+ SzXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/j9h36X3hhe1v5pssCw0z0xQxWnQ/wIi1vaXi+hysUE=; b=ghs9c+57xph8oYO6WlaZS7W10mYXoRnfrc8+AObL9QF5yVInUHwa9nXNunZ3oByG1g 1n16pjZu/QVYOrrXfgQoYm8ZvOlTuGbVug84ieTYnoHjkLWKlr3VOa1RqurbfDo+Tc5X 3+Cyq13KsBEr3AzNobcXbYTLe4ay8vuCsuWtfjSXmjH92iIGwuRPSXQ+YSfQ2oQ7LK42 CHyr0ygzCnOstCxdEVFH+VokT3ab06Ql3E1Gr7DBA7TUkGyctX7FUS9txjEx+D5JwdKp mXvZ1m+ytMhLbQAe2CxmXfVRq7PidQJ6OijEukTIiWA28A91by17IMIRMEnz9ib4wCvx T5hQ== X-Gm-Message-State: AA+aEWa0HVrs2tcQU3o2rkler9ZEgnbPVmv9xPWahXKxzOfs2Vn7XK2Z TpyeJ8tcDfjj3otRBlBYzLElsHOz X-Google-Smtp-Source: AFSGD/XLc029IkTAral6aiQLaI+FlUFljJBJqR1k0S7PG2ZNBePjkl44Zc+G+4cnWw+81SSq9WYVQg== X-Received: by 2002:a62:5dd1:: with SMTP id n78mr56388679pfj.58.1546717796480; Sat, 05 Jan 2019 11:49:56 -0800 (PST) Received: from ?IPv6:2607:fb90:82a9:a99e:b851:5f32:3f1d:bd9? ([2607:fb90:82a9:a99e:b851:5f32:3f1d:bd9]) by smtp.gmail.com with ESMTPSA id a195sm116413911pfa.7.2019.01.05.11.49.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Jan 2019 11:49:55 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r342774 - head/sys/conf From: Enji Cooper X-Mailer: iPhone Mail (16C104) In-Reply-To: <201901041838.x04IcSXf074418@repo.freebsd.org> Date: Sat, 5 Jan 2019 11:49:55 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5E026C13-9D49-4F34-A0FC-8120CF214B4E@gmail.com> References: <201901041838.x04IcSXf074418@repo.freebsd.org> To: Andrew Gallatin X-Rspamd-Queue-Id: D882569E0A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=HJVAV2Ji; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::531 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-6.06 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.88)[-0.879,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-2.68)[ip: (-9.43), ipnet: 2607:f8b0::/32(-2.20), asn: 15169(-1.67), country: US(-0.08)]; RCVD_IN_DNSWL_NONE(0.00)[1.3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2019 19:49:59 -0000 > On Jan 4, 2019, at 10:38, Andrew Gallatin wrote: >=20 > Author: gallatin > Date: Fri Jan 4 18:38:27 2019 > New Revision: 342774 > URL: https://svnweb.freebsd.org/changeset/base/342774 >=20 > Log: > Limit git history searches in newvers.sh >=20 > newvers.sh takes upwards of 4-5 seconds to complete on trees checked > out from github, due to searching the entire history for non-existent > git-svn metadata. Similarly, if one does not check out notes, we > again search the entire history for notes. That makes newvers.sh very > slow for many github users. >=20 > To fix this in a fair way, limit the history search to the last 10K > commits: if you're more than 10K commits out of sync, then you've > forked the project, and our SVN rev is no longer very important to you. >=20 > Due to how git implements --grep in conjunction with -n, --grep has been > removed for performance reasons (git does not seem to limit its search > to the -n limit in this case, and takes just as long as it did with no > limit). Wonderful =E2=80=94 thank you Andrew :)!! -Enji= From owner-svn-src-all@freebsd.org Sat Jan 5 21:07:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A9E414230D8; Sat, 5 Jan 2019 21:07:51 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE6CF6D349; Sat, 5 Jan 2019 21:07:50 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6917E1E0E2; Sat, 5 Jan 2019 21:07:50 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x05L7o4S014561; Sat, 5 Jan 2019 21:07:50 GMT (envelope-from joerg@FreeBSD.org) Received: (from joerg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05L7oOO014560; Sat, 5 Jan 2019 21:07:50 GMT (envelope-from joerg@FreeBSD.org) Message-Id: <201901052107.x05L7oOO014560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: joerg set sender to joerg@FreeBSD.org using -f From: Joerg Wunsch Date: Sat, 5 Jan 2019 21:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342791 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: joerg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 342791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE6CF6D349 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,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, 05 Jan 2019 21:07:51 -0000 Author: joerg Date: Sat Jan 5 21:07:49 2019 New Revision: 342791 URL: https://svnweb.freebsd.org/changeset/base/342791 Log: Fix an old typo in the element status display bits: INEAB -> INENAB (import is eNabled) Note that this kernel definition is exported into chio(1), and used for element display there. MFC after: 1 week Modified: head/sys/sys/chio.h Modified: head/sys/sys/chio.h ============================================================================== --- head/sys/sys/chio.h Sat Jan 5 19:35:10 2019 (r342790) +++ head/sys/sys/chio.h Sat Jan 5 21:07:49 2019 (r342791) @@ -266,7 +266,7 @@ struct changer_set_voltag_request { #define CESTATUS_BITS \ - "\20\6INEAB\5EXENAB\4ACCESS\3EXCEPT\2IMPEXP\1FULL" + "\20\6INENAB\5EXENAB\4ACCESS\3EXCEPT\2IMPEXP\1FULL" #define CHIOMOVE _IOW('c', 0x01, struct changer_move) #define CHIOEXCHANGE _IOW('c', 0x02, struct changer_exchange) From owner-svn-src-all@freebsd.org Sat Jan 5 21:23:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D68814236D0; Sat, 5 Jan 2019 21:23:26 +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 11E086DB33; Sat, 5 Jan 2019 21:23:26 +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 06F961E448; Sat, 5 Jan 2019 21:23:26 +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 x05LNPLF024711; Sat, 5 Jan 2019 21:23:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05LNPY0024709; Sat, 5 Jan 2019 21:23:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901052123.x05LNPY0024709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 5 Jan 2019 21:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342792 - in head: libexec/rc share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: libexec/rc share/man/man8 X-SVN-Commit-Revision: 342792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 11E086DB33 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 05 Jan 2019 21:23:26 -0000 Author: kevans Date: Sat Jan 5 21:23:25 2019 New Revision: 342792 URL: https://svnweb.freebsd.org/changeset/base/342792 Log: rc.subr: Provide rc_service variable for service scripts Some rc scripts in ports (e.g. uwsgi, apache, openvpn) allow for 'application profiles' that usually require the rc script to be invoked again for each active profile. Because there's no consistent way to determine the path because it differs between manual/service(8) invocations and /etc/rc invocations, this leads to patterns like these: - www/uwsgi hardcodes the script path - security/openvpn guesses either $_file or $0 based on $0 = /etc/rc Instead of forcing rc scripts to guess, provide an rc_service variable to the scripts that gets set appropriately both for direct execution or when a script is being executed via run_rc_script (e.g. /etc/rc). This is our analog of an OpenRC variable with the same name, different case (RC_SERVICE). PR: 234614 Reported by: koobs Reviewed by: dteske, jilles MFC after: 3 days Modified: head/libexec/rc/rc.subr head/share/man/man8/rc.subr.8 Modified: head/libexec/rc/rc.subr ============================================================================== --- head/libexec/rc/rc.subr Sat Jan 5 21:07:49 2019 (r342791) +++ head/libexec/rc/rc.subr Sat Jan 5 21:23:25 2019 (r342792) @@ -52,6 +52,14 @@ ID="/usr/bin/id" IDCMD="if [ -x $ID ]; then $ID -un; fi" PS="/bin/ps -ww" JID=0 +# rc_service provides the path to the service script that we are executing. +# This is not being set here in an execution context, necessarily, so it's +# really just a reasonable guess, and it will get overwritten later if +# we are executing from some other means than direct execution by service(8) +# or manual invocation of the service script. The prime example of this is +# during system startup, all rc scripts will be invoked via /etc/rc, so +# run_rc_script will overwrite rc_service with the file being sourced. +rc_service="$0" # # functions @@ -879,6 +887,9 @@ check_startmsgs() # by $flags from the environment. # This variable may be changed by the precmd method. # +# rc_service Path to the service being executed, in case it needs to +# re-invoked. +# # rc_pid PID of command (if appropriate) # # rc_fast Not empty if "fast" was provided (q.v.) @@ -1382,6 +1393,7 @@ run_rc_script() required_vars eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd + rc_service="$_file" case "$_file" in /etc/rc.d/*.sh) # no longer allowed in the base warn "Ignoring old-style startup script $_file" Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Sat Jan 5 21:07:49 2019 (r342791) +++ head/share/man/man8/rc.subr.8 Sat Jan 5 21:23:25 2019 (r342792) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2018 +.Dd January 5, 2019 .Dt RC.SUBR 8 .Os .Sh NAME @@ -771,7 +771,7 @@ The following variables are available to the methods as well as after .Ic run_rc_command has completed: -.Bl -tag -width ".Va rc_flags" -offset indent +.Bl -tag -width ".Va rc_service" -offset indent .It Va rc_arg Argument provided to .Ic run_rc_command , @@ -785,6 +785,8 @@ unless overridden by the environment variable This variable may be changed by the .Ar argument Ns Va _precmd method. +.It Va rc_service +Path to the service script being executed, in case it needs to re-invoke itself. .It Va rc_pid PID of .Va command From owner-svn-src-all@freebsd.org Sat Jan 5 22:45:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B4F01425A92; Sat, 5 Jan 2019 22:45:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1063C70636; Sat, 5 Jan 2019 22:45:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 026531F203; Sat, 5 Jan 2019 22:45:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x05MjMJE067202; Sat, 5 Jan 2019 22:45:22 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05MjKGo067160; Sat, 5 Jan 2019 22:45:20 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201901052245.x05MjKGo067160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 5 Jan 2019 22:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342793 - in head: . share/mk stand/efi/boot1 stand/efi/libefi stand/efi/loader stand/i386 stand/i386/loader stand/libsa stand/sparc64 stand/sparc64/loader stand/userboot/userboot tools... X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: . share/mk stand/efi/boot1 stand/efi/libefi stand/efi/loader stand/i386 stand/i386/loader stand/libsa stand/sparc64 stand/sparc64/loader stand/userboot/userboot tools/build/options X-SVN-Commit-Revision: 342793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1063C70636 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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, 05 Jan 2019 22:45:23 -0000 Author: mmacy Date: Sat Jan 5 22:45:20 2019 New Revision: 342793 URL: https://svnweb.freebsd.org/changeset/base/342793 Log: MK_ZFS -> {MK_ZFS|MK_LOADER_ZFS}, this is so we can diable userland / kernel ZFS but keep the boot-loaders when using ZoL port. MFC after: 1 week Reviewed by: rgrimes Differential Revision: https://reviews.freebsd.org/D18739 Added: head/tools/build/options/WITHOUT_LOADER_ZFS (contents, props changed) Modified: head/.gitattributes head/share/mk/src.opts.mk head/stand/efi/boot1/Makefile head/stand/efi/libefi/Makefile head/stand/efi/loader/Makefile head/stand/i386/Makefile head/stand/i386/loader/Makefile head/stand/libsa/Makefile head/stand/sparc64/Makefile head/stand/sparc64/loader/Makefile head/stand/userboot/userboot/Makefile head/tools/build/options/WITHOUT_ZFS Modified: head/.gitattributes ============================================================================== --- head/.gitattributes Sat Jan 5 21:23:25 2019 (r342792) +++ head/.gitattributes Sat Jan 5 22:45:20 2019 (r342793) @@ -3,3 +3,4 @@ *.cpp diff=cpp *.hpp diff=cpp *.py diff=python +. svn-properties=svn:keywords=tools/build/options/WITHOUT_LOADER_ZFS Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat Jan 5 21:23:25 2019 (r342792) +++ head/share/mk/src.opts.mk Sat Jan 5 22:45:20 2019 (r342793) @@ -191,6 +191,7 @@ __DEFAULT_YES_OPTIONS = \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ + LOADER_ZFS \ ZONEINFO __DEFAULT_NO_OPTIONS = \ @@ -451,6 +452,7 @@ MK_SOURCELESS_UCODE:= no .if ${MK_CDDL} == "no" MK_ZFS:= no +MK_LOADER_ZFS:= no MK_CTF:= no .endif Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/efi/boot1/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -25,7 +25,7 @@ CWARNFLAGS.zfs_module.c += -Wno-unused-function # architecture-specific loader code SRCS= boot1.c self_reloc.c start.S ufs_module.c -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" SRCS+= zfs_module.c CFLAGS.zfs_module.c+= -I${ZFSSRC} CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/boot/zfs Modified: head/stand/efi/libefi/Makefile ============================================================================== --- head/stand/efi/libefi/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/efi/libefi/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -44,7 +44,7 @@ CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINCMD} -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: head/stand/efi/loader/Makefile ============================================================================== --- head/stand/efi/loader/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/efi/loader/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -26,7 +26,7 @@ SRCS= autoload.c \ vers.c CFLAGS+= -I${.CURDIR}/../loader -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT HAVE_ZFS= yes Modified: head/stand/i386/Makefile ============================================================================== --- head/stand/i386/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/i386/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -20,6 +20,6 @@ SUBDIR.yes+= pxeldr SUBDIR.yes+= kgzldr .endif -SUBDIR.${MK_ZFS}+= zfsboot gptzfsboot +SUBDIR.${MK_LOADER_ZFS}+= zfsboot gptzfsboot .include Modified: head/stand/i386/loader/Makefile ============================================================================== --- head/stand/i386/loader/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/i386/loader/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -1,6 +1,6 @@ # $FreeBSD$ -HAVE_ZFS= ${MK_ZFS} +HAVE_ZFS= ${MK_LOADER_ZFS} LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes @@ -64,7 +64,7 @@ ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} -.if ${MK_ZFS} == "yes" && ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} +.if ${MK_LOADER_ZFS} == "yes" && ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} LINKS+= ${BINDIR}/${LOADER} ${BINDIR}/zfsloader .endif .if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/libsa/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -165,7 +165,7 @@ SRCS+= explicit_bzero.c crc32_libkern.c .endif # Maybe ZFS -.if ${MK_ZFS} == "yes" +.if ${MK_LOADER_ZFS} == "yes" .include "${SASRC}/zfs/Makefile.inc" .endif Modified: head/stand/sparc64/Makefile ============================================================================== --- head/stand/sparc64/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/sparc64/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -5,6 +5,6 @@ NO_OBJ=t .include SUBDIR.yes= boot1 loader -SUBDIR.${MK_ZFS}+=zfsboot +SUBDIR.${MK_LOADER_ZFS}+=zfsboot .include Modified: head/stand/sparc64/loader/Makefile ============================================================================== --- head/stand/sparc64/loader/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/sparc64/loader/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -1,6 +1,6 @@ # $FreeBSD$ -HAVE_ZFS= ${MK_ZFS} +HAVE_ZFS= ${MK_LOADER_ZFS} LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes @@ -21,7 +21,7 @@ NEWVERSWHAT?= "bootstrap loader" sparc64 VERSION_FILE= ${.CURDIR}/../loader/version INSTALLFLAGS= -b -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" HAVE_ZFS= yes .endif @@ -42,7 +42,7 @@ HELP_FILES= ${.CURDIR}/help.sparc64 LDFLAGS+= -static -.if ${MK_ZFS} == "yes" +.if ${MK_LOADER_ZFS} == "yes" LINKS= ${BINDIR}/loader ${BINDIR}/zfsloader .endif Modified: head/stand/userboot/userboot/Makefile ============================================================================== --- head/stand/userboot/userboot/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/userboot/userboot/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -45,7 +45,7 @@ VERSION_FILE= ${.CURDIR}/../userboot/version LINKS+= ${BINDIR}/${SHLIB_NAME} ${BINDIR}/userboot.so .endif -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT HAVE_ZFS=yes .endif Added: head/tools/build/options/WITHOUT_LOADER_ZFS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LOADER_ZFS Sat Jan 5 22:45:20 2019 (r342793) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build ZFS file system boot loader support. Modified: head/tools/build/options/WITHOUT_ZFS ============================================================================== --- head/tools/build/options/WITHOUT_ZFS Sat Jan 5 21:23:25 2019 (r342792) +++ head/tools/build/options/WITHOUT_ZFS Sat Jan 5 22:45:20 2019 (r342793) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to not build ZFS file system. +Set to not build ZFS file system kernel module, libraries, and user commands.